Skip to content

WIP Evm docs updates#210

Open
evanorti wants to merge 37 commits intomainfrom
evm-docs-updates
Open

WIP Evm docs updates#210
evanorti wants to merge 37 commits intomainfrom
evm-docs-updates

Conversation

@evanorti
Copy link
Contributor

Update EVM docs files and streamline

Add a single comprehensive EVM compatibility guide (evm/next/documentation/evm-compatibility.mdx) that documents supported EIPs/ERCs/opcodes, tooling, precompiles, JSON‑RPC behavior, and Cosmos-specific capabilities (finality, fees, addresses, chain IDs, performance). Remove now-redundant subpages: eip-2935.mdx, eip-7702.mdx, eip-reference.mdx, and overview.mdx to centralize compatibility information and avoid duplication.
@evanorti evanorti marked this pull request as ready for review February 17, 2026 22:12

### Transaction Type Routing

**Ethereum transactions (`MsgEthereumTx`)**: Routed to the EVM TxPool, which handles nonce gaps, promotion, and eviction. Executable transactions are then broadcast via CometBFT P2P.
Copy link
Member

Choose a reason for hiding this comment

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

This will definitely change after Krakatoa

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was told that the mempool stays as-is, and krakatoa is an opt-in feature, so we'll put krakatoa docs in an "experimental features" section.

The mempool setup is split across two locations:

### Step 1: Add EVM Mempool to App Struct
- [`evmd/mempool.go`](https://github.com/cosmos/evm/blob/main/evmd/mempool.go) — `configureEVMMempool` and `createMempoolConfig`, called automatically from `NewExampleApp`
Copy link
Member

Choose a reason for hiding this comment

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

What does "automatically" mean?

Copy link
Member

Choose a reason for hiding this comment

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

This is something we need to include to app.go

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to:

- [`evmd/mempool.go`](https://github.com/cosmos/evm/blob/main/evmd/mempool.go) — `configureEVMMempool` and `createMempoolConfig`, which must be called from your `app.go` after `setAnteHandler`

wdyt?


## Enabling Precompiles

Precompiles are enabled via the `active_static_precompiles` parameter in the `vm` module. Only addresses listed here are callable at runtime. For the full list of built-in precompiles and their addresses, see the [precompiles overview](/evm/next/documentation/smart-contracts/precompiles/overview).
Copy link
Member

Choose a reason for hiding this comment

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

You also need to wire them in during the app.go wiring (either with DefaultPrecompiles) or with your own set.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done. please review the file changes

}
```

To enable only a specific subset, pass the addresses explicitly. Addresses must be in sorted order:
Copy link
Member

Choose a reason for hiding this comment

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

Addresses must be in sorted order:

I'm actually not sure this is true - what tells you this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

"Sorted order is required for determinism. This is enforced by ValidatePrecompiles in x/vm/types/params.go — validation fails with "precompiles need to be sorted" if slices.IsSorted(precompiles) returns false.
"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@vladjdk I think it's enforced

// WRONG: Assuming Ethereum's 18 decimals
uint256 amount = 1 ether; // 1000000000000000000
staking.delegate(validator, amount); // Delegates 1 trillion tokens!
Cosmos chains typically use 6 decimals. Passing a value like `1000000000000000000` (1 ETH in wei) to a precompile on a 6-decimal chain will be interpreted as 1 trillion tokens.
Copy link
Member

Choose a reason for hiding this comment

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

NO

Specify 18 decimals on Cosmos chains. There's no modern reason why you should use 6

Copy link
Contributor Author

@evanorti evanorti Feb 24, 2026

Choose a reason for hiding this comment

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

@vladjdk

is this good?

<Warning>
  All precompile contracts should use Ethereum's standard 18 decimals.

  Although typical Cosmos chains use 6 decimals, EVM chains should use 18 decimals.
  Always check your chain's decimal precision before interacting with a precompile.
</Warning>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants