fix(api): fail closed when getPayload delivery mutex hits Redis errors - #795
Open
SashaMIT wants to merge 1 commit into
Open
fix(api): fail closed when getPayload delivery mutex hits Redis errors#795SashaMIT wants to merge 1 commit into
SashaMIT wants to merge 1 commit into
Conversation
CheckAndSetLastSlotAndHashDelivered already rejects known dual-delivery cases, but any other Redis/Watch error was only logged and getPayload continued without a successful last-slot/hash record. Treat unexpected errors as HTTP 500 and abort delivery.
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.
Summary
innerHandleGetPayloadcallsCheckAndSetLastSlotAndHashDeliveredto record that a payload was delivered for a slot/hash. Known policy errors (ErrAnotherPayload…,ErrPastSlot…,redis.TxFailedErr) already returned 400.On any other Redis/Watch error the code only logged and continued into payload delivery. That means getPayload could proceed without a successful last-slot/hash record, weakening the dual-payload / already-delivered gate.
Unexpected Redis failures now return HTTP 500 and abort.
Attacker model
An operator or network fault that makes the delivery-mutex Redis call fail unexpectedly no longer lets payload delivery continue as if the mutex succeeded. Distinct from registerValidator signature fail-closed (#793).
Threat-model note
The proposer already has a valid getPayload request. The gap is availability of the delivery mutex: fail-open on infrastructure errors undercuts the protocol check that mutex exists to enforce.
Test plan
TestGetPayloadDeliveryCheckAbortcovers known 400s, unexpected 500, and nil continuego test ./…Made with Cursor