Repository navigation
refactor(tx-forwarding): stop journaling TXPOOL_BUILDER_FORWARD_FAILURE - #6519
Conversation
✅ Heimdall Review Status
|
| ) { | ||
| data.entry("target".to_string()).or_insert_with(|| json!("builder_forwarder")); | ||
| data.entry("rpc_method".to_string()).or_insert_with(|| json!(rpc_method)); | ||
| data.entry("builder".to_string()).or_insert_with(|| json!(self.url_label.as_ref())); |
There was a problem hiding this comment.
url_label is the full builder_url.to_string(), so any userinfo or API-key query parameter in a configured builder URL now goes into every forwarder transaction event, a store that is wider and longer-lived than the metrics label. Consider journaling a redacted form (scheme://host:port) instead.
There was a problem hiding this comment.
Good catch. data.builder is now the URL origin (scheme://host[:port], via Url::origin().ascii_serialization()), so userinfo, path and query never reach the event store (8397df9). The metrics label is unchanged.
There was a problem hiding this comment.
Moot after the rework (34c165f): the PR now retires TXPOOL_BUILDER_FORWARD_FAILURE outright, so neither the builder data field nor the rejection classifier exists anymore.
| impl RejectionClass { | ||
| /// Classifies a builder insert rejection by its message. | ||
| pub fn classify(message: &str) -> Self { | ||
| if message.contains("already imported") { |
There was a problem hiding this comment.
This adds a second hard-coded "already imported" match next to base_execution_txpool::is_already_imported_rejection, which task.rs already uses to decide whether to resend. If the txpool constant (whose test pins it to reth's Display) ever changes, the class label will silently disagree with resend behaviour. Reuse the txpool helper or a shared constant instead.
There was a problem hiding this comment.
Agreed. RejectionClass::classify now takes the ErrorObjectOwned and defers the already-imported case to base_execution_txpool::is_already_imported_rejection, the same check that drives the resend decision, so the two cannot drift (8397df9).
There was a problem hiding this comment.
Moot after the rework (34c165f): the PR now retires TXPOOL_BUILDER_FORWARD_FAILURE outright, so neither the builder data field nor the rejection classifier exists anymore.
A mempool node forwards every transaction to every configured builder, and each builder that rejected it made the node journal a forward failure. The receiving builder already journals the same rejection as TXPOOL_VALIDATED_INSERT_REJECTED while it is the active sequencer, so the node-side row either duplicated the leader's verdict or recorded a standby or canary verdict that never decides inclusion. On mainnet (2026-11-08 09:00 UTC) these were 20.2M rows/hour, 17.6% of all transaction events, 88% of them from the two canary sequencers. Drop the emit and retire the event type; historical rows stay readable. Forwarding, failure reports to the reader, and the per-builder rejection metric are unchanged. TXPOOL_BUILDER_FORWARD_ATTEMPT and _DROPPED stay, since a send that never reaches a builder has no builder-side record. CHAIN-6721
addc44f to
34c165f
Compare
| // the leader's and add standby and canary verdicts that never decide | ||
| // inclusion; the rejection metric below covers them in aggregate. | ||
| Ok(()) => ok_count += 1, | ||
| Err(e) => { |
There was a problem hiding this comment.
The builder only journals TXPOOL_VALIDATED_INSERT_REJECTED from finish_insert (rejection_stage = "pool_insert"). Rejections from prepare_insert never emit an event: extensions disabled, extension validation, decode failure, and validity_signature_mode checks (txpool/src/builder/rpc.rs). They come back here as per-item Errs that were previously journaled as TXPOOL_BUILDER_FORWARD_FAILURE and now have no journal record on either side. A builder-wide policy rejection, such as a validity-signature rollout mismatch, also drops every affected tx before the leader's pool sees it. Either have the builder journal pre-pool rejections, or keep the node-side event for non-pool rejected transaction errors. Then update the README/doc claim that the builder records every send that reaches it.
There was a problem hiding this comment.
Correct that pre-pool rejections (disabled/invalid extensions, undecodable tx, validity-signature policy) have no builder-side journal record after this change. In the 2026-11-08 09:00 mainnet sample every one of the 20.2M failure rows was a pool rejection, so the gap is ~0 rows today, and those failures are visible in the builder's extension_errors / decode_errors metrics and the forwarder's rejected counter. Keeping the node-side event only for non-pool rejections is a small follow-up if we want the journal to cover a builder policy mismatch; leaving this PR as the plain retirement.
|
One finding. The PR assumes every per-item rejection a forwarded send gets back is also journaled by the builder as |
Summary
Part of CHAIN-6721 (cut transaction event volume so the Snowflake pipeline fits in an hour).
Problem. Each mainnet mempool node forwards every transaction to all 7 builders in
--builder-rpc-urls: the 5 production HA sequencers plus 2 canary sequencers that never build canonical blocks. Every builder that rejected a transaction made the node journal aTXPOOL_BUILDER_FORWARD_FAILURErow. On 2026-11-08 09:00 UTC that was 20.2M rows/hour, 17.6% of all mainnet transaction events, and 88% of them were canary rejections (destinations recovered from the event-ID hash).The receiving builder already journals the same rejection as
TXPOOL_VALIDATED_INSERT_REJECTED, with the reason, and only while it is the active sequencer. So every node-side failure row was one of: a duplicate of the leader's own verdict, a standby's verdict, or a canary's verdict. The last two never decide inclusion.Fix. Stop emitting
TXPOOL_BUILDER_FORWARD_FAILUREand retire the event type (the enum variant stays so historical rows parse, likeTXPOOL_BUILDER_CONSUMED). Pool rejections are recorded once, by the leader.Unchanged. Forwarding, retries, failure reports to the reader (resends), and the per-builder rejection metric
txpool_forwarder_num_tx_rejected_in_batch.TXPOOL_BUILDER_FORWARD_ATTEMPTandTXPOOL_BUILDER_FORWARD_DROPPEDstay: a send that never reaches a builder has no builder-side record.Effect. −20.2M rows/hour (−17.6% of all mainnet transaction events) at peak. No new flags or deployment config.
Trade-off. Until sequencer transaction events are re-enabled (the goal of CHAIN-6721, for which this is a prerequisite), builder pool rejections appear only in metrics, not in the journal.
Testing
cargo +nightly fmt,cargo clippy -p base-tx-forwarding -p base-observability-events --all-targets -- -D warnings,cargo test -p base-tx-forwarding -p base-observability-events,etc/scripts/ci/check-crate-deps.sh. The devnet integration testbuilder_rejection_is_journaled_by_both_sidesnow asserts a rejected transaction's journal is exactlyTXPOOL_SEND_RAW_TRANSACTION,TXPOOL_PENDING,TXPOOL_VALIDATED_INSERT_REJECTED, so re-adding the emit fails it.type=routine
risk=low
impact=sev5