Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generic chain type #635

Closed
Tracked by #373
Wodann opened this issue Aug 30, 2024 · 1 comment
Closed
Tracked by #373

Add generic chain type #635

Wodann opened this issue Aug 30, 2024 · 1 comment
Assignees

Comments

@Wodann
Copy link
Member

Wodann commented Aug 30, 2024

Definition of Done

  • Add a struct GenericChainSpec (ideally in a new crate edr_generic)
  • Implement the traits outlined in the book for GenericChainSpec such that it can be used from Hardhat
  • Treat unknown transaction types as PostEip155Legacy as in the main branch
  • Allow remote blocks to have a missing nonce as in main (also see PR with change)
  • Reintroduce this test alongside the GenericChainSpec implementation and validate it works (this test cannot work for L1ChainSpec as it would throw an error when detecting unknown transaction types)
  • Add test to validate that the generic chain type can parse this eth_getBlockByNumber response (taken from this issue):
    {"jsonrpc":"2.0","result":{"author":"0xa3b079e4b54d2886ccd9cddc1335743bf1b2f0ad","difficulty":"0xfffffffffffffffffffffffffffffffe","extraData":"0x4e65746865726d696e64","gasLimit":"0x663be0","gasUsed":"0x0","hash":"0x12a6d4673bc9a55b5f77d897f32eb0ff15bca32d09d3dff8013e3ff684b0a84d","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","miner":"0xa3b079e4b54d2886ccd9cddc1335743bf1b2f0ad","number":"0x1b000b1","parentHash":"0x26046ba285c7c87ff04783347a5b63cba77d884a11a50a632ea68ba2843b3064","receiptsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","signature":"0x012bb653a98ede38cd88f59fb09c67a8628012e3a4bdd6925a3dee547e0c4f470aa3118d03e4c81b715200aeb34b00f7c67a0a9cd687ff26c2dbc82964d4268a00","size":"0x238","stateRoot":"0x62cb23bc47439bc73eef6bf9fc0e54b1a40ebb3b0cbcfefd6b13cbc79a1095b6","step":343268919,"totalDifficulty":"0x1b000b0ffffffffffffffffffffffffe9dc2118","timestamp":"0x664d5713","transactions":[],"transactionsRoot":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","uncles":[]},"id":1}
  • Replace the registration of the L1 chain type in Hardhat with the Generic chain type.
  • Validate that all Hardhat tests pass
  • (optional) Incorporate the feature for better error messages when running unknown transaction types by merging main
    • This was listed to keep track, but can be done in a follow-up PR
@Xanewok
Copy link
Contributor

Xanewok commented Sep 13, 2024

I'll close this as completed by #653 but feel free to re-open it if there's anything else to be done. I assume that the last, optional item on the list will be completed as we merge main into the feature branch in order to prepare it to land in main but I can also look into that if you'd like me to.

@Xanewok Xanewok closed this as completed Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

2 participants