Context
In PayloadEnvelopeInput.addPayloadEnvelope(), a second call throws "Payload envelope already set". This is reachable from external input paths when API and gossip race:
- API handler receives envelope, sleeps for slot boundary alignment
- Gossip envelope arrives during the sleep, gets added first
- API handler wakes up and calls
addPayloadEnvelope() → throws → 500 error to the VC
This is relevant in multi-node or DVT setups where the proposer's envelope arrives via gossip before the API call completes (similar to #8849).
Proposed fix
Make addPayloadEnvelope() idempotent — silently return (or log) if the envelope is already set, matching the dedup semantics of shouldImport(). At minimum, the API handler should catch this gracefully instead of returning a 500.
References
/cc @nflaig @twoeths
Context
In
PayloadEnvelopeInput.addPayloadEnvelope(), a second call throws"Payload envelope already set". This is reachable from external input paths when API and gossip race:addPayloadEnvelope()→ throws → 500 error to the VCThis is relevant in multi-node or DVT setups where the proposer's envelope arrives via gossip before the API call completes (similar to #8849).
Proposed fix
Make
addPayloadEnvelope()idempotent — silently return (or log) if the envelope is already set, matching the dedup semantics ofshouldImport(). At minimum, the API handler should catch this gracefully instead of returning a 500.References
payloadEnvelopeInput.ts(review comment)/cc @nflaig @twoeths