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

Fix EmptyRequestHash value to match empty set #13189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MatusKysel
Copy link

Description:

This PR corrects the computation of the requests_hash field for block headers. According to EIP-7685, the requests_hash should match the value of an empty sha256() digest if there are no valid requests. Currently, the computed hash does not align with the expected result, and also differs from the implementation in go-ethereum.

Changes:

def compute_requests_hash(block_requests: Sequence[bytes]):
    m = sha256()
    for r in block_requests:
        if len(r) > 1:
            m.update(sha256(r).digest())
    return m.digest()

block.header.requests_hash = compute_requests_hash(requests)

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