Skip to content

Commit 730858d

Browse files
authored
support internal transactions (#437)
1 parent 2544a78 commit 730858d

File tree

6 files changed

+30
-5
lines changed

6 files changed

+30
-5
lines changed

nix/nixosModules.nix

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@
220220
};
221221
nixosConfigurations."psyche-http-mainnet" = persistentPsycheWebsite {
222222
configName = "psyche-http-mainnet";
223-
hostnames = [ "mainnet-preview.psyche.network" ];
223+
hostnames = [
224+
"mainnet-preview.psyche.network"
225+
"psyche.network"
226+
];
224227
backendSecret = ../secrets/mainnet/backend.age;
225228
miningPoolRpc = mainnetFrontendRpc;
226229
coordinatorCluster = "devnet";

website/backend/src/chainLoop.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,12 @@ export function startWatchChainLoop<D>(): <
104104
if (cancelled.cancelled) {
105105
return
106106
}
107-
const instr = tx.transaction.message.instructions
107+
const instr = [
108+
...tx.transaction.message.instructions,
109+
...(data[1].meta?.innerInstructions?.flatMap(
110+
(i) => i.instructions
111+
) ?? []),
112+
]
108113
for (const i of instr) {
109114
// instructions without a payload aren't useful to us.
110115
if (!('data' in i)) {
@@ -120,6 +125,9 @@ export function startWatchChainLoop<D>(): <
120125
)
121126
}
122127
if (!rawDecoded) {
128+
console.warn(
129+
`No data for instruction with data${i.data}. Skipping.`
130+
)
123131
continue
124132
}
125133
try {
@@ -154,7 +162,8 @@ export function startWatchChainLoop<D>(): <
154162
}
155163
} catch (err) {
156164
console.error(
157-
`[${name}] chain loop encountered an error, restarting: ${err}`
165+
`[${name}] chain loop encountered an error, restarting,`,
166+
err
158167
)
159168
onError(err)
160169
} finally {

website/backend/src/coordinatorChainLoop.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,19 @@ export async function startWatchCoordinatorChainLoop(
363363
}
364364
}
365365
},
366+
366367
async onDoneCatchup(store, runUpdates) {
367-
const allRuns = [...runUpdates.getRuns()]
368+
const allRuns = [...runUpdates.getRuns()].filter((run) => {
369+
// known broken addrs
370+
if (
371+
run[0] === '5rHDPfLLYNxKDh86GYtx6nF94WAS2uvHp4zp7WUqsBSg' ||
372+
run[0] === 'Gewx2auE9MBxNkbDevDSPBdDjDekNhhoyYyYaxEfM2gy' ||
373+
run[0] === 'GWBFVhEi1nCp2J2E7paukFMZ9PE1hAa9dQcvZSeQoKAj'
374+
) {
375+
return false
376+
}
377+
return true
378+
})
368379
if (allRuns.length === 0) {
369380
return
370381
}

website/backend/src/dataStores/flatFileCoordinator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ const ALLOWLISTED_RUN_IDS =
3838
'hermes-4-8b',
3939
'hermes-4-8b-2',
4040
'dm-fwedu-baseline',
41+
'dm-fwedu-baseline-2',
4142
'dm-dclm-baseline',
4243
'dm-fwedu-dclm',
4344
'dm-fwedu-dclm-fpdf',

website/backend/src/rateLimit.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ export function makeRetryPromise<T extends (...args: any[]) => Promise<any>>(
9090
try {
9191
return await fn(...args)
9292
} catch (err) {
93+
console.warn(err)
9394
if (attempts >= maxRetries) {
9495
throw err
9596
}

website/frontend/src/components/RunSummary.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const RunSummaryCard = memo(function RunSummaryCard({
125125
pausedAt={new Date(0)}
126126
/>
127127
)}
128-
<span>tokens trained</span>
128+
<span>&nbsp;tokens trained</span>
129129
</div>
130130
</ShadowCard>
131131
)

0 commit comments

Comments
 (0)