-
Notifications
You must be signed in to change notification settings - Fork 135
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
refactor(trin-execution): state import/export don't need TrinExecution #1505
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.
Most of the PR looks good, but I don't think the subcommand's should have a param data_dir
, the param from TrinExecutionConfig should be used.
./trin --data-dir="/" import-state --data-dir="/hi"
^ this is a valid commandline in this PR
I think this is very misleading to the user.
./trin --data-dir="/" import-state
^ I think we should have this. As the data-directory for Trin-Execution shouldn't be an param of a subcommand, it should be a param of Trin-Execution itself
Also I think the first commit is a refactor not a feat as no functionality is changed other then the issue I mentioned above |
Also to note
|
You are right. I was trying:
and that didn't work. And I interpreted the error that I was getting as that none of the other cli arguments are available if subcommand is selected. If I knew this, I probably wouldn't even do this PR. But I think it's nice improvement (main is a bit cleaner) and we have a test. |
8d2f93b
to
f033731
Compare
Yeah, I guess we should add a few examples in the readme to document this. You can do this in this PR, or I can make a PR for this after this is merged, or something doesn't matter. But it would be nice to prevent confusion surrounding this in the future |
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.
everything looks good. Don't forget to
// Initialize prometheus metrics
if let Some(addr) = trin_execution_config.enable_metrics_with_url {
prometheus_exporter::start(addr)?;
}
To before the sub command code so logs work (ideally it is as high as it can go).
Other then the the PR looks good
Unless I missed it, I don't think we have documentation for import/export at all. I would leave that for another PR. |
What was wrong?
The import/export state in
trin-execution
don't need TrinExecution. They only needEvmDb
andExecutionPosition
.No tests that test import/export end to end.
How was it fixed?
Refactor how Importer/Exporter are initialized.
Also added test that:
To-Do