mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-04-08 03:01:12 -04:00
feat(rpc): add flag to skip invalid transactions in testing_buildBlockV1 (#21094)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
@@ -640,6 +640,13 @@ pub struct RpcServerArgs {
|
||||
value_parser = parse_duration_from_secs_or_ms,
|
||||
)]
|
||||
pub rpc_send_raw_transaction_sync_timeout: Duration,
|
||||
|
||||
/// Skip invalid transactions in `testing_buildBlockV1` instead of failing.
|
||||
///
|
||||
/// When enabled, transactions that fail execution will be skipped, and all subsequent
|
||||
/// transactions from the same sender will also be skipped.
|
||||
#[arg(long = "testing.skip-invalid-transactions", default_value_t = false)]
|
||||
pub testing_skip_invalid_transactions: bool,
|
||||
}
|
||||
|
||||
impl RpcServerArgs {
|
||||
@@ -852,6 +859,7 @@ impl Default for RpcServerArgs {
|
||||
rpc_state_cache,
|
||||
gas_price_oracle,
|
||||
rpc_send_raw_transaction_sync_timeout,
|
||||
testing_skip_invalid_transactions: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1026,6 +1034,7 @@ mod tests {
|
||||
default_suggested_fee: None,
|
||||
},
|
||||
rpc_send_raw_transaction_sync_timeout: std::time::Duration::from_secs(30),
|
||||
testing_skip_invalid_transactions: true,
|
||||
};
|
||||
|
||||
let parsed_args = CommandParser::<RpcServerArgs>::parse_from([
|
||||
@@ -1114,6 +1123,7 @@ mod tests {
|
||||
"60",
|
||||
"--rpc.send-raw-transaction-sync-timeout",
|
||||
"30s",
|
||||
"--testing.skip-invalid-transactions",
|
||||
])
|
||||
.args;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user