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 BEP-466.md #469

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
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
17 changes: 12 additions & 5 deletions BEPs/BEP-466.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,24 @@ The goal is to make the block format compatible with EIP-7685. This allows for s

## Specification

### Block Body

Define `requests` as an empty array:
### Requests
A `requests` object consists of a `request_type` prepended to an opaque byte array `request_data`.
```golang
requests = make(types.Requests, 0)
requests = request_type ++ request_data
```
Each request type will defines its own `requests` object using with its own `request_data` format.

### Block Header

In accordance with EIP-7685, add `requests_hash` to the end of the block header:
In accordance with EIP-7685, add a new 32 byte value `requests_hash` to the end of the block header:
```golang
def compute_requests_hash(requests):
m = sha256()
for r in requests:
m.update(sha256(r))
return m.digest()

requests = make(types.Requests, 0) // empty request for BSC
block.header.requests_hash = compute_requests_hash(requests)
```
When calculating the header signature, ensure that requests_hash is included in the computation.
Expand Down