Skip to content

Commit f6d50b4

Browse files
srdtrkaljo242vladjdk
authored
feat(precompiles)!: added ics02 client router precompile (#768)
* feat: added ICS02 interface * style: rename * imp: added abi * imp: add interface * imp: added precompile boilerplate * feat: added tx.go * imp: added query * imp: use new abi * fix * imp: update default precompiles * imp: wire * docs: updated changelog * lint * test: boilerplate * fix: added missing adress * fix: wrong address * test: first test passing * test: bad case * feat: update client tested and working * lint: golanci-lint * test: verify membership * test: verify non-membership * lint * style: self review items * test: fix * chore: fix attempt * imp: change addr to 0x...807 instead of 0x...808 * imp: update required gas * docs: added README * imp: removed unused constants * test: added update_client misbehavior * test: added more update_client error cases * test: added more failure cases to get_client_state * test: added invalid header test * test: add failure cases for verify membership * test: added more failure cases to non-membership * imp: removed noop * imp: removed bankKeeper * lint * docs: added migration docs * docs: alex review items * docs: removed noop --------- Co-authored-by: Alex | Cosmos Labs <[email protected]> Co-authored-by: Vlad J <[email protected]>
1 parent 2ebcc0b commit f6d50b4

File tree

18 files changed

+1742
-4
lines changed

18 files changed

+1742
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### FEATURES
1212

13+
- [\#768](https://github.com/cosmos/evm/pull/768) Added ICS-02 Client Router precompile
14+
1315
### BUG FIXES
1416

1517
- [\#748](https://github.com/cosmos/evm/pull/748) Fix DynamicFeeChecker in Cosmos ante handler to respect NoBaseFee feemarkets' parameter.
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Cosmos EVM v0.5.0 → v0.6.0 Migration
2+
3+
## 0) Prep
4+
5+
- Create a branch: `git switch -c upgrade/evm-v0.6`.
6+
- Ensure a clean build + tests green pre-upgrade.
7+
- Snapshot your current params/genesis for comparison later.
8+
9+
---
10+
11+
## 1) Dependency bumps (go.mod)
12+
13+
- Bump `github.com/cosmos/evm` to v0.6.0 and run:
14+
15+
```bash
16+
go mod tidy
17+
```
18+
19+
---
20+
21+
<!-- TODO: Other changes required for the upgrade -->
22+
23+
## 3) App wiring in `app.go`
24+
25+
### Default Precompiles
26+
27+
We added a new default precompile, ICS-02 Client Router. As such, the function signature for `DefaultStaticPrecompiles` has changed to accept a `clientKeeper` parameter.
28+
29+
```diff
30+
app.EVMKeeper = evmkeeper.NewKeeper(
31+
appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], keys,
32+
authtypes.NewModuleAddress(govtypes.ModuleName),
33+
app.AccountKeeper,
34+
app.PreciseBankKeeper,
35+
app.StakingKeeper,
36+
app.FeeMarketKeeper,
37+
&app.ConsensusParamsKeeper,
38+
&app.Erc20Keeper,
39+
evmChainID,
40+
tracer,
41+
).WithStaticPrecompiles(
42+
precompiletypes.DefaultStaticPrecompiles(
43+
*app.StakingKeeper,
44+
app.DistrKeeper,
45+
app.PreciseBankKeeper,
46+
&app.Erc20Keeper,
47+
&app.TransferKeeper,
48+
app.IBCKeeper.ChannelKeeper,
49+
+ app.IBCKeeper.ClientKeeper,
50+
app.GovKeeper,
51+
app.SlashingKeeper,
52+
appCodec,
53+
),
54+
)
55+
```

evmd/app.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ func NewExampleApp(
464464
&app.Erc20Keeper,
465465
&app.TransferKeeper,
466466
app.IBCKeeper.ChannelKeeper,
467+
app.IBCKeeper.ClientKeeper,
467468
app.GovKeeper,
468469
app.SlashingKeeper,
469470
appCodec,

0 commit comments

Comments
 (0)