Skip to content

Commit

Permalink
refactor: use arabica-11 instead of all arabica networks
Browse files Browse the repository at this point in the history
  • Loading branch information
evan-forbes committed Oct 28, 2024
1 parent 07a1271 commit ba4ef7b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions pkg/appconsts/chain_ids.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package appconsts

const (
ArabicaChainID = "arabica-11"
)
16 changes: 9 additions & 7 deletions pkg/appconsts/versioned_consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package appconsts

import (
"strconv"
"strings"
"time"

v1 "github.com/celestiaorg/celestia-app/v3/pkg/appconsts/v1"
Expand Down Expand Up @@ -88,13 +87,16 @@ func UpgradeHeightDelay(chainID string, v uint64) int64 {
}
return parsedValue
}
switch {
case v == v1.Version:
switch v {
case v1.Version:
return v1.UpgradeHeightDelay
// ONLY ON ARABICA: don't return the v2 value even when the app version is
// v2 on arabica. This is due to a bug that was shipped on arabica, where
// the next version was used.
case v == v2.Version && !strings.Contains(chainID, "arabica"):
case v2.Version:
// ONLY ON ARABICA: don't return the v2 value even when the app version is
// v2 on arabica. This is due to a bug that was shipped on arabica, where
// the next version was used.
if chainID == ArabicaChainID {
return v3.UpgradeHeightDelay
}
return v2.UpgradeHeightDelay
default:
return v3.UpgradeHeightDelay
Expand Down
5 changes: 5 additions & 0 deletions pkg/appconsts/versioned_consts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ func TestUpgradeHeightDelay(t *testing.T) {
chainID: "celestia",
version: v2.Version,
expectedUpgradeHeightDelay: v2.UpgradeHeightDelay,
}, {
name: "v2 upgrade delay on an arabica network other than arabica-11",
chainID: "arabica-11",
version: v2.Version,
expectedUpgradeHeightDelay: v3.UpgradeHeightDelay, // falls back to v3 because of arabica bug
},
{
name: "v2 upgrade delay on arabica",
Expand Down

0 comments on commit ba4ef7b

Please sign in to comment.