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

Update EIP-7685: change requests hash to flat hash #8854

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
EIP-7685: change requests hash to flat hash
There is no need to create a tree hash over the requests, since proofs
related to requests will be made over the CL block. The EL block body stores
unvalidated requests and will never be used for proofs. Removing the tree hash
simplifies things.
  • Loading branch information
fjl committed Sep 4, 2024
commit b102f1ab572619209a931e1e1f3248f592e7adf6
19 changes: 6 additions & 13 deletions EIPS/eip-7685.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,11 @@ block_body_rlp = rlp([

#### Block Header

Extend the header with a new 32 byte value `requests_root`.

Let `requests_root` be the root of a Merkle-Patricia trie keyed by the index in
the list of `requests`. This is equivalent to how the transaction trie root is
computed.

The `requests_root` field value is therefore computed as follows:
Extend the header with a new 32 byte value `requests_hash`:

```python
def compute_trie_root_from_indexed_data(data):
trie = Trie.from([(i, obj) for i, obj in enumerate(data)])
return trie.root
def compute_requests_hash(list):
return keccak256(rlp.encode([ rlp.encode(req) for req in list]))
lightclient marked this conversation as resolved.
Show resolved Hide resolved

block.header.requests_root = compute_trie_root_from_indexed_data(block.body.requests)
```
Expand All @@ -89,9 +82,9 @@ EL request.

### Opaque byte array rather than an RLP array

By having the bytes of `request_data` array from second byte on be opaque bytes, rather than an RLP (or other
encoding) list, we can support different encoding formats for the transaction
payload in the future such as SSZ, LEB128, or a fixed width format.
By having the bytes of `request_data` array from second byte on be opaque bytes, rather
than an RLP (or other encoding) list, we can support different encoding formats for the
request payload in the future such as SSZ, LEB128, or a fixed width format.

### Request source and validity

Expand Down
Loading