-
Notifications
You must be signed in to change notification settings - Fork 130
fix(l1): wait before retring on error in dev's block producer #5391
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Lines of code reportTotal lines added: Detailed view |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a race condition where the dev block producer starts before the Engine RPC server is ready, causing immediate failures when the producer attempts to make RPC calls.
Key Changes:
- Added a 300ms delay between retry attempts to allow the Engine RPC server time to initialize
- Sleep delays are consistently applied across all four error paths in the block production loop
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tracing::error!( | ||
| "Failed to produce block: error sending engine_forkchoiceUpdatedV3 with PayloadAttributes: {error}" | ||
| ); | ||
| sleep(Duration::from_millis(300)).await; |
Copilot
AI
Nov 19, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The retry delay duration (300ms) is hardcoded as a magic number in multiple places. Consider extracting this to a named constant at the module or function level for better maintainability. For example:
const RETRY_DELAY_MS: u64 = 300;Then use sleep(Duration::from_millis(RETRY_DELAY_MS)).await; throughout the function. This makes it easier to adjust the delay and ensures consistency across all retry points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Motivation
There was a race condition where dev's block producer starts before the RPC. In this scenario, the block producer tries to make some requests to the Engine API, failing three times in a row and thus ending.
Description
Add a small delay between retries so Engine RPC has time to get up