Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ante/interfaces/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
"github.com/ethereum/go-ethereum/core/vm"

feemarkettypes "github.com/cosmos/evm/x/feemarket/types"
"github.com/cosmos/evm/x/vm/core/vm"
"github.com/cosmos/evm/x/vm/statedb"
evmtypes "github.com/cosmos/evm/x/vm/types"

Expand Down
153 changes: 105 additions & 48 deletions api/cosmos/evm/vm/v1/evm.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions evmd/activators.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package evmd

import (
"github.com/ethereum/go-ethereum/core/vm"

"github.com/cosmos/evm/evmd/eips"
"github.com/cosmos/evm/x/vm/core/vm"
)

// cosmosEVMActivators defines a map of opcode modifiers associated
// with a key defining the corresponding EIP.
//
//nolint:unused
var cosmosEVMActivators = map[string]func(*vm.JumpTable){
"evmos_0": eips.Enable0000,
"evmos_1": eips.Enable0001,
"evmos_2": eips.Enable0002,
var cosmosEVMActivators = map[int]func(*vm.JumpTable){
0o000: eips.Enable0000,
0o001: eips.Enable0001,
0o002: eips.Enable0002,
}
6 changes: 3 additions & 3 deletions evmd/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@ import (
"os"
"sort"

corevm "github.com/ethereum/go-ethereum/core/vm"
"github.com/spf13/cast"

// Force-load the tracer engines to trigger registration due to Go-Ethereum v1.10.15 changes
_ "github.com/cosmos/evm/x/vm/core/tracers/js"
_ "github.com/cosmos/evm/x/vm/core/tracers/native"
_ "github.com/ethereum/go-ethereum/eth/tracers/js"
_ "github.com/ethereum/go-ethereum/eth/tracers/native"

abci "github.com/cometbft/cometbft/abci/types"

Expand All @@ -34,7 +35,6 @@ import (
"github.com/cosmos/evm/x/ibc/transfer"
transferkeeper "github.com/cosmos/evm/x/ibc/transfer/keeper"
"github.com/cosmos/evm/x/vm"
corevm "github.com/cosmos/evm/x/vm/core/vm"
evmkeeper "github.com/cosmos/evm/x/vm/keeper"
evmtypes "github.com/cosmos/evm/x/vm/types"
"github.com/cosmos/gogoproto/proto"
Expand Down
1 change: 1 addition & 0 deletions evmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func EvmAppOptions(chainID string) error {
ethCfg := evmtypes.DefaultChainConfig(chainID)

err = evmtypes.NewEVMConfigurator().
WithExtendedEips(cosmosEVMActivators).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original didn't have the EIPs enabled? Interesting

WithChainConfig(ethCfg).
// NOTE: we're using the 18 decimals default for the example chain
WithEVMCoinInfo(baseDenom, uint8(coinInfo.Decimals)).
Expand Down
18 changes: 13 additions & 5 deletions evmd/eips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ In **Cosmos EVM**, custom activators should be defined in a structure with the s
```go
// Activate custom EIPs: 0000, 0001, 0002, etc
cosmosEVMActivators = map[int]func(*vm.JumpTable){
"evmos_0": eips.Enable0000,
"evmos_1": eips.Enable0001,
"evmos_2": eips.Enable0002,
0o000: eips.Enable0000,
0o001: eips.Enable0001,
0o002: eips.Enable0002,
}
```

Expand All @@ -123,11 +123,11 @@ should be defined. An example is reported below:

```go
cosmosEVMEnabledEIPs = []int64{
"evmos_0",
0o000,
}
```

In this way, even though the custom activators defined $3$ new EIPs, we are going to activate only the number `evmos_0`
In this way, even though the custom activators defined $3$ new EIPs, we are going to activate only the number `0o000`

### EVM Configurator

Expand Down Expand Up @@ -256,3 +256,11 @@ chain. To enable them there are two possibilities:
- Write a migration to add the new enabled EIPsm during the upgrade.

- After the upgrade, create a governance proposal to modify the `x/evm` params.

## Migrations

Previous versions of evmOS and ethermint had converted custom EIPs to use string identifiers such as `"chain_0"`.
The `cosmos/evm` repo has converted these back to integer identifiers in order to reduce the maintenance burden of
integrating with upstream go-ethereum.

In order to migrate custom EIPs, you'll simply need to convert your string identifiers to integers.
2 changes: 1 addition & 1 deletion evmd/eips/eips.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package eips

import (
"github.com/cosmos/evm/x/vm/core/vm"
"github.com/ethereum/go-ethereum/core/vm"
)

var (
Expand Down
Loading
Loading