Finish block building process even when cancel request is found#606
Merged
Finish block building process even when cancel request is found#606
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR addresses a bug in the block building process where a cancel request prevented the process from completing by refactoring the block builder logic. Key changes include:
- Introducing a new constructor (new_with_port) and updating function signatures to pass EngineApi by value rather than by reference.
- Removing the early cancellation check in the payload builder so that block building always finishes.
- Adding a new integration test and a TestHarness utility to better simulate and validate the block building process.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| crates/op-rbuilder/src/tester/mod.rs | Added new_with_port and updated BlockGenerator to use value types; added logging and refactored submit_payload with an extra no_sleep parameter. |
| crates/op-rbuilder/src/tester/main.rs | Updated BlockGenerator instantiation to pass EngineApi by value. |
| crates/op-rbuilder/src/payload_builder_vanilla.rs | Removed the cancelled check from execute_best_transactions call. |
| crates/op-rbuilder/src/integration/mod.rs | Introduced TestHarness and port allocation helper along with related refactoring. |
| crates/op-rbuilder/src/integration/integration_test.rs | Added an integration test for the edge case with close FCU/getPayload calls. |
| crates/op-rbuilder/Cargo.toml | Added parking_lot dependency. |
Comments suppressed due to low confidence (2)
crates/op-rbuilder/src/tester/mod.rs:344
- [nitpick] Consider refactoring the submit_payload function to reduce the parameter count; bundling the delay-related parameters into a configuration struct could improve readability and maintainability.
no_sleep: bool, // TODO: Change this, too many parameters we can tweak here to put as a function arguments
crates/op-rbuilder/src/integration/integration_test.rs:363
- Consider adding a timeout mechanism for the submit_payload call in this integration test to ensure that the test does not hang indefinitely in case of an underlying issue.
// TODO: In the fail case scenario, this hangs forever, but it should return an error
Contributor
this would only happen if fcu causes a cancel before getPayload is resolved right? why would getPayload cause a cancel? |
avalonche
approved these changes
May 2, 2025
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.
📝 Summary
This PR introduces three changes:
TestHarnessstruct which spins the test framework with all the components. Note that it does not update the tests to use this new utility.💡 Motivation and Context
✅ I have completed the following steps:
make lintmake test