Passage v3.1.0 — Cosmos SDK 0.47→0.50 upgrade (REVIEW CANDIDATE) - #208
Merged
Conversation
….0/v3.0.0) to SDK 0.50 - v3.0.0: keep upstream name=v3.0.0, port consensus-params migration to 0.50 (collections.Item ParamStore, context.Context closure) - v2.4.0/v2.6.0: bank/auth/distr handlers to 0.50 (math.NewInt, context ctx) - v2.5.0: claim+min-commission+multisig migration to 0.50; authz/feegrant/gov-vote steps omitted (keepers no longer threaded / gov API changed) - TODO-marked - restore app/ante min_commission + min_gas_prices to 0.50 (math.Legacy*) - wire historical handlers into app.go Upgrades slice; drop v047
| EndBlocker(ctx, am.keeper) | ||
| return []abci.ValidatorUpdate{} | ||
| func (am AppModule) EndBlock(ctx context.Context) error { | ||
| EndBlocker(sdk.UnwrapSDKContext(ctx), am.keeper) |
Comment on lines
+58
to
+60
| for k, v := range defaultGraphNodeAttrs { | ||
| graphNode.Attrs[k] = v | ||
| } |
Comment on lines
+671
to
+676
| for v, r := range ndb.versionReaders { | ||
| if v >= first && v <= toVersion && r != 0 { | ||
| ndb.mtx.Unlock() | ||
| return fmt.Errorf("unable to delete version %d with %d active readers", v, r) | ||
| } | ||
| } |
Comment on lines
+551
to
+556
| for v, r := range ndb.versionReaders { | ||
| if v >= fromVersion && r != 0 { | ||
| ndb.mtx.Unlock() // Unlock before exiting | ||
| return fmt.Errorf("unable to delete version %v with %v active readers", v, r) | ||
| } | ||
| } |
| case []byte: | ||
| return v | ||
| default: | ||
| panic(fmt.Errorf("keyFormat format() does not support formatting value of type %T: %v", a, a)) |
| import ( | ||
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" | ||
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" | ||
| reflect "reflect" |
| package common | ||
|
|
||
| import ( | ||
| "unsafe" |
|
|
||
| import ( | ||
| "fmt" | ||
| "runtime" |
Comment on lines
+95
to
+98
| go func(batch db.Batch) { | ||
| defer batch.Close() | ||
| result <- batch.Write() | ||
| }(i.batch) |
| } | ||
|
|
||
| tree.ndb.incrVersionReaders(tree.version) | ||
| go exporter.export(ctx) |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Passage v3.1.0 — Cosmos SDK 0.47 → 0.50 upgrade (REVIEW CANDIDATE)
Prepared by CryptoDungeon (Ninjaxan). This branches from
release/v2.6.0-sdk-v047(v3.0.0) and applies the SDK 0.47→0.50 migration plus ports this repo's historical upgrade handlers forward to 0.50. Please read "Historical handlers" and "Status" before scheduling any on-chain proposal — this is a candidate for review and joint testing, not a finished release.On-chain upgrade name:
v050.What it does
./iavl-fork)iavl v1 (SDK 0.50) cannot load a 0.47 (iavl-0.20) database when any store is empty (e.g. x/evidence/x/feegrant with no entries):
db.Get/db.Hastreat a zero-length value as absent, and an empty tree's root marker has an empty value, so iavl reports those versions missing and the node aborts at startup — every validator's v0.50 binary would fail to start at the upgrade height = chain halt. Fix: value-agnostic key-existence check for the legacyr<version>and natives<version>roots (iavl-fork/nodedb.go; seedocs/v3.1.0-upgrade/iavl-empty-store-fix.patch). Please review this and we intend to upstream it to cosmos/iavl.Parameters set by the
v050handlerHistorical handlers — NEEDS YOUR VALIDATION
v2.4.0 / v2.5.0 / v2.6.0 / v3.0.0 were ported to compile + run under 0.50, preserving logic (the v3.0.0 consensus-params migration is intact). 3 genesis-replay-only gaps in
app/upgrades/v2.5.0/replace_multisig_addrs.go(markedTODO(passage v3.1.0)): for the replaced multisig addresses, the authz-grant, feegrant-allowance, and gov-vote sub-migrations are omitted (the 0.50 unified handler signature doesn't thread authz/feegrant keepers, and 0.50 x/gov dropped the in-place vote-rewrite API). Account/balance/delegation/vesting migration is intact. No impact on state-sync nodes; only a from-genesis replay is affected, and only if those addresses held authz/feegrant/votes at the v2.5.0 height — you can confirm that quickly. We left them flagged rather than guess.Status (do NOT propose until green)
Build: go 1.21,
make build,passage version --long→cosmos_sdk_version: v0.50.13. Full rationale + dry-run harness indocs/v3.1.0-upgrade/.