-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add deadline tracking to block submission #220
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
base: main
Are you sure you want to change the base?
Conversation
Adds a configurable deadline for bundle submission to Flashbots. Submissions that complete before the deadline log success at info level. Submissions that complete after the deadline log warnings to alert that the submission may be too late. New configuration: - SUBMIT_DEADLINE_BUFFER: ms before slot end by which submission must complete (default: 500ms) New metrics: - signet.builder.flashbots.deadline_met: successful submissions within deadline - signet.builder.flashbots.deadline_missed: submissions that missed the deadline Closes ENG-1640
src/tasks/submit/flashbots.rs
Outdated
| // Check if we met the submission deadline | ||
| let met_deadline = Instant::now() <= deadline; | ||
|
|
||
| match response { |
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.
unnest all this code. avoid if blocks in match arms
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.
Done - refactored to tuple matching (response, met_deadline) with 4 flat arms. No more nested ifs in match arms.
Address PR review feedback: use tuple matching on (response, met_deadline) instead of nested if/else blocks inside match arms. This flattens the code structure while preserving all functionality.
|
Addressed the review feedback - refactored to use tuple matching Commit: 14a63ac |
Adds the missing submit_deadline_buffer field to the test BuilderConfig in test_utils.rs, using the same default value (500ms) as defined in the main config.
|
Fixed the CI failure - added the missing Summary of changes in this PR:
Ready for re-review once CI passes. |
Summary
Adds a configurable deadline for bundle submission to Flashbots. Submissions that complete before the deadline log success at info level. Submissions that complete after the deadline log warnings to alert that the submission may be too late.
Related Issues
Closes ENG-1640
Type of Change
Changes
SUBMIT_DEADLINE_BUFFER(default 500ms) - the number of milliseconds before slot end by which submission must completecalculate_submit_deadline()method to FlashbotsTask that computes the deadline similar to how the simulation task doessignet.builder.flashbots.deadline_metandsignet.builder.flashbots.deadline_missedTesting
Checklist
cargo clippy(pending CI)cargo test) (pending CI)