-
Notifications
You must be signed in to change notification settings - Fork 1
tests: adds a test for host and rollup transaction simulation #190
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
Draft
dylanlott
wants to merge
6
commits into
dylan/fix-deadline-cutoff
Choose a base branch
from
dylan/bundle-integration-tests
base: dylan/fix-deadline-cutoff
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0770057
wip: working on getting bundle integration tests working
dylanlott d275429
wip: integration test with pecorino is failing as expected
dylanlott 60a8df7
refactor: pass in providers at construction time
dylanlott d15f314
refactors: helper functions
dylanlott b7af0e3
fmt + clippy
dylanlott 4b44526
cleanup
dylanlott File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ use signet_constants::SignetSystemConstants; | |
| use signet_sim::{HostEnv, RollupEnv}; | ||
| use tokio::{sync::watch, task::JoinHandle}; | ||
| use tokio_stream::StreamExt; | ||
| use tracing::{Instrument, Span, info_span}; | ||
| use tracing::{Instrument, Span, info_span, instrument}; | ||
| use trevm::revm::{ | ||
| context::BlockEnv, | ||
| context_interface::block::BlobExcessGasAndPrice, | ||
|
|
@@ -202,20 +202,18 @@ pub struct EnvTask { | |
|
|
||
| impl EnvTask { | ||
| /// Create a new [`EnvTask`] with the given config and providers. | ||
| pub async fn new() -> eyre::Result<Self> { | ||
| pub async fn new( | ||
| host_provider: HostProvider, | ||
| ru_provider: RuProvider, | ||
| quincey: Quincey, | ||
| ) -> eyre::Result<Self> { | ||
| let config = crate::config(); | ||
|
|
||
| let (host_provider, quincey, ru_provider) = tokio::try_join!( | ||
| config.connect_host_provider(), | ||
| config.connect_quincey(), | ||
| config.connect_ru_provider(), | ||
| )?; | ||
|
|
||
| Ok(Self { config, host_provider, quincey, ru_provider }) | ||
| } | ||
|
|
||
| /// Construct a [`BlockEnv`] for the next host block from the previous host header. | ||
| fn construct_host_env(&self, previous: Header) -> Environment { | ||
| #[instrument(skip(self, previous), fields(previous_number = %previous.number))] | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Made public for testing purposes. |
||
| pub fn construct_host_env(&self, previous: Header) -> Environment { | ||
| let env = BlockEnv { | ||
| number: U256::from(previous.number + 1), | ||
| beneficiary: self.config.builder_rewards_address, | ||
|
|
@@ -236,7 +234,8 @@ impl EnvTask { | |
| } | ||
|
|
||
| /// Construct a [`BlockEnv`] for the next rollup block from the previous block header. | ||
| fn construct_rollup_env(&self, previous: Header) -> Environment { | ||
| #[instrument(skip(self, previous), fields(previous_number = %previous.number))] | ||
| pub fn construct_rollup_env(&self, previous: Header) -> Environment { | ||
| let env = BlockEnv { | ||
| number: U256::from(previous.number + 1), | ||
| beneficiary: self.config.builder_rewards_address, | ||
|
|
||
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
Oops, something went wrong.
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.
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.
NB: These are passed in at construction time for test purposes, but to improve here, we could make our tasks generic over Host and Rollup providers and make this a little bit more idiomatic.