refactor: move block merging logic into simulator#440
Open
tosynthegeek wants to merge 1 commit into
Open
Conversation
- Move full `BlockMerger` responsibility from auctioneer to simulator - Simplify auctioneer to bid ranking + payload storage only - Trigger merges internally after validation instead of external RPC - Eliminate auctioneer → simulator ExecutionPayload roundtrip for merges - Rename auctioneer `BlockMerger` → `MergedBidCache` (cache-only) - Subscribe simulator to `TopBidForSim` spine queue for base block tracking - `ValidatedMergeCandidate` now carries full payload from validation success path Fixes gattaca-com#438
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.
Move block merging from auctioneer to simulator tile
Closes #438
Summary
Eliminates the merge round-trip through the auctioneer. Previously, the auctioneer tracked merge state, sent
SimRequest::Mergeto the simulator, received the response asEvent::MergeResult, and assembled the merged payload. Now the simulator tile owns the entire merge lifecycle and delivers a finishedPayloadEntrydirectly to the auctioneer.Changes
spine/messages.rs: AddedTopBidForSim(auctioneer → sim tile, base block tracking) andMergedBlockSubmission(sim tile → auctioneer, merged payload ready). AddedNO_IL_IXsentinel for slots without an inclusion list.mod.rs: Addedtop_bid_for_simandmerged_blockqueues toHelixSpine.simulator/block_merger.rs(new):SimBlockMergerowns order pool, appendable block tracking, merge request building, and payload assembly (assemble_payload). TakesRelayConfigsoinclusion_listconfig is accessible.take_base_infoprovides blobs bundle and builder pubkey for assembly.add_inclusion_listcorrectly reads fromrelay_config.inclusion_list.mod.rs: RemovedSimRequest::Merge.SimResultreplacesMergewithMergedPayload(Box<PayloadEntry>).tile.rs:SimulatorTilenow hasSimBlockMerger,sim_il,merging_enabled. After validation succeeds,ValidatedMergeCandidateis built from pre-captured fields (before the async spawn) and sent back viaValidationDone.handle_merge_doneassembles the payload synchronously on the tile thread.on_new_slotseeds the IL fromsim_ilusingNO_IL_IXsentinel. ConsumesTopBidForSimto update the base block.auctioneer/merged_bid_cache.rs(renamed fromblock_merger.rs): Stripped toMergedBidCacheforget_headertracking plusget_mergeable_orders. All order pooling and request building removed.context.rs:BlockMergerremoved fromSlotContext, replaced byMergedBidCache. Addedsim_il: Arc<SharedVector<InclusionListWithMetadata>>.on_new_slotpushes IL intosim_iland passes the index inToSimMsg::ix.handle_merged_payloadreplaceshandle_merge_response.submit_block.rs:MergeDataconstruction removed. ProducesTopBidForSimwhenis_top_bidis true (both optimistic and post-simulation paths).block_merger.update_base_blockcalls removed.mod.rs:Event::MergeResultreplaced byEvent::MergedPayload(Box<PayloadEntry>).process_slot_datano longer callsblock_merger.add_inclusion_list. Threeon_new_slotcall sites passil.clone().MergedBlockSubmissionconsumed separately fromFromSimMsg.main.rssim_ilshared vector created and passed to bothSimulatorTile::createandAuctioneer::new.