polaris icon indicating copy to clipboard operation
polaris copied to clipboard

feat(evm): Store EVM Bytecode, Blocks, Receipts outside the IAVL Tree

Open itsdevbear opened this issue 3 years ago • 4 comments

Should help performance, EVM bytecode is stored on chain by hash, so this is safe from a non determinism perspective.

https://docs.cosmos.network/main/architecture/adr-049-state-sync-hooks

Will significantly reduce the size of the IAVL tree as contract bytecode can be rather larger. This should help with speeding up the IAVL traversal for things.

Example:

https://github.com/notional-labs/wasmd/blob/8335e95737494d186c937ae13354e3f0e2c89e5d/x/wasm/types/wasmer_engine.go#L137

We can do this for bytecode (codehash -> code) We can do this for blocks(blockhash -> blockheader) We can do this for transactioins(txhash -> txn data + receipt)

itsdevbear avatar Feb 14 '23 00:02 itsdevbear

Should also allow us to up the 24kb bytecode limit without performance hit

itsdevbear avatar Feb 14 '23 12:02 itsdevbear

TODO confirm that one can disable this, such that a full node doesn't have to store the snapshots if it doesn't want to, and can retroactively sync if needed.

itsdevbear avatar Feb 14 '23 12:02 itsdevbear

@neverDefined can try this but JUST for bytecode if you want to try something spicy.

itsdevbear avatar Feb 23 '23 00:02 itsdevbear

Historical blocks completed.

Bytecode still in process.

itsdevbear avatar Mar 05 '23 16:03 itsdevbear