Skip to content

Commit f02862c

Browse files
Manav-Aggarwalgemini-code-assist[bot]tac0turtle
authored
fix: remove unused config (#32)
* Ignore empty payload * remove max transactions * Apply suggestion from @gemini-code-assist[bot] Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * make debug log * fmt * clippy --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Co-authored-by: tac0turtle <[email protected]>
1 parent 6ae182f commit f02862c

File tree

3 files changed

+11
-49
lines changed

3 files changed

+11
-49
lines changed

bin/ev-reth/src/builder.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,7 @@ pub struct RollkitPayloadBuilderBuilder {
4747
impl RollkitPayloadBuilderBuilder {
4848
/// Create a new builder with rollkit args
4949
pub fn new(_args: &RollkitArgs) -> Self {
50-
let config = RollkitPayloadBuilderConfig {
51-
max_transactions: 1000,
52-
min_gas_price: 1_000_000_000, // 1 Gwei
53-
};
50+
let config = RollkitPayloadBuilderConfig::new();
5451
info!("Created Rollkit payload builder with config: {:?}", config);
5552
Self { config }
5653
}
@@ -132,7 +129,7 @@ where
132129
cached_reads: _,
133130
config,
134131
cancel: _,
135-
best_payload,
132+
best_payload: _,
136133
} = args;
137134
let PayloadConfig {
138135
parent_header,
@@ -177,15 +174,6 @@ where
177174
None, // No blob sidecar for rollkit
178175
);
179176

180-
if let Some(best) = best_payload {
181-
if built_payload.fees() <= best.fees() {
182-
return Ok(BuildOutcome::Aborted {
183-
fees: built_payload.fees(),
184-
cached_reads: CachedReads::default(),
185-
});
186-
}
187-
}
188-
189177
Ok(BuildOutcome::Better {
190178
payload: built_payload,
191179
cached_reads: CachedReads::default(),

crates/evolve/src/rpc/txpool.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use alloy_primitives::Bytes;
22
use async_trait::async_trait;
3+
use jsonrpsee::tracing::debug;
34
use jsonrpsee_core::RpcResult;
45
use jsonrpsee_proc_macros::rpc;
56
use reth_transaction_pool::{PoolTransaction, TransactionPool};
@@ -70,6 +71,7 @@ where
7071
total += sz;
7172
}
7273

74+
debug!("get_txs returning {} transactions", selected_txs.len());
7375
Ok(selected_txs)
7476
}
7577
}

crates/node/src/config.rs

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,25 @@
11
use serde::{Deserialize, Serialize};
22

33
/// Configuration for the Rollkit payload builder
4-
#[derive(Debug, Clone, Serialize, Deserialize)]
5-
pub struct RollkitPayloadBuilderConfig {
6-
/// Maximum number of transactions to include in a payload
7-
pub max_transactions: usize,
8-
/// Minimum gas price for transactions
9-
pub min_gas_price: u64,
10-
}
11-
12-
impl Default for RollkitPayloadBuilderConfig {
13-
fn default() -> Self {
14-
Self {
15-
max_transactions: 1000,
16-
min_gas_price: 1_000_000_000, // 1 Gwei
17-
}
18-
}
19-
}
4+
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5+
pub struct RollkitPayloadBuilderConfig {}
206

217
impl RollkitPayloadBuilderConfig {
228
/// Creates a new instance of `RollkitPayloadBuilderConfig`
23-
pub const fn new(max_transactions: usize, min_gas_price: u64) -> Self {
24-
Self {
25-
max_transactions,
26-
min_gas_price,
27-
}
9+
pub const fn new() -> Self {
10+
Self {}
2811
}
2912

3013
/// Validates the configuration
3114
pub const fn validate(&self) -> Result<(), ConfigError> {
32-
if self.max_transactions == 0 {
33-
return Err(ConfigError::InvalidMaxTransactions);
34-
}
35-
36-
if self.min_gas_price == 0 {
37-
return Err(ConfigError::InvalidMinGasPrice);
38-
}
39-
4015
Ok(())
4116
}
4217
}
4318

4419
/// Errors that can occur during configuration validation
4520
#[derive(Debug, thiserror::Error)]
4621
pub enum ConfigError {
47-
#[error("Invalid max transactions value")]
48-
/// Invalid maximum transactions value.
49-
InvalidMaxTransactions,
50-
#[error("Invalid min gas price value")]
51-
/// Invalid minimum gas price value.
52-
InvalidMinGasPrice,
22+
/// Invalid configuration provided
23+
#[error("Invalid config")]
24+
InvalidConfig,
5325
}

0 commit comments

Comments
 (0)