feat(load-tests): generalize batch client for validity submissions - #4398
feat(load-tests): generalize batch client for validity submissions#4398refcell wants to merge 1 commit into
Conversation
🟡 Heimdall Review Status
|
| #[derive(Debug, Clone, PartialEq, Eq)] | ||
| pub struct BatchSendError { | ||
| /// JSON-RPC error code, when the failure came from a server error object. | ||
| pub code: Option<i64>, | ||
| /// Human-readable error message. | ||
| pub message: String, | ||
| } |
There was a problem hiding this comment.
nit: BatchSendError implements Display but not std::error::Error. Since it's a public error type (re-exported from lib.rs), it should implement the Error trait for interoperability with the broader error ecosystem (e.g., anyhow, eyre, ? propagation chains).
| #[derive(Debug, Clone, PartialEq, Eq)] | |
| pub struct BatchSendError { | |
| /// JSON-RPC error code, when the failure came from a server error object. | |
| pub code: Option<i64>, | |
| /// Human-readable error message. | |
| pub message: String, | |
| } | |
| #[derive(Debug, Clone, PartialEq, Eq)] | |
| pub struct BatchSendError { | |
| /// JSON-RPC error code, when the failure came from a server error object. | |
| pub code: Option<i64>, | |
| /// Human-readable error message. | |
| pub message: String, | |
| } | |
| impl std::error::Error for BatchSendError {} |
5c5942c to
816c404
Compare
Approved review 4930242586 from BrianBland is now dismissed due to new commit. Re-request for approval.
| submitted += Self::record_submitted(&ctx, signed, hash, measured).await; | ||
| } | ||
| BatchSendResult::Error(msg) => match Self::classify_batch_error(msg) { | ||
| BatchSendResult::Error(err) => match Self::classify_batch_error(err.message) { |
There was a problem hiding this comment.
nit: classify_batch_error(err.message) discards the structured code field. When validity submissions are routed through this path (future PRs in the stack), a method-not-found response (-32601) will be classified purely by string matching and land in BatchTxError::Rejected — a terminal rejection that won't be retried.
Consider passing the full BatchSendError into classify_batch_error (or at least checking err.is_method_not_found() before falling through to string classification) so the structured code is used when available. Not urgent for this PR since validity txs don't flow here yet, but worth keeping in mind for the next PR in the stack.
816c404 to
3d2f83b
Compare
Prepare the load tester to submit validity (conditional) transactions without changing current behavior. - Add base-execution-txpool dependency and reuse its canonical ValidityPredicate/ValidityOperator types (no local wire mirror). - Introduce SubmitItem and BatchRpcClient::send_transactions, which selects the JSON-RPC method per element: eth_sendRawTransaction for plain items and base_sendRawTransactionValidity for items carrying predicates. Mixed batches are supported; responses correlate by id. - Keep send_raw_only as a plain-only convenience wrapper; the existing submission path now routes through it (behavior unchanged). - Surface the JSON-RPC error code on batch errors via BatchSendError so method-not-found (-32601) is detectable by later routing work. - Extract pure build_batch_body/parse_batch_body helpers and cover them with unit tests. Part of BASE-163. Co-Authored-By: Claude <noreply@anthropic.com>
3d2f83b to
721ae04
Compare
Review SummaryThis PR cleanly generalizes the batch RPC client to support validity (conditional) transaction submissions. The refactoring from No new findings — the two existing inline comments (missing Not block-production-sensitive (load-test infrastructure only). |
Part of BASE-163 (validity/conditional load testing). Stack 1/5 — base: `main`.
Prepares the load tester to submit validity (conditional) transactions with no behavior change.
Tests: 7 new unit tests; `cargo test -p base-load-tests`, clippy, fmt all green.
🤖 Generated with Claude Code