Skip to content

Commit 5029777

Browse files
fix(rpc): restore backward compatibility for taikoAuth_txPoolContent params (regression from eb30aeb) (#119)
* Rolled back to the previous positional-argument implementation for the tx-pool RPC methods * Rolled back to the previous positional-argument implementation for the tx-pool RPC methods
1 parent eb30aeb commit 5029777

File tree

2 files changed

+38
-15
lines changed

2 files changed

+38
-15
lines changed

AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
- Rust defaults: 4-space indentation, `snake_case` items, `CamelCase` types/traits, `SCREAMING_SNAKE_CASE` constants.
1818
- Prefer module-per-file; public APIs go through `crates/node/src/lib.rs`.
1919
- Run `just fmt` before committing; clippy must be clean (`just clippy`).
20-
- Never add `#[allow(clippy::too_many_arguments)]` (including crate/module-level forms). When a function exceeds argument limits, introduce a named params struct and update call sites to pass that struct.
2120

2221
## Documentation Policy (Mandatory)
2322

crates/rpc/src/eth/auth.rs

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(clippy::too_many_arguments)]
2+
13
use std::sync::Arc;
24

35
use alloy_consensus::{BlockHeader as _, Transaction as _};
@@ -153,14 +155,25 @@ pub trait TaikoAuthExtApi<T: RpcObject> {
153155
#[method(name = "txPoolContentWithMinTip")]
154156
async fn tx_pool_content_with_min_tip(
155157
&self,
156-
params: TxPoolContentWithMinTipParams,
158+
beneficiary: Address,
159+
base_fee: u64,
160+
block_max_gas_limit: u64,
161+
max_bytes_per_tx_list: u64,
162+
locals: Option<Vec<Address>>,
163+
max_transactions_lists: u64,
164+
min_tip: u64,
157165
) -> RpcResult<Vec<PreBuiltTxList<T>>>;
158166

159167
/// Returns candidate transaction lists without enforcing a tip threshold.
160168
#[method(name = "txPoolContent")]
161169
async fn tx_pool_content(
162170
&self,
163-
params: TxPoolContentParams,
171+
beneficiary: Address,
172+
base_fee: u64,
173+
block_max_gas_limit: u64,
174+
max_bytes_per_tx_list: u64,
175+
locals: Option<Vec<Address>>,
176+
max_transactions_lists: u64,
164177
) -> RpcResult<Vec<PreBuiltTxList<T>>>;
165178
}
166179

@@ -469,25 +482,36 @@ where
469482
/// Retrieves the transaction pool content with the given limits.
470483
async fn tx_pool_content(
471484
&self,
472-
params: TxPoolContentParams,
473-
) -> RpcResult<Vec<PreBuiltTxList<RpcTransaction<Eth::Network>>>> {
474-
self.tx_pool_content_with_min_tip(params.into()).await
475-
}
476-
477-
/// Retrieves the transaction pool content with the given limits and minimum tip.
478-
async fn tx_pool_content_with_min_tip(
479-
&self,
480-
params: TxPoolContentWithMinTipParams,
485+
beneficiary: Address,
486+
base_fee: u64,
487+
block_max_gas_limit: u64,
488+
max_bytes_per_tx_list: u64,
489+
locals: Option<Vec<Address>>,
490+
max_transactions_lists: u64,
481491
) -> RpcResult<Vec<PreBuiltTxList<RpcTransaction<Eth::Network>>>> {
482-
let TxPoolContentWithMinTipParams {
492+
self.tx_pool_content_with_min_tip(
483493
beneficiary,
484494
base_fee,
485495
block_max_gas_limit,
486496
max_bytes_per_tx_list,
487497
locals,
488498
max_transactions_lists,
489-
min_tip,
490-
} = params;
499+
0,
500+
)
501+
.await
502+
}
503+
504+
/// Retrieves the transaction pool content with the given limits and minimum tip.
505+
async fn tx_pool_content_with_min_tip(
506+
&self,
507+
beneficiary: Address,
508+
base_fee: u64,
509+
block_max_gas_limit: u64,
510+
max_bytes_per_tx_list: u64,
511+
locals: Option<Vec<Address>>,
512+
max_transactions_lists: u64,
513+
min_tip: u64,
514+
) -> RpcResult<Vec<PreBuiltTxList<RpcTransaction<Eth::Network>>>> {
491515
if max_transactions_lists == 0 {
492516
return Err(EthApiError::InvalidParams(
493517
"`maxTransactionsLists` must not be `0`".to_string(),

0 commit comments

Comments
 (0)