Skip to content
This repository was archived by the owner on Jan 12, 2026. It is now read-only.

Cody/back port flashbots#7

Closed
cody-wang-cb wants to merge 67 commits into
releasefrom
cody/back-port-flashbots
Closed

Cody/back port flashbots#7
cody-wang-cb wants to merge 67 commits into
releasefrom
cody/back-port-flashbots

Conversation

@cody-wang-cb

Copy link
Copy Markdown

📝 Summary

💡 Motivation and Context


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

avalonche and others added 30 commits June 4, 2025 16:53
* modify logging

* more

* structure logs
* Add gas limit and DA transaction results for tracing

* use result
* Add another builder tx after the first flashblock

* Fix fb test
* Implement bundle reverting hashes

* Merge main

* Fix

* Add min_block_number

* fix litn

* Fix

* Fix comment

* Mark invalid

* Rename reverting_hashes

* Remove Option

* Revert "Remove Option"

This reverts commit 4087d35.
…GE_BLOCKS (flashbots#128)

If a user only specifies the min block number, the max block number is set to the
current block number + MAX_BLOCK_RANGE_BLOCKS; however, there is no check that
the min block is less than the newly set max block number.
* Fix bundle type reverting hashes optional param

* Fix
Rebase

Remove custom logic

Custom Engine API support + engine call propagation
* Move bundle validation to primitives folder

* Add another check

* Fix
* Make op-rbuilder a lib

* Fix lint

* Two more fixes

* Move alloc

---------

Co-authored-by: Solar Mithril <solarmithril@pm.me>
* Validation node works and tests are passing using the new test infra

* revert_protection_monitor_transaction_gc passes

* revert_protection_disabled passes

* ordering tests are passing

* all tests are passing

* ready

* lint

* Github Action login to GHCR.io

* testing Github Actions ghcr access

* testing Github Actions ghcr access

* lint

* Closes issue 133

* review feedback

* review feedback

* Review feedback - ctrl-c

* Review feedback

* review feedback

* Review feedback

* review feedback

* lint

* macos compatibility

* lint

* lint
Logic

Add extended flashblocks tracing
…bots#141)

* Add minTimestamp and maxTimestamp as optional fields to bundle

* Test that bundles with min timestamp wait aren't included until the block time exceeds it
* Remove extra generic

* Fix fmt
* quick bugfix

Account for dynamic lag in the beginning of building process

* More improvements

* More improvements

* More improvements

* More improvements

* Wrap everything into the config

* Review

* Review
…lla builder (flashbots#145)

* Applied 68 on top of latest main

* Update crates/op-rbuilder/src/tests/smoke.rs

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* lint

* port new revert unit test

* lint

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ts#163)

* Add ci workflow to build independdent docker images + nightly

* Update

* More fixes
SozinM and others added 28 commits July 7, 2025 21:18
* Reth 151

* Add debug bounds
* Add a test to validate that no-tx-pool works

* Fix lint
* introduce gauge metrics and fix naming for histogram metrics

* fix a couple of flashblocks metrics

* add fn to set payload builder metrics
* Add flashblocks index to payload building context

* refactor

* fix index
…shbots#219)

* Less confusing naming, state is called db and db is called state

* Use renaming destructuring
* add min and max flashblock number fields to bundle

* add min and max flashblock number to FBPooledTransaction

* filter based on flashblock number

* wrap best txs iterator to consider flashblock number

* fix map structure and wrap better

* integration tests
* WIP
right now it has consensus error
2025-08-01T16:10:44.956046Z ERROR engine::persistence: Persistence service failed err=ProviderError(Database(Write(DatabaseWriteError { info: DatabaseErrorInfo { message: "the given key value is mismatched to the current cursor position", code: -30418 }, operation: CursorAppendDup, table_name: "AccountChangeSets", key: [0, 0, 0, 0, 0, 0, 0, 9] })))

* Hacky solution to mergin state

* fmt

* fmt

* remove config.toml

* Update crates/op-rbuilder/src/builders/flashblocks/payload.rs

---------

Co-authored-by: shana <avalonche@protonmail.com>
* WIP
right now it has consensus error
2025-08-01T16:10:44.956046Z ERROR engine::persistence: Persistence service failed err=ProviderError(Database(Write(DatabaseWriteError { info: DatabaseErrorInfo { message: "the given key value is mismatched to the current cursor position", code: -30418 }, operation: CursorAppendDup, table_name: "AccountChangeSets", key: [0, 0, 0, 0, 0, 0, 0, 9] })))

* fmt

* cache reth db reads in flashblocks payload generation

* save tip to cache on new committed state

---------

Co-authored-by: Solar Mithril <mikawamp@gmail.com>
Co-authored-by: Ash Kunda <18058966+akundaz@users.noreply.github.com>
* record missing flashblocks in more places

* code cleanup

* edit log message
* record num txs built correctly with flashblocks enabled

* Fix metrics

---------

Co-authored-by: Solar Mithril <mikawamp@gmail.com>
* feat: add transaction gas limit

* fix: update default

* fix: update best txns

* chore: add test for max txn gas

* fix: apply suggestions

* fix: tests

* chore: update tests

* fix: failing tests
meyer9 added a commit that referenced this pull request Jan 4, 2026
This commit includes two major improvements to the Block-STM parallel execution engine:

1. **TaskGuard RAII Pattern**: Refactored `num_active_tasks` tracking to use a RAII guard pattern.
   - TaskGuard automatically increments counter on creation and decrements on drop
   - Eliminates manual increment/decrement tracking that was error-prone
   - Guards are created only when tasks are successfully acquired
   - Guards can be reused when finish_execution/finish_validation return follow-up tasks

2. **Fixed MVHashMap Livelock**: Resolved infinite retry loop in parallel execution.
   - Root cause: When converting writes to estimates during validation abort, old write
     entries weren't removed from the MVHashMap
   - This caused subsequent reads to get Estimate values instead of actual Write values
   - Transactions would infinitely retry when `add_dependency()` returned false
   - Fix: Remove old write entries before updating `last_written_locations` in
     `convert_writes_to_estimates()`

Additional changes:
- Removed debug logging added during troubleshooting
- Updated all scheduler methods to return `Option<(Task, TaskGuard)>` tuples
- Updated executor to destructure and pass guards through the task lifecycle

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.