Skip to content

Commit

Permalink
stop retrying oracle updates inside mangolana
Browse files Browse the repository at this point in the history
  • Loading branch information
mschneider committed Aug 6, 2024
1 parent 68ce887 commit ca5cd03
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions ts/client/scripts/sb-on-demand-crank.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ interface OracleInterface {

for (let i = 0; i < 10; i++) {
const startedAt = Date.now();
const slot = await client.connection.getSlot('finalized');
const [block, slot] = await Promise.all([
client.connection.getLatestBlockhash('finalized'),
client.connection.getSlot('finalized')
]);

await updateFilteredOraclesAis(
client.connection,
Expand Down Expand Up @@ -173,6 +176,9 @@ interface OracleInterface {
? [new Connection(CLUSTER_URL_2!, 'recent')]
: []),
],
// fail rather quickly and retry submission from scratch
// timeout using finalized to stay below switchboard oracle staleness limit
timeoutStrategy: { block, startBlockCheckAfterSecs: 20 },
transactionInstructions: ixsChunks.map((txChunk) => ({
instructionsSet: [
{
Expand All @@ -187,9 +193,8 @@ interface OracleInterface {
sequenceType: SequenceType.Parallel,
})),
config: {
maxTxesInBatch: 1,
maxRetries: 5,
autoRetry: true,
maxTxesInBatch: 10,
autoRetry: false,
logFlowInfo: false,
},
callbacks: {
Expand Down

0 comments on commit ca5cd03

Please sign in to comment.