|
| 1 | +package v6_1_7 |
| 2 | + |
| 3 | +import ( |
| 4 | + "context" |
| 5 | + "fmt" |
| 6 | + |
| 7 | + upgradetypes "cosmossdk.io/x/upgrade/types" |
| 8 | + |
| 9 | + sdk "github.com/cosmos/cosmos-sdk/types" |
| 10 | + "github.com/cosmos/cosmos-sdk/types/module" |
| 11 | +) |
| 12 | + |
| 13 | +/* |
| 14 | +Upgrade to v6.1.7 includes (since v6.1.6): |
| 15 | + - Dispute vote validation and accounting (#1061): reject invalid vote choices; |
| 16 | + counted selector stake moves stored ReporterPower on revote (no re-snapshot, |
| 17 | + re-peel, or re-reserve); lock only blocks first acquisition of reporter stake; |
| 18 | + peels target evidence-reporter ownership after a switch when needed; fail-closed |
| 19 | + bucket underflow/overflow; same safeguards applied to team votes. |
| 20 | + - MsgBatchSubmitValue correctness (#1064): align with MsgSubmitValue power caching, |
| 21 | + call ReporterStake on the first verified valid report, and return an error when |
| 22 | + all reports in the batch fail. |
| 23 | + - Reporter self-demotion hardening (#1065): safer demotion lifecycle (reporter not |
| 24 | + deleted immediately), block pending switches onto a demoting reporter, and handle |
| 25 | + rewards/liveness after demotion when the reporter object is gone. |
| 26 | + - Bridge module authority wiring (#1058): inject authority correctly into |
| 27 | + ProvideModule via the module config proto. |
| 28 | + - Bridge vote-extension signing (#1046 / #1063): sign via validated |
| 29 | + checkpoint/attestation RPCs (VoteExtensionSigner), not SignRaw; follow-up signer |
| 30 | + API and registration-sig updates. |
| 31 | +
|
| 32 | +No custom state migration is required beyond RunMigrations: dispute vote store |
| 33 | +layout and protos are unchanged. In-flight disputes keep existing tallies; |
| 34 | +subsequent votes use the corrected accounting. |
| 35 | +*/ |
| 36 | + |
| 37 | +func CreateUpgradeHandler( |
| 38 | + mm *module.Manager, |
| 39 | + configurator module.Configurator, |
| 40 | +) upgradetypes.UpgradeHandler { |
| 41 | + return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { |
| 42 | + sdkCtx := sdk.UnwrapSDKContext(ctx) |
| 43 | + sdkCtx.Logger().Info(fmt.Sprintf("Running %s Upgrade...", UpgradeName)) |
| 44 | + |
| 45 | + return mm.RunMigrations(ctx, configurator, vm) |
| 46 | + } |
| 47 | +} |
0 commit comments