feat(l1): eth/72 sparse blobpool (EIP-8070)#6776
Conversation
|
Lines of code reportTotal lines added: Detailed view |
0b5fd64 to
4114b91
Compare
Add eth/72 protocol: cell_mask announcements, blob-payload elision, GetCells/Cells (0x14/0x15), provider/sampler blobpool sampling behind --blob-sampling (default off), and Engine API forkchoiceUpdatedV4 custodyColumns + engine_getBlobsV4. Built on existing EIP-7594 cell proofs.
Address spec divergences found auditing the code against EIP-8070: - per-node entropy in the provider/sampler decision (was globally correlated, breaking the Binomial(D,p) model) - advertise real cell availability in NewPooledTransactionHashes72 and let full-payload providers serve GetCells from stored blobs - gate the provider path on the announcer signaling full availability - restrict the C_extra sampling-noise column to provider peers and retrigger the 2-provider gate on later announcements - add --blob-eager-provider for block builders (EIP-8070 N8) All inert while --blob-sampling is off (default).
verify_cell_kzg_proof_batch_partial's non-c-kzg stub used &str::to_string, which is not in scope in no_std builds of ethrex-crypto. Use .into() to match the other KzgError::Unimplemented sites. Fixes the no_std and levm test builds (which compile ethrex-crypto without c-kzg).
Regenerate the CLI help block for --blob-sampling and --blob-eager-provider so the 'Verify CLI Help Consistency' check passes.
Builder now materializes elided blob bundles from stored cells (concat data columns 0..63, or Reed-Solomon recover from >=64) before inclusion, or skips txs it cannot fully reconstruct. Fixes BlobsBundle version drop on accumulation (init from fork in PayloadBuildContext, max in AddAssign).
Adds kzg cells_to_blob round-trip + recovery tests, mempool reconstruct_blobs_bundle tests (full/insufficient/validate), and updates the over-pack regression test to store real cells so reconstruction succeeds end-to-end. Resolves clippy lints in reconstruct_blobs_bundle.
engine_getBlobsV4 now emits fixed length-128 blobCells/proofs matrices with null at every non-requested or unheld index, matching execution-specs PR #2948 (_validate_cells_and_proofs). proofs becomes Vec<Option<Proof>>; cell and proof are kept in lock-step. Also record that the GetCells/Cells request_id is confirmed by the EIP-8070 rationale.
eth/72 always elides blob payloads in PooledTransactions; a node not running the sampler/provider cell-fetch loop receives blob txs it can never reconstruct. Gate the eth/72 capability (offer + negotiation) on blob_sampling_enabled so default nodes stay at eth/71 with unchanged full-blob propagation.
Resolves clippy::items-after-test-module (-D warnings) in the L2 lint job: the c-kzg helper was defined after the #[cfg(test)] mod tests block.
The integration test asserted the old compacted (popcount-length) response; align it with the sparse length-128 matrix from the F1 fix: value at the requested+held column, null at every other index for both cells and proofs.
- close blobs_v1 test fn before BlobsV4 test suite (union-merge brace) - drop unused CELLS_PER_EXT_BLOB import + needless &SECP256K1 borrow in payload_tests
- accept exactly 128 hashes (spec §5 "at least 128"): `>=` -> `>` off-by-one - gate on Amsterdam, not Osaka: getBlobsV4 is an Amsterdam Engine API method - return `null` per hash pre-fork/while syncing instead of -38005 UnsupportedFork (spec §6), mirroring getBlobsV3's established contract - tests: add blobs_v4_accepts_exactly_max_size; replace pre-Osaka-rejects with pre-Amsterdam-returns-null (unit + integration); activate Amsterdam in the serving-path test contexts Length-128 sparse response shape and version-0 -> null entry left as-is (backed by execution-specs PR #2948 and spec §6 respectively).
Implements EIP-8070 (eth/72 sparse blobpool / PeerDAS sampling). The EIP is Draft (a Glamsterdam candidate, not SFI), so this is a draft PR; not for merge.
Changes
cell_maskfield onNewPooledTransactionHashes; blob payloads elided to samplers inPooledTransactions; newGetCells (0x14)/Cells (0x15). Capability negotiation is version-gated, so eth/71 peers are unaffected.mempool.rs,sampling.rs): per-tx custody columns, cell verification against EIP-7594 proofs before storage, and pseudo-random provider role assignment (EIP-8070 §4).forkchoiceUpdatedV4accepts optionalcustodyColumns; newengine_getBlobsV4returnsBlobCellsAndProofsV1. Custody expansion re-samples pending blob txs.Default behavior
Sampling is off by default.
--blob-sampling(ETHREX_BLOB_SAMPLING) activates the sampler/provider state machine; without it the node is a full-replication provider (p=1.0) and default builds are behaviorally unchanged.--blob-eager-providerforces the provider role for builders (EIP-8070 N8).Testing
make lintand the full test suite pass. New coverage:mempool_cells_tests,sampling_tests,eip8070_kzg_tests,p2p/rlpx/eth72_tests,rpc/eth72_engine_tests.Follow-ups
cell_maskendianness (u128_to_b16, big-endian) needs cross-client confirmation vs geth/reth before interop; isolated to one function.GetCellsrequest-id framing to be confirmed against a canonical client (note incells.rs).