Skip to content

Retire the IBC precompile and drop dead IBC references (step 1 of sei-ibc-go removal) - #3883

Closed
masih wants to merge 3 commits into
mainfrom
cursor/remove-ibc-v67-e008
Closed

Retire the IBC precompile and drop dead IBC references (step 1 of sei-ibc-go removal)#3883
masih wants to merge 3 commits into
mainfrom
cursor/remove-ibc-v67-e008

Conversation

@masih

@masih masih commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes and provide context

IBC inbound and outbound are disabled on chain and are not coming back, and all funds have been reviewed. This is the first step toward deleting sei-ibc-go/ entirely at the v6.7 coordinated upgrade. It removes every IBC dependency that can be removed without touching the module wiring, so the later steps have a smaller surface.

Two commits:

  1. precompiles/ibc: retire the precompile at every version. 0x…1009 now reverts with "ibc precompile is retired; ibc transfers are disabled" instead of building a MsgTransfer. A new pcommon.NewRetiredPrecompile holds the single retired implementation; the root package and all 15 legacy tags are thin wrappers over it, each supplying its own embedded abi.json.

  2. Drop IBC references that were already dead. x/evm/keeper and giga/deps/xevm/keeper each stored an ibctransferkeeper.Keeper that no method in either package ever read; tools/utils listed the ibc/transfer stores; and three archived legacy common packages declared IBC keeper interfaces that nothing implements once the precompile is retired.

Three decisions worth reviewing

The address stays registered. Unregistering it would let a call to 0x…1009 succeed and return empty data instead of reverting, quietly turning a caller that fails today into one that believes it succeeded. This follows the retired oracle precompile at 0x…1008.

Every tag is retired, not just the current one. The oracle retirement kept its legacy versions executing real logic, because the oracle module still exists. Here the transfer store is being unmounted at v6.7, so a legacy version replayed at an old height would have no keeper to call — preserving the original code would buy nothing. The practical cost is that debug_traceTransaction on a historical block that called 0x…1009 reports a revert rather than the original transfer. That fidelity is forfeited by the store removal regardless of what this PR does.

Three archived legacy packages were edited. precompiles/common/legacy/{v605,v606,v610}/expected_keepers.go had their IBC keeper interfaces removed. This is against scripts/bump_version's rule that archived tags are immutable, so it is called out rather than slipped in. The edit is compile-only: nothing referenced those interfaces once the precompile stopped needing them.

Remaining steps (not in this PR)

  • Unwire wasm IBC (sei-wasmd/x/wasm/ibc.go, keeper/{ibc,relay}.go, the handler and query plugins, types/expected_keepers.go, wasmbinding's IBCRawPacketHandler).
  • Unwire app (keepers, IBC router, ModuleBasics, maccPerms, gov client-proposal routes, SetOrderInitGenesis, param subspaces, app/ante.go, the CheckMessage block in app/ante/cosmos_checktx.go, the ibcclient begin blocker in app/legacyabci/begin_block.go).
  • Drop ibc/transfer/capability from app.kvStoreKeyNames and sei-db/common/keys.MemIAVLStoreKeys, and add StoreUpgrades{Deleted: ...} for v6.7 in SetStoreUpgradeHandlers, the same shape as "dex" at v5.8.0.
  • git rm -r sei-ibc-go (~109k Go lines, roughly half generated .pb.go).

One product decision blocks the wasm step. Keeper.instantiate and Keeper.migrate call ensureIbcPort when report.HasIBCEntryPoints. With no port keeper, uploading or instantiating a contract that exports IBC entry points either has to be rejected outright or silently skip port binding. Rejecting is more honest — such a contract cannot work — but it is a consensus behavior change for deployers, so it should be an explicit call rather than an implementation detail.

One thing worth doing before the module goes. seid query ibc-transfer denom-trace is the only way to resolve an ibc/<hash> denom to its origin chain and base denom, and it dies with the module. If any of those denoms still carry supply, consider dumping the denom-trace table into the repo first so the mapping survives.

Testing performed to validate your change

  • go build ./... — clean.
  • go vet ./... across the whole repository — clean (this compiles test packages too).
  • go test ./precompiles/... — all pass.
  • go test ./x/evm/keeper/... — passes, including TestGetCustomPrecompiles, the completeness check that maps every entry in each precompile's versions file to an upgrade height. The IBC versions file is unchanged, so all 15 tags still resolve.
  • gofmt -s -l . and goimports -l . report nothing for any touched file.

Not covered: there is no integration test for the IBC precompile to update — integration_test/precompile_tests/README.md records that it is out of scope, and 0x…1009 is absent from PRECOMPILE_ADDRESSES.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 7, 2026 19:59
IBC inbound and outbound are disabled on chain and are not coming back, so
0x...1009 can no longer reach a transfer keeper. Every version tag now reverts
with a retirement reason instead of building a MsgTransfer.

All tags are retired rather than just the current one because the transfer
store is being unmounted: a legacy version replayed at an old height would have
no keeper to call, so preserving the original code would buy nothing.

The address stays registered. Unregistering it would let a call to 0x...1009
succeed and return empty data rather than revert, quietly turning a caller that
fails today into one that believes it succeeded.

Retiring frees the precompile keeper contract from IBC, so TransferKeeper,
ClientKeeper, ConnectionKeeper and ChannelKeeper leave precompiles/utils and
app/precompiles.go.

Co-authored-by: Masih H. Derkani <m@derkani.org>
x/evm and giga/deps/xevm stored an ibctransferkeeper.Keeper that no method in
either package ever read. The state-inspection tooling in tools/utils listed the
ibc and transfer stores, and three archived legacy common packages declared IBC
keeper interfaces that nothing implements now that the precompile is retired.

Co-authored-by: Masih H. Derkani <m@derkani.org>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedAug 8, 2026, 11:26 AM

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 67.74194% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.78%. Comparing base (a115971) to head (623796e).

Files with missing lines Patch % Lines
precompiles/common/retired.go 50.00% 8 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3883      +/-   ##
==========================================
- Coverage   61.61%   60.78%   -0.83%     
==========================================
  Files        2348     2255      -93     
  Lines      200852   190196   -10656     
==========================================
- Hits       123755   115616    -8139     
+ Misses      66044    64376    -1668     
+ Partials    11053    10204     -849     
Flag Coverage Δ
sei-chain-pr 60.70% <67.74%> (?)
sei-db 70.41% <ø> (ø)
sei-db-state-db ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app/app.go 71.90% <100.00%> (+0.35%) ⬆️
app/precompiles.go 100.00% <ø> (ø)
giga/deps/xevm/keeper/keeper.go 60.77% <100.00%> (-1.03%) ⬇️
precompiles/ibc/ibc.go 100.00% <100.00%> (+49.56%) ⬆️
precompiles/utils/expected_keepers.go 100.00% <ø> (ø)
tools/utils/helper.go 0.00% <ø> (ø)
x/evm/keeper/keeper.go 47.88% <100.00%> (-0.19%) ⬇️
precompiles/common/retired.go 50.00% <50.00%> (ø)

... and 130 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@masih

masih commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by a cleaner more maintainable approach here #3884

@masih masih closed this Aug 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants