Skip to content

[bal-devnet-3] p2p/protocols/eth, p2p/sentry: EIP-8159 eth/71 handler + sentry dispatch (#20794)#20881

Merged
mh0lt merged 1 commit into
cp/eth71-pr1-bal-devnet-3from
cp/eth71-pr2-bal-devnet-3
May 4, 2026
Merged

[bal-devnet-3] p2p/protocols/eth, p2p/sentry: EIP-8159 eth/71 handler + sentry dispatch (#20794)#20881
mh0lt merged 1 commit into
cp/eth71-pr1-bal-devnet-3from
cp/eth71-pr2-bal-devnet-3

Conversation

@mh0lt
Copy link
Copy Markdown
Contributor

@mh0lt mh0lt commented Apr 28, 2026

Cherry-pick of #20794 onto bal-devnet-3. Stacked on top of #20880 (eth/71 PR1) and #20879 (devp2p fixes).

…tch (PR 2/3) (#20794)

Second of three stacked PRs implementing
[EIP-8159](https://eips.ethereum.org/EIPS/eip-8159). Adds the
server-side answer handler and wires eth/71 message dispatch into the
sentry.

**Depends on #20793** — review/merge that one first.

- `AnswerGetBlockAccessListsQuery` in
[p2p/protocols/eth/handlers.go](p2p/protocols/eth/handlers.go):
- Iterates request hashes, resolves block number via
`HeaderReader.HeaderNumber`.
  - Calls `rawdb.ReadBlockAccessListBytes` and appends RLP to response.
- Returns empty RLP list (`0xc0`) for any hash not in local rawdb —
EIP-8159's "not available" signal.
- Enforces a soft-size limit (default 2 MiB per EIP recommendation) by
truncating the response rather than padding.
- Sentry dispatch in `sentry_grpc_server.go` for the two new message
codes.
- `libsentry/protocol.go` — `ETH71` added to `ethProtocolsByVersion`,
`ProtoIds` whitelist extended; `MinProtocol(GET_BLOCK_ACCESS_LISTS_71)`
returns `ETH71` so only eth/71 peers are queried.
- Tests in
[p2p/protocols/eth/handlers_test.go](p2p/protocols/eth/handlers_test.go):
- `TestAnswerGetBlockAccessListsQuery_OrderedResponseWithMissing` —
asserts positional ordering, plus unknown-block and known-block-no-BAL
both return `0xc0` in the correct slot.
- `TestAnswerGetBlockAccessListsQuery_SoftSizeLimit` — seeds 5 oversized
BALs, asserts truncation (no partial payloads in the response).

No consumer-side fetcher yet — peers that speak eth/71 can answer our
queries, but we don't send any. That's PR 3.

1. #20793 — wire protocol constants + packet types.
2. **This PR** — handler + sentry dispatch.
3. #TBD (fetcher + downloader + devnet skill) — depends on this one.

- [x] `go test -short ./p2p/protocols/eth/... ./p2p/sentry/...`
- [x] `make lint` (0 issues)
- [x] `make erigon integration`
- [ ] PR 3 builds and tests cleanly on top.

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mh0lt mh0lt merged commit 6205daa into cp/eth71-pr1-bal-devnet-3 May 4, 2026
1 check failed
@mh0lt mh0lt deleted the cp/eth71-pr2-bal-devnet-3 branch May 4, 2026 22:29
mh0lt added a commit that referenced this pull request May 5, 2026
…atch bug (#20893) (#21003)

Cherry-pick of the BAL diagnostic tooling (bal-scan / bal-test /
debug_getRawBlockAccessList RPC) from #20893. Useful for the eth/71 BAL
exchange testing on bal-devnet-3 (dump/delete/refetch/compare workflow).

The server-dispatch wire-up half of #20893 is intentionally NOT
cherry-picked — it's already on bal-devnet-3 via #20881.
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