fixes memleak and refactors submission pipe a bit#425
Conversation
| block_number: payload.block_number, | ||
| parent_hash: payload.parent_hash, | ||
| fee_recipient: payload.fee_recipient, | ||
| bid_slot: bid_trace.slot, |
There was a problem hiding this comment.
nit: maybe just call it slot? bid.bid_slot
crates/types/src/hydration.rs
Outdated
| None => return s.can_hydrate_inner( | ||
| &FxHashMap::default(), | ||
| &FxHashMap::default(), | ||
| max_blobs_per_block, | ||
| ), |
There was a problem hiding this comment.
very much a nit: is this worth an early return?
| let (submission, maybe_tx_root) = match self.hydrate(submission_data.submission) { | ||
| Ok(v) => v, | ||
| Err(e) => { | ||
| send_submission_result(producers, &self.future_results, submission_ref, Err(e)); | ||
| error!(?e, "hydration failed after pre-check passed"); | ||
| return; | ||
| } | ||
| }; |
There was a problem hiding this comment.
🟡 Optimistic bid left in sorter when hydration fails post-sort in handle_submission
In handle_submission (crates/relay/src/auctioneer/submit_block.rs), the optimistic bid is sorted into bid_sorter at line 71 and the success result is sent to the builder at line 79. The sim request is sent at line 95. Then at line 97-101, if self.hydrate() fails, the function returns early without storing the payload or cleaning up the bid from the sorter. The bid sorter now references a block_hash with no corresponding entry in self.payloads. When get_header is called (crates/relay/src/auctioneer/get_header.rs:41-43), it finds the block_hash from the sorter but fails to look up the payload, triggering the "this should never happen" error path. While the can_hydrate pre-check in validate_submission (crates/relay/src/auctioneer/validation.rs:35-38) makes this path practically unreachable, the lack of cleanup on the error path means a subtle cache inconsistency or future code change could expose this.
Was this helpful? React with 👍 or 👎 to provide feedback.
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com>
bdd30d1 to
3aa518d
Compare
Uh oh!
There was an error while loading. Please reload this page.