diff --git a/app/upgrades.go b/app/upgrades.go index 0cd4d0df..af46db44 100755 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -23,6 +23,7 @@ import ( evmv040 "github.com/pushchain/push-chain-node/app/upgrades/evm-v0-4-0" evmv050 "github.com/pushchain/push-chain-node/app/upgrades/evm-v0-5-0" evmv060 "github.com/pushchain/push-chain-node/app/upgrades/evm-v0-6-0" + evmv062 "github.com/pushchain/push-chain-node/app/upgrades/evm-v0-6-2" feeabs "github.com/pushchain/push-chain-node/app/upgrades/fee-abs" gasoracle "github.com/pushchain/push-chain-node/app/upgrades/gas-oracle" "github.com/pushchain/push-chain-node/app/upgrades/noop" @@ -88,6 +89,7 @@ var Upgrades = []upgrades.Upgrade{ securityauditfixes.NewUpgrade(), // cosmos/evm v0.6.0 — runs the standard transfer module v5->v6 migration evmv060.NewUpgrade(), + evmv062.NewUpgrade(), // pc20 — no-op binary swap; VAULT_PC/VAULT_PC20 deployed separately from EVM side pc20.NewUpgrade(), // sdk-v0.53 — Cosmos SDK v0.50.10 -> v0.53.7; no-op (no module ConsensusVersion changes) diff --git a/app/upgrades/evm-v0-6-2/upgrade.go b/app/upgrades/evm-v0-6-2/upgrade.go new file mode 100644 index 00000000..df82fde7 --- /dev/null +++ b/app/upgrades/evm-v0-6-2/upgrade.go @@ -0,0 +1,68 @@ +package evmv062 + +import ( + "context" + "fmt" + + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/pushchain/push-chain-node/app/upgrades" +) + +const UpgradeName = "evm-v0.6.2" + +// NewUpgrade registers the cosmos/evm v0.6.0 -> v0.6.2 upgrade. +// +// Unlike the v0.6.0 upgrade, this release carries NO state migration: across +// v0.6.0..v0.6.2 upstream changed no .proto file, added or removed no store key, +// and bumped no module's ConsensusVersion. StoreUpgrades is therefore empty and +// RunMigrations is expected to be a no-op — the handler exists so the plan has a +// name for cosmovisor to switch the binary on. +// +// The behavioural changes that DO land with this binary, for the record: +// - statedb SubBalance now panics on balance underflow instead of wrapping +// silently (upstream's equivalent of F-2026-18201). +// - Module accounts may no longer have their EVM balance written +// (" is not allowed to receive funds"). Push is unaffected: every +// module-sender EVM call passes value=0, and the fee/burn and universal +// validator reward paths run through the SDK bank keeper, which never +// reaches the EVM statedb. +// - Precompile out-of-gas now propagates as vm.ErrOutOfGas. No repricing: +// succeeding transactions consume identical gas. +// - Extended-denom accounting and the erc20 IBC v2 ack changes are no-ops on +// this chain (ExtendedDenom == Denom == upc; no IBC v2 stack is wired). +func NewUpgrade() upgrades.Upgrade { + return upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateUpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{ + Added: []string{}, + Deleted: []string{}, + }, + } +} + +// CreateUpgradeHandler runs the standard module migrations. No module migration +// is expected to fire for this release; RunMigrations is called anyway so the +// stored version map stays consistent and any migration bundled by a dependency +// is still executed rather than silently skipped. +func CreateUpgradeHandler( + mm upgrades.ModuleManager, + configurator module.Configurator, + _ *upgrades.AppKeepers, +) upgradetypes.UpgradeHandler { + return func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) { + logger := sdk.UnwrapSDKContext(ctx).Logger().With("upgrade", UpgradeName) + logger.Info("starting cosmos/evm v0.6.2 upgrade: no state migration expected") + + versionMap, err := mm.RunMigrations(ctx, configurator, fromVM) + if err != nil { + return nil, fmt.Errorf("run migrations: %w", err) + } + + logger.Info("cosmos/evm v0.6.2 upgrade complete") + return versionMap, nil + } +}