-
Notifications
You must be signed in to change notification settings - Fork 29
In-process tests, optional dockerized validation node #132
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
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 refactors the in-test infrastructure to use a new in-process LocalInstance
and ChainDriver
, replaces the previous TestHarness
and related service modules, extends the test framework with utilities and transaction-pool observers, and updates dependencies and CI settings for test support.
- Introduce
LocalInstance
andChainDriver
APIs and remove the oldTestHarness
/service modules - Update all vanilla and flashblocks tests to use the new driver-based interface
- Add
framework/utils.rs
, transaction-pool observation, test logging init, and new Cargo features for testing
Reviewed Changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
crates/op-rbuilder/src/tests/vanilla/ordering.rs | Switched from TestHarnessBuilder to LocalInstance & ChainDriver |
crates/op-rbuilder/src/tests/vanilla/data_availability.rs | Updated size-limit tests to use new driver API |
crates/op-rbuilder/src/tests/framework/utils.rs | Added testing helper traits (ChainDriverExt , BlockTransactionsExt , etc.) |
crates/op-rbuilder/src/tests/framework/instance.rs | Added LocalInstance implementation |
crates/op-rbuilder/Cargo.toml | Added testing dependencies & features (duplicate entries) |
.github/workflows/checks.yaml | Inject TESTS_TEMP_DIR env var for tests |
Comments suppressed due to low confidence (6)
crates/op-rbuilder/Cargo.toml:119
- There are duplicate
dashmap
entries in thisCargo.toml
(once as optional, once unqualified). Remove or consolidate one declaration to avoid cargo manifest parsing errors.
dashmap = { version = "6.1", optional = true }
crates/op-rbuilder/Cargo.toml:120
- Duplicate
nanoid
declaration—listed both as optional and non-optional further down. Consolidate these entries to avoid conflicts.
nanoid = { version = "0.4", optional = true }
crates/op-rbuilder/Cargo.toml:121
- You have two
reth-ipc
definitions (optional and non-optional). Remove the redundant entry to prevent cargo errors.
reth-ipc = { workspace = true, optional = true }
crates/op-rbuilder/Cargo.toml:122
- Duplicate
bollard
entries exist. Consolidate to a single declaration to keep the manifest valid.
bollard = { version = "0.19", optional = true }
crates/op-rbuilder/Cargo.toml:123
- [nitpick] The
tar
crate is only declared once, but please verify if it should also be gated under thetesting
feature rather than listed unconditionally.
tar = { version = "0.4", optional = true }
.github/workflows/checks.yaml:76
- The
TESTS_TEMP_DIR
environment variable is set here but not referenced in the test code. Either remove it or update the test framework to honor this variable.
TESTS_TEMP_DIR: ${{ github.workspace }}
Will follow up with another PR after this goes through for #133 |
📝 Summary
This PR closes the following issues:
ExternalNode
#133Few things happened here:
RBuilder running in-process
Now we have a new type called
LocalInstance
that runs an entire RBuilder instance in-process. It uses IPC transport instead of HTTP for RPC and EngineAPI. ThisLocalInstance
representsop-rbuilder
node and can be configured by giving it an optionalNodeConfig
orRBuilderArgs
structures. Examples:Built-in validation node management
An external
op-reth
node can be attached to any test using the following snippet:When an external node is attached to a chain driver, it will automatically sync with the
LocalInstance
that is running and then ingest every newly built block. Only if the external node validates and accepts a block as its canonical chain the block building process is considered successful.We support attaching multiple validation node to one local instance:
Better
OpRbuilderArgs
defaultsThe
Default
implementation of the cli arguments type and all its descendants will use the defaults specified by clap attributes instead of rust default values.Chain Driver
When interacting with a
LocalInstance
we have nowChainDriver
that is used to trigger production of new blocks, get latest blocks, etc. It can be either instantiated byChainDriver::new(&local_instance)
orlocal_instance.driver()
.Better transaction pool events inspector
In
LocalInstance
all transaction pool events are recorded in a strongly typed manner insideTransactionPoolObserver
. We record their entire state history, so we can later validate the correct order of transitions. The public API for this is:Transactions have states that are instance of
TransactionEvent
from thetransaction-pool
crate in reth. Namely:Test tracing
You can now see detailed logs of your unit tests by setting the
TEST_TRACE
env variable. That will print out all reth and op-rbuilder logs to console when they're running. Usage:✅ I have completed the following steps:
make lint
make test