Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

- (proto) [#67](https://github.com/mocachain/moca/pull/67) Publish protos to BSR under moca org
- (cli) [#243](https://github.com/mocachain/moca/pull/243) Add `mocad snapshots` command tree (list/delete/dump/export/load/restore) for managing local state-sync snapshots
- (upgrade) [#247](https://github.com/mocachain/moca/pull/247) Add `v1.3.0` upgrade handler (noop `RunMigrations`)
- (upgrade) [#266](https://github.com/mocachain/moca/pull/266) Add `v1.3.0` upgrade handler (noop `RunMigrations`) and bump `moca-iavl` to `v1.2.0-rc3`. The moca-iavl commit-time bug (`SaveVersion` early-return) can leave stale **fastnode phantoms** — live-state index entries for grants already removed from the IAVL tree. The validator→gov `StakeAuthorization` and SP funding→gov `DepositAuthorization` grants that can appear "missing" are **consumed and auto-deleted by normal authz flow** at validator/SP creation (`CheckStakeAuthorization`/`CheckDepositAuthorization` call `Accept` then `DeleteGrant` once the scoped limit is exhausted) — they are not dropped by the bug, so nothing needs restoring. `moca-iavl v1.2.0-rc3` bumps `fastStorageVersionValue` to `1.1.1`, which forces a one-time fastnode rebuild from the canonical tree on every node at the `v1.3.0` restart, clearing any residual phantoms automatically and in-binary (node-local, non-consensus, no state-sync or operator action). The `prove=true` panic remains fixed by `cosmos/iavl#1009`

### Improvements

Expand Down
15 changes: 14 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -1559,8 +1559,21 @@ func (app *Evmos) setupUpgradeHandlers() {
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

// v1.3.0: no state-machine changes. The moca-iavl commit-time bug left authz
// fastnode-vs-tree drift, but the only authz grants moca's handlers read are
// create-time gates — validator self-del -> gov (MsgDelegate) in
// MsgCreateValidator, and SP funding -> gov (MsgDeposit) in
// MsgCreateStorageProvider. Nothing consumes them after creation (delegate,
// withdraw, unjail, redelegate, edit, deposit top-ups, slashing all skip the
// check), and a new creator re-grants right before creating, so the dropped
// grants need no restoration. Restoring them is also consensus-unsafe from a
// handler (a purge/regrant keyed off the store iterator, which reads the
// fastnode not the tree, forks on a node whose fastnode is missing a
// tree-backed key). The v1.3.0 binary carries cosmos/iavl#1009 (stops the
// prove=true panic on the phantom keys); the residual fastnode drift is
// cleared by an IAVL rebuild (state-sync / fastStorageVersionValue bump),
// not from this handler.
app.UpgradeKeeper.SetUpgradeHandler("v1.3.0", func(ctx context.Context, _ upgradetypes.Plan, fromVM module.VersionMap) (module.VersionMap, error) {
// noop
return app.mm.RunMigrations(ctx, app.configurator, fromVM)
})

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ replace (
github.com/cometbft/cometbft-db => github.com/Mocachain/moca-cometbft-db v1.1.1-0.20260316053933-22256c4c85b3
// use Cosmos-SDK fork to enable Ledger functionality
github.com/cosmos/cosmos-sdk => github.com/mocachain/moca-cosmos-sdk v1.2.0-rc2
github.com/cosmos/iavl => github.com/Mocachain/moca-iavl v1.2.0-rc1
github.com/cosmos/iavl => github.com/Mocachain/moca-iavl v1.2.0-rc3
github.com/cosmos/ibc-go/v10 => github.com/Mocachain/moca-ibc-go/v10 v10.2.0-rc0
// use Evmos geth fork
github.com/ethereum/go-ethereum => github.com/Mocachain/go-ethereum v1.10.27-moca.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ github.com/Mocachain/moca-cometbft-db v1.1.1-0.20260316053933-22256c4c85b3 h1:4M
github.com/Mocachain/moca-cometbft-db v1.1.1-0.20260316053933-22256c4c85b3/go.mod h1:GDPJAC/iFHNjmZZPN8V8C1yr/eyityhi2W1hz2MGKSc=
github.com/Mocachain/moca-iavl v1.2.0-rc1 h1:/qxdm6TW9VirQwkPv/4IiJK2Wpw4FdgFUwuGjYcKNPk=
github.com/Mocachain/moca-iavl v1.2.0-rc1/go.mod h1:llfcEJML+85FDrd1XlU6YRa7tFnyPYK/T04iOSXe+1I=
github.com/Mocachain/moca-iavl v1.2.0-rc3 h1:PcIVWg55yrOsLT0aSh1J/2tP7vs0tGdj7EWCPT6LXKE=
github.com/Mocachain/moca-iavl v1.2.0-rc3/go.mod h1:llfcEJML+85FDrd1XlU6YRa7tFnyPYK/T04iOSXe+1I=
github.com/Mocachain/moca-ibc-go/v10 v10.2.0-rc0 h1:PrEeIUqb20WzjQN7qg/CJat0QO5iL6E1RJPTUe2na2A=
github.com/Mocachain/moca-ibc-go/v10 v10.2.0-rc0/go.mod h1:aSY93nbW1E8OwEf2eDri3xSM7vWJskxrm37Mfs66cWM=
github.com/Mocachain/polygon-edge v1.3.3-moca.1 h1:g/l0I01/xBI6UPy/17PuOLWrOghYxXHLRr34nlHsUv4=
Expand Down
Loading