Skip to content

Commit

Permalink
fix: increase block production timeouts to account for event loop lag
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig committed Feb 2, 2025
1 parent 7982031 commit 89f4e4b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/beacon-node/src/api/impl/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ export const SYNC_TOLERANCE_EPOCHS = 1;
* Post this time, race execution and builder to pick whatever resolves first
*
* Empirically the builder block resolves in ~1.5+ seconds, and execution should resolve <1 sec.
* So lowering the cutoff to 2 sec from 3 seconds to publish faster for successful proposal
* as proposals post 4 seconds into the slot seems to be not being included
* So lowering the cutoff to 2.5 sec from 3 seconds to publish faster for successful proposal
* as proposals post 4 seconds into the slot will likely be orphaned due to proposer boost reorg.
*/
const BLOCK_PRODUCTION_RACE_CUTOFF_MS = 2_000;
const BLOCK_PRODUCTION_RACE_CUTOFF_MS = 2_500;
/** Overall timeout for execution and block production apis */
const BLOCK_PRODUCTION_RACE_TIMEOUT_MS = 12_000;

Expand Down
8 changes: 7 additions & 1 deletion packages/beacon-node/src/execution/builder/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,17 @@ export class NoBidReceived extends Error {
}
}

/**
* Additional duration to account for potential event loop lag which causes
* builder blocks to be rejected even though the response was sent in time.
*/
const EVENT_LOOP_LAG_BUFFER = 250;

/**
* Duration given to the builder to provide a `SignedBuilderBid` before the deadline
* is reached, aborting the external builder flow in favor of the local build process.
*/
const BUILDER_PROPOSAL_DELAY_TOLERANCE = 1000;
const BUILDER_PROPOSAL_DELAY_TOLERANCE = 1000 + EVENT_LOOP_LAG_BUFFER;

export class ExecutionBuilderHttp implements IExecutionBuilder {
readonly api: BuilderApi;
Expand Down

0 comments on commit 89f4e4b

Please sign in to comment.