-
Notifications
You must be signed in to change notification settings - Fork 35
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
Added new way to configure preactivation of features at any height. #1307
base: master
Are you sure you want to change the base?
Conversation
Integration tests moved to use a new way of preactivation with height.
pkg/state/state.go
Outdated
return err | ||
} | ||
activationRequest := &activatedFeaturesRecord{activationHeight: fah.Height} | ||
if err := s.stor.features.activateFeature(fah.ID, activationRequest, blockID); err != nil { |
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.
This method adds an activation
record. But it's incorrect, because newestIsActivated
will return true
even if the blockchain height is lower than activation height.
The same can be applied for the approval stage and newestIsApproved
method.
I think the good decision is to include activation hooks inside stateManager.blockchainHeightAction
.
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.
See #1308
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.
Nope, it's totally correct. The idea of preactivation is to activate some features at genesis block prior everything else. I agree that activation of feature at genesis block but at certain height looks weird, but it was made for testing purposes only and must be used only for this. "Our" way of preactivation of features in genesis block and at genesis block height is the most correct way of preactivation and this way must be used for custom blockchains. That's why I save it for backward compatibility.
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 simplified the configuration structure. Removed the unnecessary new structure and made it looks like in scala implementation.
Integration tests moved to use a new way of preactivation with height.