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

EIP-4844 and EIP-7516 support #2151

Merged
merged 16 commits into from Mar 13, 2024

Conversation

fselmo
Copy link
Collaborator

@fselmo fselmo commented Mar 11, 2024

EIP-4844 support

  • Add dependency on newly released ckzg library.
  • Implement type=3 blob transacitons
  • Implement BLOBHASH opcode
  • Implement BLOBBASEFEE opcode
  • Implement blob_gas_used and excess_blob_gas on Cancun block headers
  • Turn on blockchain tests related to 4844 and 7516
  • Turn on transaction tests for Cancun

Note: The state of the API and transaction field classes is quite messy. We should address this in a separate PR. This will have a few undesired type: ignore lines for now until we can fix the API ABC class mess that's happening across legacy vs type, signed vs unsigned, fields vs methods... etc... I'll attempt to fix this before we merge cancun to main but maybe we can release with working logic and clean up the typing after the first cancun support release. Any thoughts on that release process are welcome.

Todo:

  • Fix lint issues
  • Investigate a handful of tests that halt the test suite / neither pass nor fail but hang. (addressed in 3a1753c)
  • Add entry to the release notes

Cute Animal Picture

Screenshot 2024-03-12 at 11 59 25

- Avoid repeated code for `calculate_intrinsic_gas` and in a few other places
  by using a basic inheritance pattern for unsigned typed transactions.
- This commit also fixes type hinting in a few places.
- Keep track of known header fields and raise a ``ValidationError``
  if more fields are in the header than are known. This will help
  with a lot of headaches in the future.
- Add a note to make sure the normalization of fields is updated as well.
- Get tests working for point evaluation.
- Invalid blob gas delta tests would hang indefinitely if the gas delta
  was no longer significant because of the exponential nature of the
  ``fake_exponential`` calculation. Instead, prevent the calculation
  from approximating beyond 10,000 iterations of the method as a baseline.
  We may need to adjust this number in the future if this somehow becomes
  problematic but it passes all ethereum tests and seems like a reasonable
  number for now.
- Turn those slow tests back on.
@fselmo fselmo force-pushed the eip-4844-support branch 2 times, most recently from ae4fb5a to 1751323 Compare March 12, 2024 17:07
- The state of transaction typing is quite messy. This will have to
  be addressed separately since this is a significant enough PR already.
  For now, de-DRY some of the changes made earlier and type: ignore some
  of the Cancun transaction fields until we fix the typing situation.
@fselmo fselmo marked this pull request as ready for review March 12, 2024 18:03
@fselmo fselmo changed the title Eip 4844 support EIP-4844 and EIP-7516 support Mar 12, 2024
@fselmo fselmo requested a review from pacrob March 12, 2024 18:07
eth/vm/forks/cancun/constants.py Outdated Show resolved Hide resolved
eth/validation.py Outdated Show resolved Hide resolved
eth/vm/forks/cancun/headers.py Outdated Show resolved Hide resolved
eth/vm/forks/cancun/headers.py Outdated Show resolved Hide resolved
eth/vm/forks/cancun/state.py Show resolved Hide resolved
eth/vm/forks/cancun/state.py Show resolved Hide resolved
eth/vm/state.py Outdated Show resolved Hide resolved
fselmo added a commit to fselmo/py-evm that referenced this pull request Mar 13, 2024
@fselmo fselmo merged commit 74e82b0 into ethereum:cancun-network-upgrade Mar 13, 2024
42 of 47 checks passed
@fselmo fselmo deleted the eip-4844-support branch March 13, 2024 17:51
fselmo added a commit that referenced this pull request Mar 14, 2024
@fselmo fselmo mentioned this pull request May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant