Repository navigation
Conversation
Adds Blocks.DependencyProofAggregation=Mempool, EIP-8518 proof wrappers and eth/76 (0x18-0x1c) on eth/74. Received wrapper proofs cover their transactions in the pool and in built blocks; reorged transactions are re-aggregated from their block's proof.
…dEth/nethermind into feature/eip8288-claims-mempool
It inherited eth/74's static protocol info, so its factory took eth/74 sessions.
Discard a wrapper only under the hash it really has, hold one only while one of its transactions is pending, bound the encoding cache by bytes, and cap a peer's concurrent fetches and the proof failures fetched from it.
…ng table Each wanted wrapper waits or is fetched from one announcer; a single scheduler assigns waiting ones to the first announcer with a free request, so a busy peer fails over at once and a removed or failing peer's fetches move on. Unanswered requests count as failures, and a wrapper left without announcers is forgotten.
A peer opens at most 512 fetches, a full announcer list takes a new announcer in place of a failed or busy one, and an announcement looks its peer up under the lock RemovePeer cleans up under.
|
Claude finished @Marchhill's task in 3m 9s —— View job PR #16469 review: EIP-8518 mempool aggregation and
|
| Severity | Location | Issue |
|---|---|---|
| Medium | DependencyProofCache.cs:23 |
The cache allows 32 MiB of statements, but the relay holds up to 64 MiB of wrappers with proofs of up to 1 MiB each. Every 6 s Prune() re-adds all their proofs, so statements keep evicting each other. A transaction first admitted from a wrapper keeps AggregatedWitness: when its raw pooled form arrives it gets AlreadyKnown, so it cannot fall back to raw witnesses. While its statement is evicted it is skipped as NotCovered and is not re-aggregated, so it can stay unbuildable. |
| Low | ProofWrapperRelay.cs:496 |
The result of Announced.TryGet is ignored. If the 4096-entry LRU evicted the announcement, Length is 0, decoding returns Malformed, and an honest peer is disconnected. |
| Low | Session.cs:295 |
The fast path now ends at 6,723 bytes instead of about 3 MiB. Every larger message, on any protocol, now does a route lookup. |
| Low | AggregatingBlockProcessor.cs:69 |
ExcludeAggregated is only cleared when the rebuild reaches ProcessOne. If the rebuild stops earlier, the next production build quietly leaves out covered transactions. |
| Low | AcceptTxResult.cs:252 |
Message is made public so the relay can classify rejections by their text (IsWitnessError(result.Message)). That is new public surface and depends on the message wording. |
Checked and found sound
AggregatedWitnessis matched by reference, so no decoded witness can be it. The pool accepts it only inMempoolmode with EIP-8288 active. The picker allows such a transaction only when a held proof covers it, andAggregatingBlockProcessorrefuses to fall back to raw witnesses (mustAggregate). This makesacceptAggregated: trueinTransactionProcessorBase.FrameTx.cs:768safe.- Wrapper validation:
- A wrapper is discarded only under its canonical hash, so a peer cannot get someone else's wrapper refused.
depsmust be the exact canonical union.- The reconstructed size is checked against the bound while decoding.
- Hints and the manifest are checked before the STARK is verified.
- Responses are matched in order with
Match.
- Fetch scheduling: each peer's opened fetches, concurrent requests and failure count are bounded. A removed peer's fetches are handed to other announcers. Serving is rate-limited and answers empty once its backlog is spent.
- Capability:
eth/76is advertised only withMempoolmode and EIP-8288 scheduled.
Smaller notes (no inline comment)
- STARK verification (
VerifyProof) runs inline in the fetch continuation on the thread pool. With several peers each having up to 4 requests in flight, a burst of large wrappers could tie up many pool threads. A small dedicated verification queue may be worth it later. - In
Aggregate(), ifCovering(unwitnessed)returnsnull(eviction afterCoverspassed), the prover still runs with uncovered dependencies and fails. That costs a prover call and is logged only at Debug. You could recheck and skip in that case. - On the eth74 Hive question: I can't move the eth74 suite to the newer engine methods from here; that change belongs in Marchhill/go-ethereum.
Tests look thorough for the scope. I didn't run them in this job.
| private const int MaxStatements = 16; | ||
| // Proof wrappers and received blocks share the statements with this builder's own, so they are bounded by bytes first. | ||
| private const int MaxStatements = 256; | ||
| private const long MaxStatementBytes = 32 * 1024 * 1024; |
There was a problem hiding this comment.
Medium: the statement byte budget is smaller than the relay's held set, so covered transactions can become unbuildable.
MaxStatements went from 16 to 256, but MaxStatementBytes is still 32 MiB. ProofWrapperRelay holds up to 256 wrappers or 64 MiB, and each proof can be up to MaxAggregateProofBytes (1 MiB). Every 6 s, Prune() (ProofWrapperRelay.cs:779) calls Remember for each held wrapper that still covers a pending transaction. When those proofs total more than 32 MiB, each round evicts the oldest statements, including this builder's own and block proofs.
Why this matters: a transaction admitted from a wrapper keeps AggregatedWitness. When the plain pooled form arrives later it gets AlreadyKnown, so it never goes back to raw witnesses. AggregatedTxPicker then skips it with NotCovered for as long as its statement is evicted. Aggregate() also skips it, because IsCovered sees the held wrapper. So a valid, paying transaction can stay unbuildable while its wrapper is still held.
Possible fixes: size MaxStatementBytes to at least the relay's proof budget, or count statements that back held wrappers separately, or have the picker/Plan fall back to the held wrapper's proof.
There was a problem hiding this comment.
Thanks, fixed in 7105030. The statement cache now holds 96 MiB, and the relay keeps its held wrappers' proofs within half of it. Prune refreshes them each round, so they no longer evict each other. Is falling back to a raw copy arriving later worth a pool change here, or better as a follow-up?
| private void Receive(IProofWrapperPeer peer, PeerState state, ServedWrapper served, bool compact, | ||
| Dictionary<ValueHash256, ValueHash256[]>? manifests, List<ValueHash256>? retryFull) | ||
| { | ||
| state.Announced.TryGet(served.Hash, out WrapperAnnouncement announcement); |
There was a problem hiding this comment.
Low: an honest peer can be disconnected if its announcement was evicted. The TryGet result is ignored. PeerState.Announced is an LRU with 4096 entries, so it can drop the entry between the announcement and the response, for example when a peer announces quickly while requests are queued. In that case announcement is default, Length is 0, and TryDecode gets bound = 0. It returns Malformed, and the relay sends a ProtocolViolation disconnect to a peer that did nothing wrong. Consider treating a missing announcement as "no longer wanted" (Complete/skip) instead of decoding with a zero bound. FetchManifests (line ~414) has the same pattern.
There was a problem hiding this comment.
Thanks, fixed in 7105030. A wrapper whose announcement was forgotten is now left to another announcer, without blame. A test covers it.
| bool IMessageLimitSession.ExceedsMessageLimit(int adaptivePacketType, int uncompressedLength) | ||
| { | ||
| if (uncompressedLength <= Subprotocols.Eth.V74.Eth74Protocol.LocalMaxResponseBytes || _routes is not { } routes) return false; | ||
| if (uncompressedLength <= Subprotocols.Eth.V76.Eth76Protocol.MaxAnnouncementBytes || _routes is not { } routes) return false; |
There was a problem hiding this comment.
Low (hot path): the fast-path threshold drops from about 3 MiB to 6,723 bytes for every session. Previously, any message up to Eth74Protocol.LocalMaxResponseBytes returned straight away. Now every message over 6.7 KB, on any protocol and any eth version (eth/68 tx batches, bodies, receipts, snap ranges), pays for ResolveProtocol and a _protocols lookup. Each lookup is cheap, but this runs on every frame. You could keep the old early return for sessions that didn't negotiate eth/76, for example by caching the negotiated eth version, or check MaxAnnouncementBytes only after resolving to Eth76MessageCode.NewProofWrapperHashes.
There was a problem hiding this comment.
Thanks, fixed in 7105030. The fast path stays at eth/74's cap unless eth/76 was negotiated, and the version is read from the protocol table, not the route resolver. Does that look right?
| finally | ||
| { | ||
| inner.TransactionsExecuted -= Aggregate; | ||
| if (rebuild) _production.ExcludeAggregated = false; |
There was a problem hiding this comment.
Low: ExcludeAggregated is only cleared when the rebuild reaches this ProcessOne. NotReady() sets the flag, and the producer's rebuild is expected to clear it here. If the rebuild never gets here, the flag carries over to the next production build in this scope, which then quietly leaves out covered transactions. That happens if PrepareBlock throws, the token is cancelled, or the spec check at the top returns early. Resetting it in BlockProducerBase (a try/finally around the retry), or tying the exclusion to the specific block/attempt, would make this safer.
There was a problem hiding this comment.
Thanks, fixed in 7105030. The exclusion is now keyed to the block's parent and timestamp, so a rebuild that never runs can't affect another block. A picker case covers it.
| private int Id { get; } | ||
| private string Code { get; } | ||
| private string? Message { get; } | ||
| public string? Message { get; } |
There was a problem hiding this comment.
Low: new public surface, and the relay classifies rejections by message string. Message is made public only so that ProofWrapperRelay.Accept can call FrameTxClaimVerifier.IsWitnessError(result.Message). That ties the relay's discard decision to the free-text detail FrameTxClaimFilter passes to Reject, so any change to how that detail is formatted would silently change relay behaviour. AGENTS.md asks to avoid new public members. A dedicated AcceptTxResult code for witness failures, compared by identity, would avoid both problems.
There was a problem hiding this comment.
Would keeping this be acceptable? IsWitnessError compares against the FrameTxClaimVerifier constants that the pool's claim filter itself rejects with, which is also how the pool decides SidecarRejected. The alternative is to re-verify retained witnesses in the relay before submitting, which would duplicate the filter. Happy to switch if you'd prefer.
Keep the held wrappers' proofs within half the statement cache, key the rebuild's exclusion to its block, leave a wrapper with a forgotten announcement to another announcer, skip a re-aggregation whose covering proofs were evicted, and keep the session's fast path at eth/74's cap unless eth/76 is negotiated.
…dEth/nethermind into feature/eip8288-claims-mempool
|
Thanks for the review. All the inline points are addressed in 7105030 or answered in their threads. On the smaller notes: |
|
Claude finished @Marchhill's task in 1m 11s —— View job Re-review of PR #16469 after 7105030
Result: 1 Medium and 1 Low remain, no Critical or High. Each has an inline comment. Earlier findings
Your questions
No regressions found in the fix commit
I didn't build the code or run tests in this job. |
| private const int MaxStatements = 16; | ||
| private const long MaxStatementBytes = 32 * 1024 * 1024; | ||
| // Proof wrappers and received blocks share the statements with this builder's own, so they are bounded by bytes first. | ||
| private const int MaxStatements = 256; |
There was a problem hiding this comment.
Medium: the count bound can still evict held wrappers' statements, so the earlier Medium is only partly fixed. 7105030 keeps the held proofs within half of the 96 MiB byte budget. But MaxStatements is still 256, and ProofWrapperRelay.MaxHeldWrappers is also 256. When held wrappers average less than 192 KiB of proof (48 MiB ÷ 256), the count bound is hit before the byte bound. At that point each block proof (RememberBlockProof) and each builder statement goes through Remember, which evicts the oldest statement by count (line ~204). That statement is often a held wrapper's.
Prune() puts them back only every 6 s. Between two rounds, AggregatedTxPicker returns NotCovered for that wrapper's transactions, and Aggregate() skips them because IsCovered sees the held wrapper. That is the same window of unbuildable transactions as before, with a smaller budget. Each Remember also does a linear dedupe scan over the full list.
Simplest fix: bound the count the same way you bounded the bytes. For example, set MaxStatements = 2 * MaxHeldWrappers, or make MaxHeldWrappers depend on DependencyProofCache.MaxStatements / 2, the way MaxHeldProofBytes already depends on the byte budget.
| Dictionary<ValueHash256, ValueHash256[]> manifests = []; | ||
| foreach (ServedManifest manifest in Match(served, large, static m => m.Hash)) | ||
| { | ||
| state.Announced.TryGet(manifest.Hash, out WrapperAnnouncement announcement); |
There was a problem hiding this comment.
Low: the same forgotten-announcement case remains in FetchManifests. Receive now returns when TryGet fails, but this line still ignores the result. The entry was present when large was built (line 435). After the await GetProofWrapperManifests, the peer's further announcements can evict it from the 4096-entry LRU. Then announcement is default, IsValidManifest sees Length == 0 and returns false, and an honest peer gets a ProtocolViolation disconnect.
| state.Announced.TryGet(manifest.Hash, out WrapperAnnouncement announcement); | |
| if (!state.Announced.TryGet(manifest.Hash, out WrapperAnnouncement announcement)) | |
| { | |
| // Unverifiable against a forgotten announcement; left to another announcer, as in Receive. | |
| hashes.Remove(manifest.Hash); | |
| continue; | |
| } |
Finish gets the original assigned list, so a hash removed here still moves to its next announcer.
There was a problem hiding this comment.
Thanks, fixed in d3a2ac7. The forgotten announcement is skipped there too, and a test covers it.
…ip forgotten manifests
Stateless guest costRestored from Only absolute measurements are shown.
|
…pers Budgets are keyed by node ID, so they outlive reconnections, under a global cap on requests. Aggregate proofs not verified before are rate limited per node and overall, and a served wrapper longer than announced is refused before decoding.
… proven nodes Replaces the fair-share exception, which left the caps unbounded under many fresh nodes.
…' into feature/eip8288-claims-mempool # Conflicts: # src/Nethermind/Nethermind.Consensus/Processing/BranchProcessor.cs # src/Nethermind/Nethermind.Consensus/ProofAggregation/Eip8288Module.cs
…rapper transactions is ready
|
Claude finished @Marchhill's task in 1m 1s —— View job Re-review of PR #16469 after
|
| Severity | Location | Issue |
|---|---|---|
| Medium | AggregatingBlockImprovementContextFactory.cs:150 |
In Mempool mode, any ScheduledProofCompleted triggers the single rebuild while the payload lacks the aggregated proof. That includes a statement from an earlier payload that is still running, or from a sibling improvement context. Such a rebuild runs before the statement covering the left-out wrapper transaction is proven, so it leaves the transaction out again and sets _second. The relevant completion then can't start another rebuild, so on a quiet pool getPayload still lacks the wrapper transaction, which is the case this commit is meant to fix. There's also a smaller cost: Mempool-mode payloads with no claims (DependencyProof null) do one extra full build on the first unrelated completion. Suggested fix: rebuild only when the first build actually left transactions out, and only once those are covered (for example by checking the depsHash it scheduled with TryGetProof). Alternatively, let a rebuild that still lacks the proof re-arm. A test with an unrelated proof completing before the gate opens would cover this. |
Checked and found sound
BranchProcessormerge: bothUnavailableExceptionandAggregatedProofNotReadyExceptionare still excluded from the warning, so neither layer's exclusion was lost.Eip8288Modulemerge: layer 2'sAggregatingBlockImprovementContextFactorydecorator and this layer's picker, production and gossip registrations are all kept. The addedNethermind.Consensus.Producersusing is needed forIBlockImprovementContextFactory.- AuRa: passing
IBlocksConfigto the AuRaTxPoolmakes its claim filter and gossip honourMempoolmode, as the default pool does. - Rest of
RebuildingContext(mode shared withBuilderOnly): the raw-witness_awaitedpath is unchanged._firstBuilt,_provenEarlyand_lacksAggregatedProofare read and written only under_lock. The rebuild still runs off the prover's thread. - New test
Production_Mempool_QuietPool_GetPayloadCarriesTheWrapperTransactionOnceProvencovers the intended path: build without the transaction, gate the proof, rebuild with it. MakingCoveredandProduceinternalis test-only.
Earlier items
All earlier Medium findings are fixed. The Lows you deferred while the relay is frozen are accepted as follow-ups: the mixed wrapper whose blob copy is declined, and gating Schedule on global verification room.
Mergeability
The one new Medium blocks the merge until it is fixed or you explain why it's acceptable.
| lock (_lock) | ||
| { | ||
| if (_awaitsAnyStatement && !_firstBuilt) _provenEarly = true; | ||
| awaited = _awaited == depsHash || (_awaitsAnyStatement && _lacksAggregatedProof); |
There was a problem hiding this comment.
Medium: in Mempool mode the one rebuild can be used up by an unrelated proof, and the payload then never gets the wrapper transaction.
With _awaitsAnyStatement, any ScheduledProofCompleted event triggers the rebuild while the payload lacks the aggregated proof. The same is true of _provenEarly, which is set by any event that arrives before the first build finishes. DependencyProofCache runs one statement at a time, so the event can easily belong to another statement:
- a statement scheduled by an earlier payload or slot that is still running (the PR's benchmark shows 2.4–4.3 s per aggregate proof), or
- a statement scheduled by a sibling improvement context of the same payload. The payload service starts a new
RebuildingContextwhenever transactions arrive.
Scenario: statement S0 is still running when payload P starts. P's first build leaves wrapper transaction W out (AggregatedProofNotReadyException), and its statement S1 waits as _pending. S0 completes, so OnProven sees _lacksAggregatedProof and starts the rebuild. W still isn't covered, so the rebuild leaves it out again and sets _second. When S1 completes, StartRebuild returns early because _second is not null. On the quiet pool this commit targets, getPayload returns a block without W.
There's a smaller cost as well. Every Mempool-mode payload whose block has no aggregated proof does one full extra build per payload on the first proof completion anywhere. That includes blocks with no claims at all, where DependencyProof is null and therefore also matches is not [Aggregated, ..]. The rebuild is adopted only if it's better, so this is CPU only.
Possible fixes:
- Before rebuilding, check that what the first build left out is now covered: record its excluded transactions, or the
depsHashit scheduled, and test it with_proofCache.TryGetProoforCovers. Rebuild only then. - Or let a rebuild re-arm when its result still lacks the aggregated proof.
Either way, rebuild only when the first build actually left transactions out, not whenever DependencyProof isn't aggregated. A test with an unrelated ScheduledProofCompleted that fires before the gate opens would catch this; the current test has no competing statement.
There was a problem hiding this comment.
Thanks, fixed in 8c302b5. A build that leaves wrapper transactions out now records the statement it scheduled for them (AggregatedTxProduction.LeftOut, keyed to the block). The decorator rebuilds only once that statement, or the raw-witness one, is proven. The excluded rebuild no longer schedules its own statement, so it cannot displace the pending one. The test now has an unrelated statement completing first, and that case fails with the earlier rule.
…ng what it left out
|
Claude finished @Marchhill's task in 1m 46s —— View job Re-review of PR #16469 after
|
| Earlier finding | Status |
|---|---|
Medium: any ScheduledProofCompleted triggers the Mempool rebuild |
Fixed. NotReady now records the scheduled depsHash in AggregatedTxProduction.LeftOut, keyed to (parent, timestamp). RebuildingContext waits only for that statement or for the raw-witness one. _awaitsAnyStatement, _provenEarly and _lacksAggregatedProof are gone, so payloads without claims no longer do an extra build on an unrelated completion. The excluded retry in BlockProducerBase no longer schedules its own statement (rebuild → !rebuild guard). That means it can't replace the pending left-out statement in the cache's single _pending slot. The test now has an unrelated statement finish first (anotherStatementProving) and asserts Builds == 1 before the gate opens. |
New finding
| Severity | Location | Issue |
|---|---|---|
| Low | AggregatingBlockImprovementContextFactory.cs:119 |
Nothing clears LeftOut. Once A's statement is proven and A has rebuilt, every later sibling context for the same payload still matches it. That includes the common case where only plain transactions arrived and the first build already carries the aggregated proof. Each such sibling then rebuilds straight away, which doubles block-building CPU for the rest of the slot. Adopt keeps the result correct. Suggested fix: take the left-out path only when the first block lacks the aggregated proof, or clear LeftOut once it has been used. |
Checked and found sound
AddScoped→AddSingletonforAggregatedTxProduction. The decorator factory is resolved at root, so a singleton is needed for it to share state with the processor and the picker. The state stays keyed to(parent, timestamp).LeftOutis a single reference write, so the improvement thread can read it without tearing.- Rebuild contents.
LeftOutis the canonical union of the aggregated and raw dependencies. When it is proven, the rebuild'sPlanfinds it cached and aggregates inline, even under the deadline.ExcludeAggregatedForwas already cleared by the excluded retry, so the picker includes the wrapper transaction again. NotReady(block, null)(whenPlanreturns null or the prover throws) records noLeftOut. No rebuild is armed in that case, which is right: there is nothing to wait for.- The raw
_awaitedpath is unchanged forBuilderOnly.rebuildcan only be true afterNotReady, which requiresmustAggregate, so only Mempool mode reaches it.
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
Scheduleisn't gated on room in the global verification window.- Edge case, efficiency only: if the left-out statement never runs, the payload is never rebuilt with the wrapper transaction. That happens when a later payload replaces it as the cache's single pending statement, or when the prover is busy (
LeanProverBusyException). The block stays valid with raw witnesses.
Mergeability
No Critical, High or Medium findings remain open. The new Low doesn't block the merge.
| /// witnesses, rebuilding at once if one is proven already.</summary> | ||
| private void OnFirstBuilt() | ||
| { | ||
| if (_leftOut() is { } leftOut) |
There was a problem hiding this comment.
Low (CPU only): a stale LeftOut makes every later improvement context of the same payload do an extra full build.
LeftOut is written in NotReady but never cleared, and it is keyed only to (parent, timestamp). After context A's statement S1 is proven and A rebuilds, LeftOut still points at S1. When transactions arrive, the payload service starts a sibling context B. Often B's new transactions are plain, so its deps union equals S1 and B's first build already carries the aggregated proof. B's OnFirstBuilt still matches the stale LeftOut, sees TryGetProof(S1) is true, and calls Rebuild() straight away. The same happens for every later sibling in the slot. Adopt keeps the result correct, but block-building work doubles for the rest of the slot on any payload that once left a wrapper transaction out.
A minimal fix is to take the left-out path only when the first block actually lacks the aggregated proof:
if (_leftOut() is { } leftOut
&& _first.Best.CurrentBestBlock?.DependencyProof is not [Eip8288Constants.DependencyProofVersionAggregated, ..])(Clearing LeftOut once a build of that block succeeds with the aggregated proof also works.) A test case with a second context started after the rebuild, asserting Builds doesn't grow, would cover it.
There was a problem hiding this comment.
Thanks, fixed in 2e6b164: the left-out path is taken only while the first build lacks the aggregated proof, so a later context whose build already carries it does not rebuild. Production_Mempool_LeftOutStatementAlreadyUsed_DoesNotRebuildAnAggregatedPayload covers it, and it fails without the check.
…the aggregated proof
|
Claude finished @Marchhill's task in 22s —— View job Re-review of PR #16469 after
|
| Earlier finding | Status |
|---|---|
Low: a stale LeftOut makes every later sibling context rebuild |
Fixed. OnFirstBuilt now takes the left-out path only while the first build's DependencyProof is not [Aggregated, ..]. A sibling whose build already carries the aggregated proof neither sets _awaitedLeftOut nor rebuilds. It also skips the raw-witness path, because that path needs [Raw, ..], so the sibling does no extra build at all. Production_Mempool_LeftOutStatementAlreadyUsed_DoesNotRebuildAnAggregatedPayload pre-seeds a proven LeftOut, checks that the precondition holds (the first block is aggregated), and asserts Builds == 1. |
Checked and found sound
- A sibling whose block still lacks the aggregated proof keeps the earlier behaviour. It rebuilds once if the recorded statement is proven, and otherwise waits for it. That is the case the rebuild exists for.
- A sibling with no claims (
DependencyProofnull) and a stale, provenLeftOut. In theory it could still rebuild. In practice it can't happen: the excluded retry has already clearedExcludeAggregatedFor, and the picker includes the covered wrapper transaction, so a later build for the same(parent, timestamp)would carry claims and be aggregated. Even if it did happen, it would cost one build of CPU and nothing else. - The new comment explains why the check is needed (sibling contexts share the record), so it isn't noise.
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
Scheduleisn't gated on room in the global verification window.- If the left-out statement never runs (it is replaced in the cache's single
_pendingslot, orLeanProverBusyExceptionis thrown), the payload keeps raw witnesses. The block is still valid; only efficiency is lost. - A dedicated STARK verification queue, once there are measurements.
Mergeability
No Critical, High or Medium findings remain open. As far as this review covers, the PR is mergeable.
|
Thanks for this. I ran
A few questions and suggestions:
Measurements (6 vCPU x86 box): mempool proofs took 0.15 s for 1 claim, 0.8–1.5 s for 40–45 claims, and up to 6.4 s when both nodes proved at once. A lone wrapper-covered tx that the builder holds only as a placeholder ships as |
|
Thanks for the devnet findings. Could you take another look? 8552373 adds pending blob-pool frame transactions to mempool aggregation, in the elided form, and logs wrapper admission and relay at Debug. 5536eb8 reuses the proof of a statement proven just before, so the builder and the mempool tick no longer prove the same set twice. @claude review |
|
Claude finished @Marchhill's task in 1m 20s —— View job Re-review of PR #16469 after
|
| Question | Status |
|---|---|
| 1. Blob-carrying claim transactions in mempool wrappers | Fixed. AggregationCandidates() now reads the blob pool's light records too. It keeps only uncovered frame transactions and loads each through TryGetPendingTransactionWithoutBlobs. That method returns BlobTransactionPayload.Elide(...), which removes Blobs, CellMask and Cells but keeps Commitments and the V1 cell Proofs, so the result passes Normalize → HasElidedSidecar. The claim witnesses survive too: the persistent pool's metadata cache stores the full transaction in elided form. The type and IsCovered checks run before the load, so a DB read only happens for frame transactions still waiting for coverage. The loop is lazy, so it stops at MaxProducedTransactions. The new test runs a blob-only wrapper from the producer to a receiver that holds it and records it for sampling. |
| 2. Proving the same set twice | Fixed. ProveDependencyProof returns the last proof when (depsHash, vk) repeat. This is safe: the proof attests to the statement (depsHash, AggregatedVk), not to how the input was split into direct, recursive and discarded parts, and verification is keyed on (depsHash, vk, proof). The check and the store both happen under _provingLock, and only a proof that verified is stored. It catches only back-to-back repeats, which is exactly the builder-then-tick case you saw. A set that differs (for example, the builder includes transactions that a held wrapper already covers) is still proven again, as it should be. |
| 3. Debug logging | Mostly fixed. Accept now logs each received wrapper with its counts and whether it was relayed, and Discard already logged discards. A wrapper this node builds still has no line of its own; see the Low below. |
New findings
| Severity | Location | Issue |
|---|---|---|
| Low | AggregatedDependencyProofTests.cs:408 |
The new test was inserted between the Signatures fold… XML doc and the test it describes. The new test now has two <summary> elements, and the folding test has none. |
| Low | ProofWrapperRelay.cs:305 (AddLocal) |
A locally built wrapper gets no Debug line with its hash, transaction count, or whether it was announced. That makes it hard to match against the receiver's Proof wrapper … from … line on a devnet. There's a suggestion inline. |
Smaller notes (no inline comment)
- Blob candidates come after every non-blob pending transaction. With more than 256 uncovered plain frame transactions, blob transactions wait one or more 6 s rounds. They are aggregated once the plain ones are covered, so this only delays them.
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
Scheduleisn't gated on room in the global verification window.- If the left-out statement never runs, the payload keeps raw witnesses.
- A dedicated STARK verification queue.
Mergeability
No Critical, High or Medium findings remain open. The two new Lows don't block the merge.
| /// <summary>Signatures fold in the fewest equal leaves within the native bound, and recursive inputs merge | ||
| /// <see cref="DependencyProofAggregator.FanIn"/> at a time in calls of their own.</summary> | ||
| /// <summary>The builder and the mempool aggregation proving the same pending set back to back run the prover once.</summary> |
There was a problem hiding this comment.
Low (doc): the new test landed between an existing test's XML doc and that test. The Signatures fold in the fewest equal leaves… summary was written for the [TestCase(1, 0, new[] { 1 }, 1)] test below. It now sits on ProveDependencyProof_SameStatementBackToBack_ReusesTheProof, so that test has two <summary> elements and the folding test has none. Moving the new test (with its own summary) above line 408 fixes it:
| /// <summary>Signatures fold in the fewest equal leaves within the native bound, and recursive inputs merge | |
| /// <see cref="DependencyProofAggregator.FanIn"/> at a time in calls of their own.</summary> | |
| /// <summary>The builder and the mempool aggregation proving the same pending set back to back run the prover once.</summary> | |
| /// <summary>The builder and the mempool aggregation proving the same pending set back to back run the prover once.</summary> |
After applying this, put the Signatures fold… summary back directly above [TestCase(1, 0, new[] { 1 }, 1)].
| internal void AddLocal(ProofWrapper wrapper) | ||
| { | ||
| _proofCache.Remember(wrapper.Deps, wrapper.DepsHash, wrapper.Proof); | ||
| if (Hold(wrapper)) AnnounceToAll(wrapper); | ||
| } |
There was a problem hiding this comment.
Low (observability): a wrapper this node builds still produces no Debug line. 8552373 logs received wrappers in Accept, and Discard already logs discards. The local path (StartAggregation → Aggregate → AddLocal) logs only the prover's EIP-8288 proof in … line. That line doesn't give the wrapper hash, how many transactions it holds, or whether it was announced. Your devnet note asked for a line when a wrapper is built, so a matching line here would let you trace a wrapper from its builder to the nodes that receive it:
| internal void AddLocal(ProofWrapper wrapper) | |
| { | |
| _proofCache.Remember(wrapper.Deps, wrapper.DepsHash, wrapper.Proof); | |
| if (Hold(wrapper)) AnnounceToAll(wrapper); | |
| } | |
| internal void AddLocal(ProofWrapper wrapper) | |
| { | |
| _proofCache.Remember(wrapper.Deps, wrapper.DepsHash, wrapper.Proof); | |
| bool held = Hold(wrapper); | |
| if (held) AnnounceToAll(wrapper); | |
| if (_logger.IsDebug) _logger.Debug($"Built proof wrapper {wrapper.Hash}: {wrapper.Transactions.Length} transactions, {wrapper.Length} bytes{(held ? ", announced" : ", not held")}"); | |
| } |
|
Thanks, both Lows are fixed. Could you take another look? @claude review |
|
Claude finished @Marchhill's task in 22s —— View job Re-review of PR #16469 after
|
| Earlier finding | Status |
|---|---|
Low (doc): the new test sat between the Signatures fold… summary and its test |
Fixed. ProveDependencyProof_SameStatementBackToBack_ReusesTheProof now has one <summary>. The fold summary is back directly above [TestCase(1, 0, new[] { 1 }, 1)]. |
| Low (observability): no Debug line when this node builds a wrapper | Fixed. AddLocal now logs the wrapper hash, how many transactions it holds, its length, and whether it was announced or not held (ProofWrapperRelay.cs:308-310). The log is behind IsDebug, so the hot path doesn't pay for the string. The behaviour is the same as before: it remembers the proof, holds the wrapper, and announces it only once held. |
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
Scheduleisn't gated on room in the global verification window.- If the left-out statement never runs, the payload keeps raw witnesses.
- A dedicated STARK verification queue, once there are measurements.
- Blob candidates are aggregated only after the non-blob pending transactions, which only delays them.
Mergeability
No Critical, High or Medium findings remain open. As far as this review covers, the PR is mergeable.
… until the global window has room
|
Claude finished @Marchhill's task in 57s —— View job Re-review of PR #16469 after
|
| Follow-up | Status |
|---|---|
| Blob candidates were aggregated only after every non-blob pending transaction | Done. AggregationCandidates() now gathers the uncovered frame transactions from both pools into one list and sorts it by tip, then by max fee. A blob-pool light record is still loaded from the DB only when the loop reaches it, so the lazy load is kept; only the light records are kept in memory, not the full transactions. The light records carry both fee fields (LightTransaction copies GasPrice and DecodedMaxFeePerGas), so the comparison is valid. Aggregate_BlobTransactionOutrankingTheOthers_IsCoveredInTheSameRound covers it. |
| A deferred fetch was downloaded again every window while the global window stayed spent | Done. Schedule now skips a fetch with DeferredAt != 0 while HasGlobalRoom is false, unless IsProven exempts it. Because HasGlobalRoom uses WithinGlobalCap with the announcer's own budget, an announcer that has proven itself can still use the reserved quarter, and the fetch keeps all its announcers. Tick reschedules it every 6 s, so it resumes once the window rolls. |
New findings
| Severity | Location | Issue |
|---|---|---|
| Low | ProofWrapperRelayTests.cs:663-666 |
Task.Delay(target - clock.Elapsed) throws ArgumentOutOfRangeException when the delay goes negative, for example when SpendGlobalBudget runs slowly on CI. The < 4 s precondition is also sensitive to timing. Clamp the delays to zero, or inject a time source. |
| Low | ProofWrapperRelay.cs:1084 |
The ranking ignores the base fee. A transaction with a large tip and MaxFeePerGas below the base fee can take a slot even though no block can include it yet. Ranking by effective tip, or reusing the pool's comparer, fixes this. It affects efficiency only. |
Smaller notes (no inline comment)
IsCoveredandIsProvenare now called twice per candidate or announcer: inAggregationCandidatesand again inAggregate, and in bothSchedulechecks. Both calls are cheap and bounded, so this isn't worth churning code for.List.Sortisn't stable, so transactions with equal fees are aggregated in no fixed order. This doesn't matter for correctness:chosenis re-sorted by hash before it is encoded.
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
- If the left-out statement never runs, the payload keeps raw witnesses.
- A dedicated STARK verification queue, once there are measurements.
Mergeability
No Critical, High or Medium findings remain open. Both new findings are Low and don't block the merge.
| await Task.Delay(TimeSpan.FromSeconds(2.1) - clock.Elapsed); | ||
| await SpendGlobalBudget(context, 1); | ||
| await Task.Delay(TimeSpan.FromSeconds(3.5) - clock.Elapsed); | ||
| Assert.That(clock.Elapsed, Is.LessThan(TimeSpan.FromSeconds(4)), "precondition: still within the second global window"); |
There was a problem hiding this comment.
Low (test flakiness): this test depends on wall-clock timing and can throw on a slow CI runner.
Task.Delay(TimeSpan.FromSeconds(2.1) - clock.Elapsed) throws ArgumentOutOfRangeException when the delay is negative and isn't exactly -1 ms. The delay goes negative whenever SpendGlobalBudget (240 announcements) takes longer than about 0.9 s. The 3.5 s delay has the same problem, and the < 4 s precondition is also sensitive to timing. At minimum, clamp both delays:
static TimeSpan Until(TimeSpan target, Stopwatch clock) => target > clock.Elapsed ? target - clock.Elapsed : TimeSpan.Zero;A cleaner fix is to drive both windows through an injectable time source instead of Stopwatch.GetTimestamp().
| } | ||
| } | ||
|
|
||
| candidates.Sort(static (left, right) => right.Tx.MaxPriorityFeePerGas.CompareTo(left.Tx.MaxPriorityFeePerGas) is var byTip and not 0 |
There was a problem hiding this comment.
Low: candidates are ranked by nominal tip, ignoring the base fee.
The ranking uses MaxPriorityFeePerGas, so a transaction with a large tip but MaxFeePerGas below the current base fee ranks first. It takes one of the 256 slots even though no block can include it right now. A payable transaction that would actually be built then waits for a later round. Ranking by effective tip, min(MaxPriorityFeePerGas, MaxFeePerGas - baseFee) against _blockTree.Head?.Header.BaseFeePerGas, would match how blocks pick transactions. Another option is to reuse the pool's comparer, as TxPoolTxSource does. This affects efficiency only, not correctness.
…eferral test's delays
|
Thanks, both Lows are fixed. Could you take another look? @claude review |
|
Claude finished @Marchhill's task in 27s —— View job Re-review of PR #16469 after
|
| Earlier finding | Status |
|---|---|
Low (test flakiness): negative Task.Delay and a timing-sensitive precondition in Verification_GlobalBudgetSpentAgain_KeepsTheDeferredFetchWaiting |
Fixed. Until(...) clamps both delays at zero, so Task.Delay can't throw. The < 4 s check is now Assume.That, so a slow runner reports the test as inconclusive rather than failing it. That's reasonable for a test that depends on wall-clock time. An injectable time source would still be cleaner, but it isn't needed. |
| Low: ranking ignored the base fee | Fixed. AggregationCandidates() now calls TryCalculatePremiumPerGas(baseFee, ...), the same helper TxPoolTxSource uses. Candidates are sorted by payable first, then effective tip, then max fee. A transaction whose fee cap is below the base fee gets Payable = false and a tip of 0, so it ranks after every payable one. The light blob records carry DecodedMaxFeePerGas/GasPrice, and frame transactions use Supports1559, so the calculation is valid for both pools. The DB load is still lazy: it only happens when the loop reaches the record. Aggregate_TransactionBelowTheBaseFee_RanksAfterThePayableOnes fills all 256 slots with payable transactions and checks that the unpayable one with a higher tip is left out. |
Checked and found sound
- Base fee source. The ranking uses the head's
BaseFeePerGas, not the next block's. The two differ by at most 12.5%, which only affects transactions right at the margin. That's fine for a ranking heuristic. Addas a local function inside the iterator. This is legal in an iterator, and all candidates are collected before the firstyield, so nothing changes in when the pool is read.- Test
Context.BlockTree. Exposing the substitute doesn't change other tests:Headstill returnsnullunless a test sets it.IsActivefalls back to block 0, as before.
Accepted earlier, still open as follow-ups
- A mixed wrapper loses its declined blob copy.
- If the left-out statement never runs, the payload keeps raw witnesses.
- A dedicated STARK verification queue, once there are measurements.
Mergeability
No Critical, High or Medium findings remain open. As far as this review covers, the PR is mergeable.
Layer 3 of 3, on #16463 (builder-only EIP-8288 and
eth/74), which is on #16461. It adds mempool aggregation andeth/76as specified in Marchhill/EIPs#29 (EIP-8518).Changes
Blocks.DependencyProofAggregation = Mempool, now a documented setting.BuilderOnlyis kept, described as a development option.Proof wrappers (
ProofWrapperCodec):[transactions, deps, recursive-stark], at most 2 MiB. Each transaction is EIP-8141's pooled encoding with its aggregatable witnesses emptied. The claim mapping isEip8288Dependencies.IsAggregatable/Map, anddepsmust be the exact canonical union. Wrapper problems are sorted into a transport fault (penalized), a cache miss (retried in full), or a dependency-rule failure (discarded, not penalized). A blob-carrying transaction is in EIP-8070's elided form: its commitments and cell proofs stay, they are checked against its versioned hashes, and they bind its encoding hash.eth/76oneth/74(0x18–0x1c):Eth76ProtocolHandlersubclassesEth74ProtocolHandler.ProofWrapperRelayhandles:The session checks the 6,723-byte announcement bound and the response cap before decompression. The capability resolver advertises
eth/76only when EIP-8288 is scheduled and the mode isMempool. Wrapper messages are ignored unless EIP-8288 is active at the current time.Mempool aggregation: on an interval, pending transactions that no held wrapper covers are aggregated into one wrapper and announced.
Blobs: once a wrapper verifies, its blob-carrying transactions go to the eth/72 sparse blobpool. That samples their cells by consensus hash, from cell announcements only (a wrapper announcement adds no provider), and submits them to the pool once the cells are available. eth/72 tracks cell announcements for a type-6 hash only while such an elided copy awaits them; other frame transactions still travel whole.
Pool: in
Mempoolmode, a transaction whose leanSPHINCS witnesses areAggregatedWitness(set only after a wrapper or block proof verifies) is admitted. It is never announced or served as a pooled transaction.Builder: proofs from received wrappers are kept in
DependencyProofCache. A covered transaction is picked only when held proofs cover it (AggregatedTxPicker). The block proof extends those proofs (Combinenow takes several parents). If that proof is not ready under a deadline, the build fails withAggregatedProofNotReadyException, andBlockProducerBaserebuilds once without such transactions.Reorgs: the relay keeps each imported block's aggregated proof. A transaction a reorg returns with placeholder witnesses therefore stays buildable, and the next aggregation round re-aggregates it into a wrapper from that proof (with discards). If no proof covers it, it waits for a peer's wrapper to cover it again.
Removed vs #14202
eth/75and the EIP-8437/8504 dependencies: EIP-8518 relays aggregates only, and individual transactions keep EIP-8141 pooled propagation.AGGREGATED_VKis fixed and the mempool fork changes no verification rule, so wrapper relay does not need it.eth_sendProofWrapper), IL proofs andTxPool.AggregateProofs: not part of EIP-8518, andMempoolmode replaces the flag.SparseBlobPoolPeerRegistry.Wrapped's separate store for wrapped blob transactions: the existing sparse-blobpool path takes them instead, gated on the aggregated witness, so no second store is needed.DependencyLimit, up to 8 fallbacks): replaced by one rebuild without the covered transactions. A later improvement build uses the proof once it is ready.Remarks
Tests: wrapper codec/validation (blob sidecars included), production with covered transactions (inline, deadline and rebuild, uncovered), the picker, the pool claim filter, prefix simulation, pooled-transaction serving and gossip, the relay (fetch, hints, invalid proof, retained-witness failure, cache miss, fallback announcer, equivalent coverage, serving, aggregation, reorg re-aggregation), the
eth/76handler and serializers (with the EIP-8518 announcement vector), and the capability resolver.eth/76conformance: Marchhill/go-ethereum#2 addsdevp2p rlpx eth76-test. Hive (local, arm64) passeseth7612/12 (including a blob-carrying wrapper) on the EIP-8288 chain, plus 11 skips on the standard chain. Ineth74,GetDependencyProofs*now fail withengine_getPayloadV6: -38005 Unsupported fork. That comes from layer 2's latest engine API commits (ae392cb0fa/bc29e25d4c): the image of the earlier layer 2 head still passes them. Could the eth74 suite move to the newer engine methods?Benchmark (
tools/eip8288-bench/run.sh,MempoolvsNone; 4 nodes, about 2 peers each, 40 ± 10 ms one-way, 2 claims transactions/s for 90 s; mean of 3 runs at 607985d). It ran on a 6 vCPU / 16 GB Linode, because the GCP workflow (#15884) rejects this branch at sign-in. The EIP-7870 "Attester" and "Full Node" profiles were scaled down to fit that box (CPU x 0.078, memory x 0.043). The absolute figures are therefore not EIP-7870 numbers; only the deltas between arms mean anything. Every run reached all 184 transactions on every node, with no exceptions.MempoolNoneMempoolNoneThe box's kernel has no
memory.peak, so these runs report memory at the end; the script now samples a peak instead. On #15884's runners,run.shcan run unscaled withCPU_SCALE=1 MEMORY_SCALE=1on a host with at least 16 threads and 64 GB per node, plus one CPU for the load generator.