feat(builder): coordinate bounded payload build jobs - #9973
Draft
krisoshea-eth wants to merge 29 commits into
Draft
feat(builder): coordinate bounded payload build jobs#9973krisoshea-eth wants to merge 29 commits into
krisoshea-eth wants to merge 29 commits into
Conversation
…e-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…e-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…e-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…he-payloadsource-contract-and-engine
…01-add-the-payloadsource-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…he-payloadsource-contract-and-engine
…01-add-the-payloadsource-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…he-payloadsource-contract-and-engine
…01-add-the-payloadsource-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
…he-payloadsource-contract-and-engine
…e-contract-and-engine' into krisoshea/lod-58-payload-orch-01-spike
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.
Motivation
The Builder needs a small boundary for coordinating payload preparation and retrieval before event, CLI, storage, and bid wiring are added.
This PR is stacked on #9958. Until that dependency merges, the upstream diff contains both the payload-source and orchestration changes. The isolated two-file orchestration comparison is krisoshea-eth/lodestar#61.
Description
Add a package-internal
PayloadOrchestratorthat accepts an injectedPayloadSourceand a caller-defined retrieval time. It shares truly identical jobs, rejects reuse of one job ID with different request content, bounds distinct active jobs, cancels preparation or retrieval on timeout and shutdown, suppresses late results, and cleans up every terminal path.Orchestration failures use structured error codes. Source and transport errors retain their original types. Invalid limits and invalid retrieval timestamps are rejected before any source request starts. Request retries and transport timeouts remain owned by the concrete payload source.
This draft does not add Builder or CLI wiring, choose a shared or dedicated EL, produce payload attributes, store payloads, construct bids, publish bids, or implement selection and reveal.
Testing
Validated with Node 24.13.0:
PayloadOrchestratortestsgit diff --checkThe tests verify request cancellation, phase timeouts, duplicate sharing, and structured rejection when one job ID is reused with different retrieval time, forkchoice state, payload attributes, or custody columns.
Evidence
72d3245398The temporary integration branch proves that the source, orchestrator, and store seams compose. At
6c1aff6c66, the current source, orchestration, store, policy, preferences, bid, selection, and reveal components compose cleanly. All 152 Builder unit tests pass, together with type-check, Biome, build/import, and diff checks. This is deterministic integration evidence, not a live Engine or source-BN end-to-end run.AI assistance
AI assistance was used during codebase research, implementation, drafting, testing, and review. The submitted code and PR text were reviewed and revised by the author, including manual edits and technical decisions.