eth: improve private tx purging and error reporting in relay#2198
eth: improve private tx purging and error reporting in relay#2198
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
There was a problem hiding this comment.
Pull request overview
This PR improves the relay’s handling of private transactions by adding bounded, deterministic cleanup behavior, and enhances observability by aggregating and periodically reporting block-producer RPC submission errors.
Changes:
- Add a txpool-aware + hard-TTL sweep mechanism to prevent unbounded growth of the private-tx hash store.
- Introduce a rejection/error aggregation tracker with periodic summary logging and new metrics for preconf/private submission failures.
- Wire the txpool presence checker from the ETH backend into the relay’s private-tx store.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
eth/relay/relay.go |
Exposes SetTxPoolChecker on RelayService; expands documentation around private-tx purge behavior. |
eth/relay/rejection_tracker.go |
Adds in-memory aggregation + formatting for grouped RPC error reporting. |
eth/relay/private_tx_store.go |
Implements sweep-based eviction (grace-period txpool check + 10m hard TTL) and adds an “expired” metric. |
eth/relay/private_tx_store_test.go |
Adds unit tests for TTL sweep, txpool-aware sweep, and checker setter behavior. |
eth/relay/multiclient.go |
Records per-submission errors into the tracker, adds new meters, runs periodic summary reporter, improves close idempotence. |
eth/relay/multiclient_test.go |
Adds unit + integration tests for tracker behavior, formatting, and wiring through submit paths. |
eth/backend.go |
Wires eth.txPool.Has into the relay private-tx store for txpool-aware cleanup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
|
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (88.61%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #2198 +/- ##
===========================================
+ Coverage 52.24% 52.29% +0.05%
===========================================
Files 884 885 +1
Lines 155551 155667 +116
===========================================
+ Hits 81262 81413 +151
+ Misses 69055 69019 -36
- Partials 5234 5235 +1
... and 19 files with indirect coverage changes
🚀 New features to boost your workflow:
|



Description
This PR does 2 main things
Private tx purging changes
Error reporting improvements
Changes
Breaking changes
Please complete this section if any breaking changes have been made, otherwise delete it
Nodes audience
In case this PR includes changes that must be applied only to a subset of nodes, please specify how you handled it (e.g. by adding a flag with a default value...)
Checklist
Cross repository changes
Testing
Manual tests
Please complete this section with the steps you performed if you ran manual tests for this functionality, otherwise delete it
Additional comments
Please post additional comments in this section if you have them, otherwise delete it