sourcify icon indicating copy to clipboard operation
sourcify copied to clipboard

Verifying contracts with immutables that are older

Open kuzdogan opened this issue 3 years ago • 1 comments

Looking into the https://github.com/celo-org/celo-monorepo/issues/9182#issuecomment-1035954373 issue, I noticed for older transactions the JSON RPC call eth_getTransactionByHash fails for geth full nodes, but works for archive nodes. I don't exactly know for how old transactions this happens but seems to be somewhere around 10+ months.

As manifested in that issue, this can become a problem when verifying contracts with immutables that are older, as currently for their verification the creation bytecode of the contract is retrieved from their creation transaction hash, but this would fail if the contract is "older".

This is the reason why currently the test verifyContractWithImmutables fails for Celo Alfajores. It's expected more tests will start to fail if the node behind the RPC is a full node and the transaction that created the contract becomes unavailable via eth_getTransactionByHash.

This would, however, be irrelevant for Ethereum networks once https://github.com/ethereum/sourcify/pull/507 is implemented.

Edit: This is related to the geth flag --txlookuplimit: https://geth.ethereum.org/docs/interface/command-line-options

kuzdogan avatar Feb 11 '22 08:02 kuzdogan

Also fails for the Celo Mainnet contract 0xFCC5A03BF803213E478ccbE6517857faa3136978 https://gist.github.com/lastperson/4ffc43310d5aa8f35b35b3cc5c22c7a4

kuzdogan avatar Mar 09 '22 11:03 kuzdogan

Lets explain this in the docs

marcocastignoli avatar Nov 08 '22 09:11 marcocastignoli

Added in the docs with https://github.com/sourcifyeth/docs/commit/67e24ca3722775b9cdabb579d45e1f393b43b088

marcocastignoli avatar Nov 10 '22 13:11 marcocastignoli