Skip to content

fix(api): fail closed when getPayload delivery mutex hits Redis errors - #795

Open
SashaMIT wants to merge 1 commit into
flashbots:mainfrom
SashaMIT:fix/getpayload-fail-closed-redis-delivery-check
Open

fix(api): fail closed when getPayload delivery mutex hits Redis errors#795
SashaMIT wants to merge 1 commit into
flashbots:mainfrom
SashaMIT:fix/getpayload-fail-closed-redis-delivery-check

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

innerHandleGetPayload calls CheckAndSetLastSlotAndHashDelivered to 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

  • TestGetPayloadDeliveryCheckAbort covers known 400s, unexpected 500, and nil continue
  • Revert-tested: making unexpected errors non-abort fails the new test
  • CI go test ./…

Made with Cursor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant