fix(dkg): defer dispatch by one block at phase boundaries - #725
Open
jannikluhn wants to merge 1 commit into
Open
fix(dkg): defer dispatch by one block at phase boundaries#725jannikluhn wants to merge 1 commit into
jannikluhn wants to merge 1 commit into
Conversation
Gas estimation races the phase boundary: an RPC node can announce block N via newHead while eth_estimateGas still executes against the state of N-1. A message enqueued on the boundary block then reverts with WrongPhase during estimation, which txsender classifies as non-transient and marks failed. Since the dkg_sent_actions marker is written atomically with the outbox row, the keyper never retries the action and sits out the whole phase. Add DispatchPhaseAt, which matches PhaseAt except on the first block of each phase window, and route processDKG through it. The contract window is unchanged, so with phaseLength L the remaining L-1 blocks are ample for inclusion. Windows with phaseLength <= 2 are exempt: they have no block that is both past the boundary and still has an in-window successor, since a transaction triggered by block B is included at B+1 at the earliest. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
blockchainluffy
approved these changes
Aug 27, 2026
Contributor
Author
|
Closes #721 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gas estimation races the phase boundary: an RPC node can announce block N via newHead while eth_estimateGas still executes against the state of N-1. A message enqueued on the boundary block then reverts with WrongPhase during estimation, which txsender classifies as non-transient and marks failed. Since the dkg_sent_actions marker is written atomically with the outbox row, the keyper never retries the action and sits out the whole phase.
Add DispatchPhaseAt, which matches PhaseAt except on the first block of each phase window, and route processDKG through it. The contract window is unchanged, so with phaseLength L the remaining L-1 blocks are ample for inclusion.
Windows with phaseLength <= 2 are exempt: they have no block that is both past the boundary and still has an in-window successor, since a transaction triggered by block B is included at B+1 at the earliest.