Skip to content

Implement Deposit Requests #2748

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

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open

Implement Deposit Requests #2748

wants to merge 13 commits into from

Conversation

anvacaru
Copy link
Contributor

@anvacaru anvacaru commented Apr 24, 2025

Implementing Execution Layer Requests EIP-7685 and Deposit Requests EIP-6110.

Needs to be rebased to master after #2747 gets merged.

KEVM Implementation for EIPs 7685/6110

Configuration & Structure Changes

  • Add requests.md file with execution layer request implementation

  • Add configuration cells:

    • <requestsRoot> in block header
    • <requests> and <depositRequests> in network section
  • Add execution flow logic:

    • #filterLogs function to process transaction logs. After all transactions in a block have finished executing, rules for #filterLogs will parse each log item to look for various requests (only Deposit implemented so far).
    • Add a log filtering call to block finalization
  • #parseDepositRequest: Validates and extracts deposit requests by filtering logs from the deposit contract with the correct event signature

  • #extractDepositData: Extracts the five deposit fields (pubkey, withdrawal_credentials, amount, signature, index) from raw log data according to EIP-6110 field offsets

  • #isValidDepositEventData: Validates deposit log structure by checking data length (576 bytes) and verifying all expected field offsets and sizes

  • #computeRequestsHash: Calculates the final 32-byte commitment hash that goes into the block header by processing all non-empty requests

  • #computeRequestsHashIntermediate: Builds the intermediate hash list by skipping empty requests, hashing valid requests, and concatenating results in request-type order

  • Add protocol features:

    • Ghasrequests flag (activated in Prague)
    • EVMC_INVALID_BLOCK status code
  • Update block hash calculations:

    • Add request hash to block header hash
    • Update RLP serialization
  • Update state management:

    • Initialize request fields in clearBLOCK
    • Handle request fields in RLP loading
  • Updated K proof files

@anvacaru anvacaru marked this pull request as ready for review April 25, 2025 16:42
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.

1 participant