-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
I think this is not Xatu's problem but rather Cryo, but would like to flag it here in case somebody else has the same confusion.
Essentially, the code_hash and init_code_hash columns in the canonical_execution_contracts table are swapped.
Evidence 1: Compare with Geth
SELECT
contract_address,
block_number,
init_code_hash,
code_hash
FROM canonical_execution_contracts
FINAL
WHERE contract_address = '0x3cf9e625387a35863280e064db9b57c0cf8013d2'
LIMIT 1
Query id: 45bc7144-4382-4ef8-8360-95d89cbd2e47
┌─contract_address───────────────────────────┬─block_number─┬─init_code_hash─────────────────────────────────────────────────────┬─code_hash──────────────────────────────────────────────────────────┐
1. │ 0x3cf9e625387a35863280e064db9b57c0cf8013d2 │ 19000000 │ 0xb89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000 │ 0x56e3081a3d1bb38ed4eed1a39f7729c3cc77c7825794c15bbf326f3047fd779c │
└────────────────────────────────────────────┴──────────────┴────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────┘
Comparing it with a geth node:
Command: geth snapshot inspect-account 0x3cf9e625387a35863280e064db9b57c0cf8013d2
Disklayer: Root: 0673b60ffe3c1e8f18859908b1b032427a53263632d95b59f0495d27e7bcebdd
account.nonce: 1
account.balance: 0
account.root: 000f3f8d0b4b80f6d9d384e239166ebb889dd788d08a168328d8127344033958
account.codehash: b89c1b3bdf2cf8827818646bce9a8f6e372885f8c55e5c07acbd307cb133b000
Storage:
...
As shown, the address has a code hash of 0xb8...00, but in the table it appears in the init_code_hash column rather than code_hash.
Evidence 2: Mismatch number of unique code hashes
Distinct init_code_hash
SELECT countDistinct(init_code_hash)
FROM default.canonical_execution_contracts AS c
FINAL
Query id: 6e108300-25aa-41b8-ab40-67ea94221ef5
┌─countDistinc⋯_code_hash)─┐
1. │ 1762040 │ -- 1.76 million
└──────────────────────────┘
Distinct code_hash
SELECT countDistinct(code_hash)
FROM default.canonical_execution_contracts AS c
FINAL
Query id: 643a6b22-81aa-484c-8f82-4063bde161b8
┌─countDistinct(code_hash)─┐
1. │ 4543590 │ -- 4.54 million
└──────────────────────────┘
I know that from Geth and Reth node, the number of unique code hashes should only be around 1.7M. So that's another evidence that the columns are swapped.
n_code_bytes and n_init_code_bytes remain correct.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels