Skip to content

Commit

Permalink
fix: various v0.3-rc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dancoombs committed Jun 28, 2024
1 parent b97292a commit 214e550
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 8 deletions.
6 changes: 4 additions & 2 deletions bin/rundler/chain_specs/base.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ l1_gas_oracle_contract_type = "OPTIMISM_BEDROCK"
l1_gas_oracle_contract_address = "0x420000000000000000000000000000000000000F"
include_l1_gas_in_gas_limit = false

priority_fee_oracle_type = "USAGE_BASED"
min_max_priority_fee_per_gas = "0x0186A0" # 100_000
max_transaction_size_bytes = 130000

priority_fee_oracle_type = "USAGE_BASED"
min_max_priority_fee_per_gas = "0x0F4240" # 1_000_000
congestion_trigger_usage_ratio_threshold = 0.25
3 changes: 3 additions & 0 deletions bin/rundler/chain_specs/base_sepolia.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ base = "base"

name = "Base Sepolia"
id = 84532

min_max_priority_fee_per_gas = "0x0186A0" # 100_000
congestion_trigger_usage_ratio_threshold = 0.55
1 change: 1 addition & 0 deletions crates/builder/src/sender/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ fn create_hard_cancel_tx(
.from(from)
.to(to)
.nonce(nonce)
.gas(U256::from(30_000))
.max_fee_per_gas(gas_fees.max_fee_per_gas)
.max_priority_fee_per_gas(gas_fees.max_priority_fee_per_gas)
.data(Bytes::new())
Expand Down
4 changes: 2 additions & 2 deletions crates/builder/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -407,11 +407,11 @@ where
} else {
info!("Using AWS KMS signer");
let signer = time::timeout(
// timeout must be << than the lock TTL to avoid a
// timeout must be < than the lock TTL to avoid a
// bug in the redis lock implementation that panics if connection
// takes longer than the TTL. Generally the TLL should be on the order of 10s of seconds
// so this should give ample time for the connection to establish.
Duration::from_millis(self.args.redis_lock_ttl_millis / 10),
Duration::from_millis(self.args.redis_lock_ttl_millis / 4),
KmsSigner::connect(
Arc::clone(&provider),
self.args.chain_spec.id,
Expand Down
13 changes: 11 additions & 2 deletions crates/pool/src/mempool/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,16 @@ impl PoolInner {
block_number: u64,
) -> Option<Arc<PoolOperation>> {
let tx_in_pool = self.by_id.get(&mined_op.id())?;
if let Some(time_to_mine) = self.time_to_mine.remove(&mined_op.hash) {
PoolMetrics::record_time_to_mine(&time_to_mine, mined_op.entry_point);

// TODO(danc): there is a bug here with replacements.
// UO1 is replaced by UO2, they both have the same ID.
// UO1 was bundled before UO2 replaced it, and eventually UO1 gets mined.
// UO2 should be removed from the pool, but since the hashes don't match, it will
// stay in the pool forever as `remove_operation_internal` is hash based.
// Time to mine will also fail because UO1's hash was removed from the pool.

if let Some(time_to_mine) = self.time_to_mine.get(&mined_op.hash) {
PoolMetrics::record_time_to_mine(time_to_mine, mined_op.entry_point);
} else {
warn!("Could not find time to mine for {:?}", mined_op.hash);
}
Expand Down Expand Up @@ -385,6 +393,7 @@ impl PoolInner {
self.by_hash.clear();
self.by_id.clear();
self.best.clear();
self.time_to_mine.clear();
self.mined_at_block_number_by_hash.clear();
self.mined_hashes_with_block_numbers.clear();
self.count_by_address.clear();
Expand Down
2 changes: 2 additions & 0 deletions crates/sim/src/gas/gas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ where
let config = UsageBasedFeeOracleConfig {
minimum_fee: chain_spec.min_max_priority_fee_per_gas,
maximum_fee: chain_spec.max_max_priority_fee_per_gas,
congestion_trigger_usage_ratio_threshold: chain_spec
.congestion_trigger_usage_ratio_threshold,
..Default::default()
};
Arc::new(UsageBasedFeeOracle::new(provider, config))
Expand Down
4 changes: 2 additions & 2 deletions crates/sim/src/simulation/simulator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ where
let needs_stake_entity = needs_stake.and_then(|t| entity_infos.get(t));
if let Some(needs_stake_entity) = needs_stake_entity {
if needs_stake_entity.is_staked {
tracing::info!("Associated storage accessed by staked entity during deploy, and entity is staked");
tracing::debug!("Associated storage accessed by staked entity during deploy, and entity is staked");
continue;
}
}
if let Some(factory) = entity_infos.get(EntityType::Factory) {
if factory.is_staked {
tracing::info!("Associated storage accessed by staked entity during deploy, and factory is staked");
tracing::debug!("Associated storage accessed by staked entity during deploy, and factory is staked");
continue;
}
}
Expand Down
5 changes: 5 additions & 0 deletions crates/types/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ pub struct ChainSpec {
pub min_max_priority_fee_per_gas: U256,
/// Maximum max priority fee per gas for the network
pub max_max_priority_fee_per_gas: U256,
/// Usage ratio of the chain that determines "congestion"
/// Some chains have artificially high block gas limits but
/// actually cap block gas usage at a lower value.
pub congestion_trigger_usage_ratio_threshold: f64,

/*
* Bundle building
Expand Down Expand Up @@ -139,6 +143,7 @@ impl Default for ChainSpec {
priority_fee_oracle_type: PriorityFeeOracleType::default(),
min_max_priority_fee_per_gas: U256::zero(),
max_max_priority_fee_per_gas: U256::MAX,
congestion_trigger_usage_ratio_threshold: 0.75,
max_transaction_size_bytes: 131072, // 128 KiB
bundle_max_send_interval_millis: u64::MAX,
flashbots_enabled: false,
Expand Down

0 comments on commit 214e550

Please sign in to comment.