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
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions itests/config/genesis_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ func newBlockchainConfig(additionalArgsPath ...string) (*config, []AccountInfo,
if err != nil {
return nil, nil, err
}
cfg.PreactivatedFeatures = make([]int16, len(preactivatedFeatures))
cfg.PreactivatedFeaturesAtHeights = make([]settings.FeatureActionHeight, len(preactivatedFeatures))
for i, f := range preactivatedFeatures {
cfg.PreactivatedFeatures[i] = f.Feature
cfg.PreactivatedFeaturesAtHeights[i] = settings.FeatureActionHeight{ID: f.Feature, Height: f.Height}
}

return &config{
Expand Down
16 changes: 11 additions & 5 deletions pkg/settings/blockchain_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,19 @@ var (
res embed.FS
)

type FeatureActionHeight struct {
ID int16 `json:"id"`
Height uint64 `json:"height"`
}

type FunctionalitySettings struct {
// Features.
FeaturesVotingPeriod uint64 `json:"features_voting_period"`
VotesForFeatureActivation uint64 `json:"votes_for_feature_activation"`
PreactivatedFeatures []int16 `json:"preactivated_features"`
DoubleFeaturesPeriodsAfterHeight uint64 `json:"double_features_periods_after_height"`
SponsorshipSingleActivationPeriod bool `json:"sponsorship_single_activation_period"`
FeaturesVotingPeriod uint64 `json:"features_voting_period"`
VotesForFeatureActivation uint64 `json:"votes_for_feature_activation"`
PreactivatedFeatures []int16 `json:"preactivated_features"`
PreactivatedFeaturesAtHeights []FeatureActionHeight `json:"preactivated_features_at_heights"`
DoubleFeaturesPeriodsAfterHeight uint64 `json:"double_features_periods_after_height"`
SponsorshipSingleActivationPeriod bool `json:"sponsorship_single_activation_period"`

// Heights when some rules change.
GenerationBalanceDepthFrom50To1000AfterHeight uint64 `json:"generation_balance_depth_from_50_to_1000_after_height"`
Expand Down
Loading
Loading