-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: adapt eth_sender
tests for running both in Validium mode and Rollup mode
#120
feat: adapt eth_sender
tests for running both in Validium mode and Rollup mode
#120
Conversation
let l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator> = | ||
tester.aggregator.get_l1_batch_commit_data_generator(); |
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.
Can't we just do this? (We'd get rid of the getter method)
let l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator> = | |
tester.aggregator.get_l1_batch_commit_data_generator(); | |
let l1_batch_commit_data_generator: Arc<dyn L1BatchCommitDataGenerator> = | |
tester.aggregator.l1_batch_commit_data_generator.clone(); |
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.
In order to do that, we should expose public the aggregator field inside the EthTxAggregator
and the field l1_batch_commit_data_generator
.
The base branch should be |
eth_sender
tests for running both in Validium mode and Rollup mode
eth_sender
tests for running both in Validium mode and Rollup modeeth_sender
tests for running both in Validium mode and Rollup mode
… abstraction test
a98b7be
to
82b4def
Compare
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 PR is looking good, great work! Here I leave some comments:
- Let's add a description to the PR, given that there's an issue associated we can mention
Resolves #X
orCloses #X
. Then if some additional information is needed by the reviewer it'd be good to add it in subsequent sections (like how to run the tests you're changing). - Let's move the auxiliary functions (the abstractions) to a
test_helpers
module. If I'm not wrong, by doing so we an get rid of the prefix_
and call the methods liketest_helpers::xxx
after importing the moduletest_helpers
. - Regarding the
get_l1_batch_commit_data_generator
method: I see why you added it, but I think we can avoid needing it (in terms of design it'd be ok to have it as a method forAggregator
by maybe not forEthTxAggregator
, we'll still remove it from both though). As it is only meant for testing purposes we can make the method public for the crate or super if necessary, even better, we can make the struct fields public for the crate or super; this won't be the case either because it'd be more difficult to be accepted in the main PR.
I saw in the tests that it is only consumed bycommit_l1_batch
to instantiate anAggregatedOperation::Commit
which instantiates aCommitBatches
struct that will be the final consumer ofl1_batch_commit_data_generator
. This is great news because this means that theEthTxAggregator
'sAggregator
that is in thetester
is not the one in charge of creating anAggregatedOperation::Commit
for later committing, therefore we can passl1_batch_commit_data_generator
as a parameter to the functions along with thetester
and get rid of using the method and roll it back.
…class/zksync-era into abstract-eth_sender-test
…class/zksync-era into abstract-eth_sender-test
…class/zksync-era into abstract-eth_sender-test
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.
LGTM! Great work!
fc03061
into
feat_validium_pubdata_abstraction
Description
Closes #118
This Pull Request addresses the need to support and test a new type of SenderTester, specifically the "validium" tester, in addition to the default "rollup" tester. In a previous PR, we introduced different testers, but the default was set to "rollup" without adequate testing for the "validium" tester.
The main objective of this PR is to enhance testing coverage for the "validium" tester. The existing test structure has been adjusted to accept a SenderTest as a parameter, allowing for greater flexibility in testing various tester types. Additionally, new methods have been added to validate the tests specifically for each tester type, ensuring thorough and targeted testing for both "rollup" and "validium" testers.
Changes Made
l1_batch_commit_generator
to accommodate the unique requirements of the "validium" tester, as it is the only differing aspect between tester types.How to Test
zk test rust --package zksync_core --lib -j 1 -- eth_sender::tests