py-evm icon indicating copy to clipboard operation
py-evm copied to clipboard

Support for the ``Paris`` hard fork ("The Merge")

Open fselmo opened this issue 3 years ago • 1 comments

What was wrong?

Paris "the merge" fork support is needed.

How was it fixed?

Support for Paris logic added:

  • Paris vm added and relevant classes.
  • EIP-4399: Supplant DIFFICULTY opcode with PREVRANDAO - pushing the mix_hash value to the stack.
  • Turn on merge-related ethereum/tests.
  • Address some issues with our header db. Difficulty was used to calculate keys for scores and difficulty is always 0 now. This caused issues with overwriting same values for keys.
  • Make Merge tests pass by poking around the library and addressing other issues.
    • The transaction fee being 0 and going to the coinbase address never triggered EIP-161 to actually remove the account from state trie calculation if the fee recipient account was in a zero-state at the end of the computation. For the last 15 remaining tests, this ended up being what was causing a wrong state root.

Todo:

  • [x] Clean up commit history
  • [x] Clean up "minging" nomenclature around base classes, add PoS consensus... these will likely be done in a separate PR to keep things smaller
  • [x] Address failing tests
  • [x] Add entry to the release notes

Cute Animal Picture

put a cute animal picture link inside the parentheses

fselmo avatar Sep 15 '22 00:09 fselmo

This PR has the rough implementation necessary to pass all the logic behind the merge but I think what comes after this should be the cleaning up of nomenclature around mining, etc... to be a bit more generalized, at least in the base classes. We can probably take this time to refactor some code along the way as well.

I created #2079 to track that.

fselmo avatar Sep 30 '22 00:09 fselmo