-
Notifications
You must be signed in to change notification settings - Fork 78
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(cli): adds load and state cli options #502
Conversation
d62332d
to
9c0e73d
Compare
|
||
// Allow some time for the state to be dumped | ||
sleep(Duration::from_secs(2)); |
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.
Suggest keeping sleep here, as sometimes the json file is not dumped in time.
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.
I think we need to add a sigterm handler to enforce dumping. I will do some experiments later
let new_provider = init_testing_provider(move |node| { | ||
node.path(get_node_binary_path()) | ||
.arg("--state-interval") | ||
.arg("1") | ||
.arg("--load-state") | ||
.arg(dump_path_clone.to_str().unwrap()) | ||
.fork("sepolia-testnet") | ||
}) | ||
.await?; |
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.
@itegulov I've noticed some flakiness with the fork tests timing out during initialization (e.g. test has been running for longer then x).
Any recommendations to harden?
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.
Yeah I had a feeling this would be an issue. I think we should not do fork tests in this form right now. To minimize flakiness we should set up a real local ZKsync enviornment and use as forking source in all of the fork e2e tests. For example we could spin up dockerized zksync-era node and then seal some blocks.
In any case I think it's for the better to delete these for now.
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.
Skipping the fork tests for now, and created issue: #508
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, just a small nit
@@ -548,6 +548,7 @@ impl ForkDetails { | |||
) | |||
})?; | |||
let l1_batch_number = block_details.l1_batch_number; | |||
block.l1_batch_number = Some(l1_batch_number.0.into()); |
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.
TBH I have feeling this might lead to some unexpected behaviour because that block might technically not be sealed in that batch yet (this is what l1BatchNumber == null
means). But anyway, the whole forking logic needs some rethinking in general so I am fine with keeping as is
…s/anvil-zksync into db/adds-load-state-cli-option
What 💻
--load-state
and--state
cmds to cli"l1BatchNumber": null,
issueWhy ✋
Evidence 📷
Include screenshots, screen recordings, or
console
output here demonstrating that your changes work as intendedRun the following command to first easily create a state.json file:
Then we can use that state to start the node using
--load-state
Forking:
Then we can use that state to start the node using
--load-state