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

chore: prepare v4.0.0-rc0 #255

Merged
merged 6 commits into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
12 changes: 12 additions & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ import (
"github.com/strangelove-ventures/noble/app/upgrades/neon"
"github.com/strangelove-ventures/noble/app/upgrades/radon"
v3m1p0 "github.com/strangelove-ventures/noble/app/upgrades/v3.1.0"
v4m0p0rc0 "github.com/strangelove-ventures/noble/app/upgrades/v4.0.0-rc0"
"github.com/strangelove-ventures/noble/cmd"
"github.com/strangelove-ventures/noble/docs"
"github.com/strangelove-ventures/noble/x/blockibc"
Expand Down Expand Up @@ -906,6 +907,15 @@ func (app *App) setupUpgradeHandlers() {
),
)

// v4.0.0-rc0 upgrade
app.UpgradeKeeper.SetUpgradeHandler(
v4m0p0rc0.UpgradeName,
v4m0p0rc0.CreateUpgradeHandler(
app.mm,
app.configurator,
),
)

upgradeInfo, err := app.UpgradeKeeper.ReadUpgradeInfoFromDisk()
if err != nil {
panic(fmt.Errorf("failed to read upgrade info from disk: %w", err))
Expand All @@ -927,6 +937,8 @@ func (app *App) setupUpgradeHandlers() {
storeLoader = argon.CreateStoreLoader(upgradeInfo.Height)
case argon4.UpgradeName:
storeLoader = argon4.CreateStoreLoader(upgradeInfo.Height)
case v4m0p0rc0.UpgradeName:
storeLoader = v4m0p0rc0.CreateStoreLoader(upgradeInfo.Height)
}

if storeLoader != nil {
Expand Down
6 changes: 2 additions & 4 deletions app/upgrades/argon/store.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
package argon

import (
cctptypes "github.com/circlefin/noble-cctp/x/cctp/types"
cctpTypes "github.com/circlefin/noble-cctp/x/cctp/types"
johnletey marked this conversation as resolved.
Show resolved Hide resolved
"github.com/cosmos/cosmos-sdk/baseapp"
storeTypes "github.com/cosmos/cosmos-sdk/store/types"
upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader {
storeUpgrades := storeTypes.StoreUpgrades{
Added: []string{
cctptypes.ModuleName,
},
Added: []string{cctpTypes.ModuleName},
}

return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades)
Expand Down
7 changes: 7 additions & 0 deletions app/upgrades/v4.0.0-rc0/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package v4m0p0rc0

// UpgradeName is the name of this specific software upgrade used on-chain.
const UpgradeName = "v4.0.0-rc0"

// TestnetChainID is the Chain ID of the Noble testnet (Grand).
const TestnetChainID = "grand-1"
15 changes: 15 additions & 0 deletions app/upgrades/v4.0.0-rc0/store.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package v4m0p0rc0

import (
"github.com/cosmos/cosmos-sdk/baseapp"
storeTypes "github.com/cosmos/cosmos-sdk/store/types"
upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateStoreLoader(upgradeHeight int64) baseapp.StoreLoader {
storeUpgrades := storeTypes.StoreUpgrades{
Deleted: []string{"router"},
}

return upgradeTypes.UpgradeStoreLoader(upgradeHeight, &storeUpgrades)
}
24 changes: 24 additions & 0 deletions app/upgrades/v4.0.0-rc0/upgrade.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package v4m0p0rc0

import (
"errors"
"fmt"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
upgradeTypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
)

func CreateUpgradeHandler(
mm *module.Manager,
cfg module.Configurator,
) upgradeTypes.UpgradeHandler {
return func(ctx sdk.Context, _ upgradeTypes.Plan, vm module.VersionMap) (module.VersionMap, error) {
// Ensure that this upgrade is only run on Noble's testnet.
if ctx.ChainID() != TestnetChainID {
return vm, errors.New(fmt.Sprintf("%s upgrade not allowed to execute on %s chain", UpgradeName, ctx.ChainID()))
}

return mm.RunMigrations(ctx, cfg, vm)
}
}
2 changes: 1 addition & 1 deletion interchaintest/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/ethereum/go-ethereum v1.12.2
github.com/gogo/protobuf v1.3.3
github.com/icza/dyno v0.0.0-20220812133438-f0b6f8a18845
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231020192006-848acaeab959
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68
github.com/strangelove-ventures/noble v1.0.1-0.20230717234609-400609f26a31
github.com/strangelove-ventures/paramauthority v1.1.0
github.com/stretchr/testify v1.8.4
Expand Down
2 changes: 2 additions & 0 deletions interchaintest/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1003,6 +1003,8 @@ github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jH
github.com/status-im/keycard-go v0.0.0-20190316090335-8537d3370df4/go.mod h1:RZLeN1LMWmRsyYjvAu+I6Dm9QmlDaIIt+Y+4Kd7Tp+Q=
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231020192006-848acaeab959 h1:GuprrfXjcoHpwM7avAL5AmxzDc/4/t1lPtSOKtKdAOk=
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231020192006-848acaeab959/go.mod h1:j7cgQsflU8OWa0GNM0ZtNANlT20oQeYw2PS/gfZrN3Y=
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68 h1:f16Xo7gvZ/g3YyXsmUQBwvUcq0orQeBrIcdsyVrMrjU=
github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68/go.mod h1:oEYorKX6XBoQOrkVv9uhq4X0azZbEf5Jq6h3GN8jJ2w=
github.com/strangelove-ventures/paramauthority v1.1.0 h1:SMeG2NvoWC1sP09ouszukck7ufSu+3gv98Apd+ytQHQ=
github.com/strangelove-ventures/paramauthority v1.1.0/go.mod h1:WZltb3MpbQo40z4eQD6oNZRpCXtxr5/7j8lbMleDFIY=
github.com/streadway/amqp v0.0.0-20190404075320-75d898a42a94/go.mod h1:AZpEONHx3DKn8O/DFsRAY58/XVQiIPMTMB1SddzLXVw=
Expand Down
2 changes: 1 addition & 1 deletion interchaintest/upgrade_argon_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/stretchr/testify/require"
)

func testPostArgonUpgradeTestnet(
func testPostArgonUpgrade(
t *testing.T,
ctx context.Context,
noble *cosmos.CosmosChain,
Expand Down
6 changes: 5 additions & 1 deletion interchaintest/upgrade_grand-1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,12 @@ func TestGrand1ChainUpgrade(t *testing.T) {
{
// This upgrade is only relevant to the grand-1 testnet
upgradeName: "v4.0.0-beta2",
image: ghcrImage("v4.0.0-beta2"),
},
{
upgradeName: "v4.0.0-rc0",
image: nobleImageInfo[0],
postUpgrade: testPostArgonUpgradeTestnet,
postUpgrade: testPostArgonUpgrade,
},
}

Expand Down
4 changes: 2 additions & 2 deletions interchaintest/upgrade_noble-1_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ func TestNoble1ChainUpgrade(t *testing.T) {
{
upgradeName: "radon",
image: ghcrImage("v3.0.0"),
postUpgrade: testPostRadonUpgrade,
},
{
upgradeName: "v3.1.0",
image: ghcrImage("v3.1.0"),
postUpgrade: testPostRadonUpgrade,
},
{
upgradeName: "argon",
image: nobleImageInfo[0],
// postUpgrade: testPostArgonUpgradeMainnet,
postUpgrade: testPostArgonUpgrade,
Copy link
Member

@boojamya boojamya Nov 1, 2023

Choose a reason for hiding this comment

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

Unfortunately, we are going to have to remove the post-upgrade part from the mainnet upgrade test if we want this to pass.

This is because of the way we created the fiat-tokenfactory where you must have an owner in state. IE, we hard coded the owner role in the neon upgrade handler.

The reason this works in the testnet upgrade test is because we altered the fiat-tokenfactory owner in this image of noble:
https://github.com/strangelove-ventures/noble/blob/72e36f89a65376d40a339cb9cf8b99fc461628cf/interchaintest/upgrade_grand-1_test.go#L25

The owner in the image above, matches the owner here:
https://github.com/strangelove-ventures/noble/blob/72e36f89a65376d40a339cb9cf8b99fc461628cf/interchaintest/upgrade_argon_test.go#L38

},
}

Expand Down
Loading