fix(engine): scope engine-API retry budget to consensus phase#3112
Draft
fridrik01 wants to merge 2 commits into
Draft
fix(engine): scope engine-API retry budget to consensus phase#3112fridrik01 wants to merge 2 commits into
fridrik01 wants to merge 2 commits into
Conversation
185bd6e to
c5bee9a
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## fix-engine-4xx-retry-loop #3112 +/- ##
=============================================================
+ Coverage 61.34% 61.38% +0.04%
=============================================================
Files 370 371 +1
Lines 18936 18948 +12
=============================================================
+ Hits 11617 11632 +15
+ Misses 6363 6360 -3
Partials 956 956
🚀 New features to boost your workflow:
|
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.
This PR scopes the engine-API retry budget to the consensus phase that issued the call, so a stuck or hostile EL can no longer trap consensus by inducing an infinite retry inside an ABCI handler.
Previously, every engine call from beacon-kit went through
backoff.WithMaxTries(0)+backoff.WithMaxElapsedTime(0), which means an infinite retry on anything not explicitly wrapped inPermanent. PR #3109 fixed the specific HTTP 413 vector by classifying 4xx as fatal, but the architectural pattern remained. Any error the classifier missed (5xx, EOF, syncing status, novel transport shape) inherited infinite retry. This PR replaces the one-size-fits-all policy with a per-phase budget.Changes
EnginePhaseenum (PhaseBuild/PhaseValidate/PhaseFinalize/PhaseStartup) is now a required constructor argument totransition.NewTransitionCtx. A future change that flipsVerifyPayload(true)on the proposer path can no longer silently inherit Validate semantics, it fails at compile time.NotifyForkchoiceUpdate/NotifyNewPayloadderive their backoffMaxElapsedTimefrom the phase:PhaseBuildandPhaseValidateare bounded at 75% of CometBFT'sTimeoutPropose/TimeoutPrevote. A stuck or hostile EL causes the proposer to skip (or the validator to reject), and CometBFT advances to the next round.PhaseFinalizeandPhaseStartupare unbounded for transient signals only.IsNonFatalError(transport errors, 5xx, syncing) retries forever, so a brief EL outage (bera-reth restart, reverse-proxy hiccup) doesn't drop a consensus-finalized block.backoff.Permanentin every phase, including Finalize. A misconfigured JWT or wrong chain ID surfaces immediately instead of hot-looping silently.What does not change
ECONNREFUSED/ECONNRESET/5xx/EOFcontinue to retry forever inPhaseFinalizeviaIsNonFatalError.PrepareProposalfailure semantics are unchanged from the operator's perspective (no proposal, CometBFT picks another proposer).