Fix the Fallback Gas Limiter (#217)

* Add code to disable the fallback gas filler

* Allow benchmarks driver to await tx receipts

* Improve the transaction submission logic

* Update Python Script to process Geth benchmarks
This commit is contained in:
Omar
2025-12-04 16:19:48 +03:00
committed by GitHub
parent 3edaebdcae
commit 78ac7ee381
11 changed files with 269 additions and 85 deletions
+6 -2
View File
@@ -76,6 +76,7 @@ pub struct GethNode {
wallet: Arc<EthereumWallet>,
nonce_manager: CachedNonceManager,
provider: OnceCell<ConcreteProvider<Ethereum, Arc<EthereumWallet>>>,
use_fallback_gas_filler: bool,
}
impl GethNode {
@@ -100,6 +101,7 @@ impl GethNode {
+ AsRef<WalletConfiguration>
+ AsRef<GethConfiguration>
+ Clone,
use_fallback_gas_filler: bool,
) -> Self {
let working_directory_configuration =
AsRef::<WorkingDirectoryConfiguration>::as_ref(&context);
@@ -126,6 +128,7 @@ impl GethNode {
wallet: wallet.clone(),
nonce_manager: Default::default(),
provider: Default::default(),
use_fallback_gas_filler,
}
}
@@ -246,7 +249,8 @@ impl GethNode {
.get_or_try_init(|| async move {
construct_concurrency_limited_provider::<Ethereum, _>(
self.connection_string.as_str(),
FallbackGasFiller::default(),
FallbackGasFiller::default()
.with_use_fallback_gas_filler(self.use_fallback_gas_filler),
ChainIdFiller::new(Some(CHAIN_ID)),
NonceFiller::new(self.nonce_manager.clone()),
self.wallet.clone(),
@@ -742,7 +746,7 @@ mod tests {
fn new_node() -> (TestExecutionContext, GethNode) {
let context = test_config();
let mut node = GethNode::new(&context);
let mut node = GethNode::new(&context, true);
node.init(context.genesis_configuration.genesis().unwrap().clone())
.expect("Failed to initialize the node")
.spawn_process()
@@ -106,6 +106,8 @@ pub struct LighthouseGethNode {
persistent_http_provider: OnceCell<ConcreteProvider<Ethereum, Arc<EthereumWallet>>>,
persistent_ws_provider: OnceCell<ConcreteProvider<Ethereum, Arc<EthereumWallet>>>,
use_fallback_gas_filler: bool,
}
impl LighthouseGethNode {
@@ -127,6 +129,7 @@ impl LighthouseGethNode {
+ AsRef<WalletConfiguration>
+ AsRef<KurtosisConfiguration>
+ Clone,
use_fallback_gas_filler: bool,
) -> Self {
let working_directory_configuration =
AsRef::<WorkingDirectoryConfiguration>::as_ref(&context);
@@ -176,6 +179,7 @@ impl LighthouseGethNode {
nonce_manager: Default::default(),
persistent_http_provider: OnceCell::const_new(),
persistent_ws_provider: OnceCell::const_new(),
use_fallback_gas_filler,
}
}
@@ -374,7 +378,8 @@ impl LighthouseGethNode {
.get_or_try_init(|| async move {
construct_concurrency_limited_provider::<Ethereum, _>(
self.ws_connection_string.as_str(),
FallbackGasFiller::default(),
FallbackGasFiller::default()
.with_use_fallback_gas_filler(self.use_fallback_gas_filler),
ChainIdFiller::new(Some(CHAIN_ID)),
NonceFiller::new(self.nonce_manager.clone()),
self.wallet.clone(),
@@ -1152,7 +1157,7 @@ mod tests {
let _guard = NODE_START_MUTEX.lock().unwrap();
let context = test_config();
let mut node = LighthouseGethNode::new(&context);
let mut node = LighthouseGethNode::new(&context, true);
node.init(context.genesis_configuration.genesis().unwrap().clone())
.expect("Failed to initialize the node")
.spawn_process()
@@ -79,6 +79,7 @@ pub struct SubstrateNode {
nonce_manager: CachedNonceManager,
provider: OnceCell<ConcreteProvider<Ethereum, Arc<EthereumWallet>>>,
consensus: Option<String>,
use_fallback_gas_filler: bool,
}
impl SubstrateNode {
@@ -105,6 +106,7 @@ impl SubstrateNode {
+ AsRef<EthRpcConfiguration>
+ AsRef<WalletConfiguration>,
existing_connection_strings: &[String],
use_fallback_gas_filler: bool,
) -> Self {
let working_directory_path =
AsRef::<WorkingDirectoryConfiguration>::as_ref(&context).as_path();
@@ -137,6 +139,7 @@ impl SubstrateNode {
nonce_manager: Default::default(),
provider: Default::default(),
consensus,
use_fallback_gas_filler,
}
}
@@ -324,7 +327,12 @@ impl SubstrateNode {
.get_or_try_init(|| async move {
construct_concurrency_limited_provider::<Ethereum, _>(
self.rpc_url.as_str(),
FallbackGasFiller::new(u64::MAX, 50_000_000_000, 1_000_000_000),
FallbackGasFiller::new(
u64::MAX,
50_000_000_000,
1_000_000_000,
self.use_fallback_gas_filler,
),
ChainIdFiller::new(Some(CHAIN_ID)),
NonceFiller::new(self.nonce_manager.clone()),
self.wallet.clone(),
@@ -825,6 +833,7 @@ mod tests {
None,
&context,
&[],
true,
);
node.init(context.genesis_configuration.genesis().unwrap().clone())
.expect("Failed to initialize the node")
@@ -896,6 +905,7 @@ mod tests {
None,
&context,
&[],
true,
);
// Call `init()`
@@ -114,6 +114,8 @@ pub struct ZombienetNode {
nonce_manager: CachedNonceManager,
provider: OnceCell<ConcreteProvider<Ethereum, Arc<EthereumWallet>>>,
use_fallback_gas_filler: bool,
}
impl ZombienetNode {
@@ -137,6 +139,7 @@ impl ZombienetNode {
context: impl AsRef<WorkingDirectoryConfiguration>
+ AsRef<EthRpcConfiguration>
+ AsRef<WalletConfiguration>,
use_fallback_gas_filler: bool,
) -> Self {
let eth_proxy_binary = AsRef::<EthRpcConfiguration>::as_ref(&context)
.path
@@ -164,6 +167,7 @@ impl ZombienetNode {
connection_string: String::new(),
node_rpc_port: None,
provider: Default::default(),
use_fallback_gas_filler,
}
}
@@ -330,7 +334,12 @@ impl ZombienetNode {
.get_or_try_init(|| async move {
construct_concurrency_limited_provider::<Ethereum, _>(
self.connection_string.as_str(),
FallbackGasFiller::new(u64::MAX, 5_000_000_000, 1_000_000_000),
FallbackGasFiller::new(
u64::MAX,
5_000_000_000,
1_000_000_000,
self.use_fallback_gas_filler,
),
ChainIdFiller::default(), // TODO: use CHAIN_ID constant
NonceFiller::new(self.nonce_manager.clone()),
self.wallet.clone(),
@@ -823,6 +832,7 @@ mod tests {
let mut node = ZombienetNode::new(
context.polkadot_parachain_configuration.path.clone(),
&context,
true,
);
let genesis = context.genesis_configuration.genesis().unwrap().clone();
node.init(genesis).unwrap();
@@ -936,6 +946,7 @@ mod tests {
let node = ZombienetNode::new(
context.polkadot_parachain_configuration.path.clone(),
&context,
true,
);
// Act
@@ -956,6 +967,7 @@ mod tests {
let node = ZombienetNode::new(
context.polkadot_parachain_configuration.path.clone(),
&context,
true,
);
// Act