Skip to content

Commit

Permalink
Fix upgrading to v11 (#1106)
Browse files Browse the repository at this point in the history
  • Loading branch information
sidenaio authored Mar 1, 2023
1 parent 8a26e72 commit 83cc980
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ func ApplyConsensusVersion(ver ConsensusVerson, cfg *ConsensusConf) {
cfg.StartActivationDate = time.Date(2022, time.December, 23, 8, 0, 0, 0, time.UTC).Unix()
cfg.EndActivationDate = time.Date(2022, time.December, 30, 0, 0, 0, 0, time.UTC).Unix()
case ConsensusV11:
cfg.Version = ConsensusV11
cfg.EnableUpgrade11 = true
cfg.KeyWordsV3Epoch = 104
cfg.StartActivationDate = time.Date(2023, time.March, 1, 8, 0, 0, 0, time.UTC).Unix()
Expand Down
2 changes: 1 addition & 1 deletion core/upgrade/upgrader.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (u *Upgrader) IsValidTargetVersion() bool {

func (u *Upgrader) ValidateBlock(block *types.Block) error {
if block.Header.ProposedHeader.Upgrade > 0 {
if block.Header.ProposedHeader.Upgrade == uint32(u.Target()) && u.CanUpgrade() {
if block.Header.ProposedHeader.Upgrade == uint32(u.Target()) && u.CanUpgrade() || block.Header.ProposedHeader.Upgrade == uint32(config.ConsensusV11) {
return nil
}
return errors.New("blockchain cannot be upgraded")
Expand Down
10 changes: 10 additions & 0 deletions docs/changelogs/v1.0.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Changelog v1.0

## 1.0.1 (Mar 1, 2023)

### Changes

- Fix upgrading to v11 ([#1106])

[#1106]: https://github.com/idena-network/idena-go/pull/1106

## 1.0.0 (Feb 17, 2023)

### Fork (Upgrade 11)
Expand Down

0 comments on commit 83cc980

Please sign in to comment.