-
Notifications
You must be signed in to change notification settings - Fork 39
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: support set hardfork from command line #1422
Conversation
07d6f62
to
c97f6b0
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.
TL;DR: IMHO, the set operation should be a one-time operation. (click to see details)
Maybe there should be a new subcommand for this feature.
Looks at the following example:
- Current tip number is 1000.
- The user uses
axon run --block-number 3000 --hardforks feature
to start the chain. - When the chain reach 2000, the machine has to be restart, so axon is stopped.
- Then, if the user want to restart Axon, he have to use
axon run --block-number 3000 --hardforks feature
to start the chain again. - After number 3000, the user only have to use
axon run
to start the chain.
So, the user have to know the current tip number of the node data (not the tip number of the chain, just the tip number of the node data) before execute axon run
.
It's not reasonable.
I have a proposal (click to see details).
-
The hardfork features can be set without start the chain.
axon hardfork set --number H --feature F
if the setting is valid, then save it into persistent caches.
When the chain is started, read them from the caches. -
We can list the hardfork features which are not reached yet.
axon hardfork list
Read data from the persistent caches.
Maybe we can list all enabled hardfork features, too, if it possible.
p.s. It could be implemented later, not right now.
-
The hardfork features can be removed before the number reached.
axon hardfork remove --number H
: remove all hardfork features atH
if exists.
axon hardfork remove --feature F
: remove hardfork featureF
if exists.p.s. It could be implemented later, not right now.
c97f6b0
to
034bbeb
Compare
Noop, the command is an one time operation with the following steps:
Once the hardfork proposal has become consensus, no additional arguments need to be added for the following re-start. |
I think it's easy for the chain maintainer to know the current tip number of the node. And I agree with @yangby-cryptape that the |
034bbeb
to
32a329c
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
32a329c
to
131563a
Compare
Can you guarantee that the hardfork proposal could become to a consensus feature at once? Once the chain is stopped, maybe an unintended stop, the users have to decide which command should be used when restart the chain.
Consider that, is any system administrator will restart services manually? If you write a service to restart axon automatically after it is stopped, you have to check the tip number of the chain data.
|
e2cfbb8
to
b56544d
Compare
Some addition points should be added:
#[derive(Serialize, Deserialize)]
pub struct HardforksStatus {
pub enabled: Vec<HardforkInfo>,
pub determined: Vec<HardforkInfo>,
pub proposing: Vec<HardforkInfo>,
} |
I prefer to pub enum HardforkStatus {
Proposed,
Enabled,
/.. other statuses ../
} |
b56544d
to
f698114
Compare
Co-authored-by: Flouse <[email protected]>
/run-ci |
CI tests run on commit:
CI test list:
Please check ci test results later. |
I had some review suggestions, but not only about this PR. also for the previous PR of hardfork. I will create an issue later to discuss them, later. |
* ci: add health-check shell script * ci: remove blank line --------- Co-authored-by: Flouse <[email protected]>
04e3d05
What this PR does / why we need it?
This PR adds features which support setting hardfork from the command line
like this:
What is the impact of this PR?
No Breaking Change
PR relation:
CI Settings
CI Usage
Tip: Check the CI you want to run below, and then comment
/run-ci
.CI Switch
CI Description
cargo clippy --all --all-targets --all-features
cargo +nightly fmt --all -- --check
andcargo sort -gwc