refactor(builder): flashblock candidate build#560
Open
julio4 wants to merge 1 commit into
Open
Conversation
Share the per-flashblock build sequence between naive and continuous paths. This stacks on refactor/flashblock-publish-bus.
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors flashblock candidate building by extracting shared logic into a single “candidate build” primitive, reducing duplicated code between the naive (non-continuous) and continuous builders while keeping their differing cancellation semantics and timing/metrics needs.
Changes:
- Introduces
builder::candidatemodule withprepare_candidate_budget+build_candidate, including structured outcomes and timing breakdowns. - Updates naive flashblock building to use the candidate primitive and records pool-fetch/execution timings via
CandidateTimings. - Updates continuous candidate loop to use the same primitive for both empty and pool-backed candidates, simplifying the loop and standardizing outcome handling.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| crates/op-rbuilder/src/builder/payload.rs | Switches naive flashblock build path to prepare_candidate_budget/build_candidate and wires timing-derived metrics recording. |
| crates/op-rbuilder/src/builder/mod.rs | Adds the new candidate module. |
| crates/op-rbuilder/src/builder/continuous/candidate_loop.rs | Replaces inlined candidate build logic with calls to the shared candidate primitive and adapts best-candidate handling. |
| crates/op-rbuilder/src/builder/candidate.rs | Adds the shared candidate-building implementation, outcome types, timing capture, interrupt policy handling, and unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Extract normal/continuous inner build in ONE primitive with:
This kills duplication found in #534/#535/#546