Conversation
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.
|
|
||
| ### 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. |
There was a problem hiding this comment.
This will definitely change after Krakatoa
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
What does "automatically" mean?
There was a problem hiding this comment.
This is something we need to include to app.go
There was a problem hiding this comment.
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?
...documentation/getting-started/build-a-chain/additional-configuration/mempool-integration.mdx
Outdated
Show resolved
Hide resolved
|
|
||
| ## 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). |
There was a problem hiding this comment.
You also need to wire them in during the app.go wiring (either with DefaultPrecompiles) or with your own set.
There was a problem hiding this comment.
done. please review the file changes
| } | ||
| ``` | ||
|
|
||
| To enable only a specific subset, pass the addresses explicitly. Addresses must be in sorted order: |
There was a problem hiding this comment.
Addresses must be in sorted order:
I'm actually not sure this is true - what tells you this?
There was a problem hiding this comment.
"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.
"
| --- | ||
|
|
||
| ## Available Precompiles | ||
| Precompiles are smart contract interfaces deployed at fixed addresses where the implementation runs as native Go code rather than EVM bytecode. In standard Ethereum, precompiles are stateless and handle things like signature verification and hashing. In Cosmos EVM, they can also be stateful — reading from and writing to Cosmos SDK module state outside the EVM. |
There was a problem hiding this comment.
I feel like we may have repeated this 3 times
There was a problem hiding this comment.
Yeah, but in different places like the faq so I think it's ok.
| This is what makes them powerful: a smart contract can call the staking precompile to delegate tokens, the governance precompile to submit a proposal, or the IBC precompile to send tokens cross-chain — all using a standard Solidity interface, all within a single transaction. | ||
|
|
||
| Precompiled contracts provide direct, gas-efficient access to native Cosmos SDK functionality from within the EVM. Build powerful hybrid applications that leverage the best of both worlds. This page provides an overview of the available precompiled contracts, each with detailed documentation on its usage, Solidity interface, and ABI. | ||
| Calls are bidirectional. EVM contracts can call precompiles, and precompiles can call back into EVM contracts. When a precompile is invoked, execution routes from the EVM through the corresponding Cosmos SDK module and returns the result to the EVM for continued execution. Gas is metered across both environments. |
There was a problem hiding this comment.
I don't want to specify that they can call back into the EVM. Let's just say that it's a window into the Cosmos SDK space
There was a problem hiding this comment.
"Precompiles act as a window into the Cosmos SDK: when a precompile is invoked, execution routes from the EVM through the corresponding Cosmos SDK module and returns the result to the EVM for continued execution. Gas is metered across both environments."
| // 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. |
There was a problem hiding this comment.
NO
Specify 18 decimals on Cosmos chains. There's no modern reason why you should use 6
There was a problem hiding this comment.
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>
Update EVM docs files and streamline