Skip to content
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

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alexeykiselev
Copy link
Member

Integration tests moved to use a new way of preactivation with height.

Integration tests moved to use a new way of preactivation with height.
@alexeykiselev alexeykiselev requested review from nickeskov and irina-pereiaslavskaia and removed request for nickeskov January 29, 2024 14:50
@alexeykiselev alexeykiselev added the enhancement New feature or request label Jan 29, 2024
return err
}
activationRequest := &activatedFeaturesRecord{activationHeight: fah.Height}
if err := s.stor.features.activateFeature(fah.ID, activationRequest, blockID); err != nil {
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #1308

Copy link
Member Author

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.

Copy link
Member Author

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.

@nickeskov nickeskov marked this pull request as draft February 13, 2024 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants