Skip to content

Commit

Permalink
feat: add Sunset hardfork config
Browse files Browse the repository at this point in the history
  • Loading branch information
j75689 committed Dec 8, 2023
1 parent 09b52c7 commit 5fa57b7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
3 changes: 3 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@ func SetUpgradeConfig(upgradeConfig *config.UpgradeConfig) {
upgrade.Mgr.AddUpgradeHeight(upgrade.FixDoubleSignChainId, upgradeConfig.FixDoubleSignChainIdHeight)
upgrade.Mgr.AddUpgradeHeight(upgrade.BEP126, upgradeConfig.BEP126Height)
upgrade.Mgr.AddUpgradeHeight(upgrade.BEP255, upgradeConfig.BEP255Height)
upgrade.Mgr.AddUpgradeHeight(upgrade.FirstSunset, upgradeConfig.FirstSunsetHeight)
upgrade.Mgr.AddUpgradeHeight(upgrade.SecondSunset, upgradeConfig.SecondSunsetHeight)
upgrade.Mgr.AddUpgradeHeight(upgrade.FinalSunset, upgradeConfig.FinalSunsetHeight)

// register store keys of upgrade
upgrade.Mgr.RegisterStoreKeys(upgrade.BEP9, common.TimeLockStoreKey.Name())
Expand Down
14 changes: 13 additions & 1 deletion app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ FixDoubleSignChainIdHeight = {{ .UpgradeConfig.FixDoubleSignChainIdHeight }}
BEP126Height = {{ .UpgradeConfig.BEP126Height }}
# Block height of BEP255 upgrade
BEP255Height = {{ .UpgradeConfig.BEP255Height }}
# Block height of FirstSunset upgrade
FirstSunsetHeight = {{ .UpgradeConfig.FirstSunsetHeight }}
# Block height of SecondSunset upgrade
SecondSunsetHeight = {{ .UpgradeConfig.SecondSunsetHeight }}
# Block height of FinalSunset upgrade
FinalSunsetHeight = {{ .UpgradeConfig.FinalSunsetHeight }}
[query]
# ABCI query interface black list, suggested value: ["custom/gov/proposals", "custom/timelock/timelocks", "custom/atomicSwap/swapcreator", "custom/atomicSwap/swaprecipient"]
Expand Down Expand Up @@ -552,6 +558,9 @@ type UpgradeConfig struct {
FixDoubleSignChainIdHeight int64 `mapstructure:"FixDoubleSignChainIdHeight"`
BEP126Height int64 `mapstructure:"BEP126Height"`
BEP255Height int64 `mapstructure:"BEP255Height"`
FirstSunsetHeight int64 `mapstructure:"FirstSunsetHeight"`
SecondSunsetHeight int64 `mapstructure:"SecondSunsetHeight"`
FinalSunsetHeight int64 `mapstructure:"FinalSunsetHeight"`
}

func defaultUpgradeConfig() *UpgradeConfig {
Expand Down Expand Up @@ -586,7 +595,10 @@ func defaultUpgradeConfig() *UpgradeConfig {
BEP171Height: math.MaxInt64,
FixFailAckPackageHeight: math.MaxInt64,
EnableAccountScriptsForCrossChainTransferHeight: math.MaxInt64,
BEP255Height: math.MaxInt64,
BEP255Height: math.MaxInt64,
FirstSunsetHeight: math.MaxInt64,
SecondSunsetHeight: math.MaxInt64,
FinalSunsetHeight: math.MaxInt64,
}
}

Expand Down
5 changes: 4 additions & 1 deletion common/upgrade/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ const (
BEP171 = sdk.BEP171 // https://github.com/bnb-chain/BEPs/pull/171 Security Enhancement for Cross-Chain Module
BEP173 = sdk.BEP173 // https://github.com/bnb-chain/BEPs/pull/173 Text Proposal
FixDoubleSignChainId = sdk.FixDoubleSignChainId
BEP255 = sdk.BEP255 // https://github.com/bnb-chain/BEPs/pull/255 Asset Reconciliation for Security Enhancement
BEP255 = sdk.BEP255 // https://github.com/bnb-chain/BEPs/pull/255 Asset Reconciliation for Security Enhancement
FirstSunset = sdk.FirstSunsetFork // https://github.com/bnb-chain/BEPs/pull/333 BNB Chain Fusion
SecondSunset = sdk.SecondSunsetFork // https://github.com/bnb-chain/BEPs/pull/333 BNB Chain Fusion
FinalSunset = sdk.FinalSunsetFork // https://github.com/bnb-chain/BEPs/pull/333 BNB Chain Fusion
)

func UpgradeBEP10(before func(), after func()) {
Expand Down

0 comments on commit 5fa57b7

Please sign in to comment.