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

Implement Pectra Devnet 4 changes for requests and 7702 #1016

Merged
merged 5 commits into from
Oct 24, 2024

Conversation

gurukamath
Copy link
Collaborator

@gurukamath gurukamath commented Sep 30, 2024

This PR incorporates the following updates to the Prague EIPs

EIP-7002: add logging to system contract Update EIP-7002: add logging to system contract EIPs#8890
EIP-7251: max eb, change request to flat encoding Update EIP-7251: change request to flat encoding EIPs#8857
EIP-6110: deposits, change request to flat encoding Update EIP-6110: change request to flat encoding EIPs#8856
EIP-7002: withdrawals, change request to flat encoding Update EIP-7002: change request to flat encoding EIPs#8855
EIP-7685: change requests hash to flat hash Update EIP-7685: change requests hash to flat hash EIPs#8854

Additionally, it implements the updates to EIP-7702

What was wrong?

The version of the EIP-7685 and related EIPs is not in line with the latest discussions

How was it fixed?

Update the EIPs

This PR incorporates the following updates to the Prague EIPs

EIP-7002: add logging to system contract Update EIP-7002: add logging to system contract EIPs#8890
EIP-7251: max eb, change request to flat encoding Update EIP-7251: change request to flat encoding EIPs#8857
EIP-6110: deposits, change request to flat encoding Update EIP-6110: change request to flat encoding EIPs#8856
EIP-7002: withdrawals, change request to flat encoding Update EIP-7002: change request to flat encoding EIPs#8855
EIP-7685: change requests hash to flat hash Update EIP-7685: change requests hash to flat hash EIPs#8854
@gurukamath gurukamath changed the title make requests opaque for Prague Implement Pectra Devnet 4 changes for requests Sep 30, 2024
@gurukamath
Copy link
Collaborator Author

Tracking PR for further updates

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 41.17647% with 10 lines in your changes missing coverage. Please review.

Please upload report for BASE (forks/prague@2875a73). Learn more about missing BASE report.

Files with missing lines Patch % Lines
src/ethereum/prague/requests.py 30.00% 7 Missing ⚠️
src/ethereum/prague/fork.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff               @@
##             forks/prague    #1016   +/-   ##
===============================================
  Coverage                ?   75.82%           
===============================================
  Files                   ?      692           
  Lines                   ?    39264           
  Branches                ?        0           
===============================================
  Hits                    ?    29771           
  Misses                  ?     9493           
  Partials                ?        0           
Flag Coverage Δ
unittests 75.82% <41.17%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@gurukamath gurukamath changed the title Implement Pectra Devnet 4 changes for requests Implement Pectra Devnet 4 changes for requests and 7702 Oct 18, 2024
@gurukamath gurukamath requested review from petertdavies and SamWilsn and removed request for petertdavies October 18, 2024 16:07
@gurukamath gurukamath marked this pull request as ready for review October 18, 2024 16:08
)


def process_requests(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"requests" on its own is a little vague. Is there a more descriptive name we could use?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I think requests has come to be accepted as refering to the general purpose execution layer requests from EIP-7685. However, I see the point about it being confusing to non-EL audience. Switched it to process_general_purpose_requests

src/ethereum/prague/requests.py Outdated Show resolved Hide resolved
@@ -8,20 +8,11 @@
[EIP-7685]: https://eips.ethereum.org/EIPS/eip-7685
"""

from dataclasses import dataclass
from typing import Tuple, Union
from hashlib import sha256
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we create a wrapper in ethereum.crypto.hash like we do for keccak256?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless we plan on moving this whole function (for computing the hash of a list of bytes) to ethereum.crypto, we will need it here

evm_call_output[start : start + CONSOLIDATION_REQUEST_LENGTH]
)
consolidation_requests += (encode_request(consolidation_request),)
m = sha256()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird. We should make a note somewhere (probably in ethereum.crypto.hash) of exactly what algorithm this is. I believe it's SHA2-256, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note to the function doc string

src/ethereum/prague/utils/message.py Show resolved Hide resolved
src/ethereum/prague/vm/eoa_delegation.py Show resolved Hide resolved
src/ethereum/prague/vm/eoa_delegation.py Outdated Show resolved Hide resolved
src/ethereum/prague/vm/eoa_delegation.py Outdated Show resolved Hide resolved
@gurukamath gurukamath mentioned this pull request Oct 22, 2024
1 task
@petertdavies petertdavies merged commit a95b7aa into ethereum:forks/prague Oct 24, 2024
5 checks passed
@gurukamath gurukamath deleted the update-requests branch December 13, 2024 09:55
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.

4 participants