You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1c2b3a2
Browse filesBrowse the repository at this point in the historyBrowse files
Remove upgraded IBC state from x/upgrade and the upgrade precompile (#4340)
With the IBC modules gone and #4337 deleting their stores at v6.8,
`x/upgrade` still carried the machinery that existed only to serve IBC
light-client upgrades: the
`upgradedIBCState/<height>/upgradedClient|upgradedConsState` keys and
their `SetUpgradedClient`/`GetUpgradedConsensusState`/`ClearIBCState`
keeper helpers, the deprecated `Plan.upgraded_client_state` field and
its `ValidateBasic` rejection, the `Query/UpgradedConsensusState` gRPC
and REST route, and the `upgradedConsensusState` method on the upgrade
precompile at 0x1015. None of it has a consumer on Sei, and keeping it
means keeping a path that writes IBC state back into the upgrade store.
This removes all of it. `ScheduleUpgrade`, `ClearUpgradePlan` and
`ApplyUpgrade` no longer touch IBC keys; `Plan` reserves field 5 rather
than carrying a dead `Any`; the upgrade query service loses the
deprecated rpc and its request/response messages, with `query.pb.go`,
`query.pb.gw.go`, `upgrade.pb.go` and the swagger regenerated for just
these two proto files. On the EVM side the method is dropped from the
current precompile, its ABI and `Upgrade.sol`, and from the
not-yet-wired `legacy/v68` archive so it matches the v6.8 code it will
freeze. The `legacy/v67` snapshot keeps the selector and returns empty
bytes, which is what it always returned: neither pacific-1
(`/store/upgrade/subspace` at height 234051819) nor atlantic-2 (same
query at height 274315652) has any `upgradedIBCState` key, and none of
the four passed mainnet IBC proposals was an `UpgradeProposal`, so the
state was never written. To keep v6.7-era replays gas-identical, the
legacy method still charges the gas of the store read it used to perform
(`ReadCostFlat` plus `ReadCostPerByte` over the
`upgradedIBCState/<h>/upgradedConsState` key), and
`TestPrecompile_UpgradedConsensusStateRemoved` pins that charge. The
replay is gas-identical rather than byte-identical in every observable:
the read no longer reaches the store, so a `debug_trace*` prestate dump
of a historical tx that hit this selector would lack one absent-key
`upgrade` store read. That is not consensus-relevant and no such tx is
known.
A tx carrying `Plan.upgraded_client_state` is still rejected, now by the
unknown-field check at decode time instead of `ValidateBasic`; neither
path touches state. Amino JSON sign bytes are unchanged because the
pointer field was `omitempty`. State impact is limited to the v6.8
upgrade already in #4337, whose `pruneUpgradedIBCState` step stays as a
defensive no-op on mainnet. The v6.8 `rewriteRetiredIBCProposals` scan
from #4337 is also bounded here: it stops at proposal ID 1000 before
decoding anything above it, so zero-deposit proposals submitted in the
deposit window before the upgrade cannot stretch the upgrade block. IBC
proposal types stopped being submittable at v6.7, when the highest
proposal ID on any Sei network was 286, and every IBC proposal on
pacific-1 and atlantic-2 has an ID at or below 163. Reviewers should
look at the v67 legacy path and at `ClearUpgradePlan`, which is now a
plain plan delete. Validated with the `x/upgrade` and
`precompiles/upgrade` suites, the tagged v6.8 upgrade tests, the offline
v6.7→v6.8 migration and `make lint`.
0 commit comments