Skip to content

Commit d96bd65

Browse files
authored
Merge pull request #95 from weaveVM/improve-gasenomic
feat: improve gasenomic
2 parents 9b1d68c + 49fd1fa commit d96bd65

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

book/run/config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ max_blocks = 500000
125125
# The maximum number of state changes to keep in memory before the execution stage commits.
126126
max_changes = 5000000
127127
# The maximum cumulative amount of gas to process before the execution stage commits.
128-
max_cumulative_gas = 15000000000000 # WVM: 300_000_000 * 50_000_000
128+
max_cumulative_gas = 25000000000000 # WVM: 500_000_000 * 50_000_000
129129
# The maximum time spent on blocks processing before the execution stage commits.
130130
max_duration = '10m'
131131
```

crates/chainspec/src/constants.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use crate::spec::DepositContract;
22
use alloy_primitives::{address, b256};
33

44
/// Gas per transaction not creating a contract.
5-
/// WVM: Raised from 21k to 500_000k
6-
pub const MIN_TRANSACTION_GAS: u64 = 500_000u64;
5+
/// WVM: Raised from 21k to 500_000_000
6+
pub const MIN_TRANSACTION_GAS: u64 = 500_000_000u64;
77
/// Deposit contract address: `0x00000000219ab540356cbb839cbe05303d7705fa`
88
pub(crate) const MAINNET_DEPOSIT_CONTRACT: DepositContract = DepositContract::new(
99
address!("00000000219ab540356cbb839cbe05303d7705fa"),

crates/ethereum/evm/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl ConfigureEvmEnv for EthEvmConfig {
7474
transact_to: TxKind::Call(contract),
7575
// Explicitly set nonce to None so revm does not do any nonce checks
7676
nonce: None,
77-
// WVM: 300_000_000 gas limit
77+
// WVM: 500_000_000 gas limit
7878
gas_limit: *ETHEREUM_BLOCK_GAS_LIMIT,
7979
value: U256::ZERO,
8080
data,

crates/primitives-traits/src/constants/mod.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,8 @@ pub const BEACON_NONCE: u64 = 0u64;
4747
/// See <https://github.com/paradigmxyz/reth/issues/3233>.
4848
/// WVM: we set 300kk gas limit
4949
pub const ETHEREUM_BLOCK_GAS_LIMIT: LazyCell<u64> = LazyCell::new(|| {
50-
let env_gas_limit = std::env::var("ETHEREUM_BLOCK_GAS_LIMIT");
51-
if let Ok(gas_limit) = env_gas_limit {
52-
gas_limit.as_str().parse::<u64>().unwrap()
53-
} else {
54-
300_000_000
55-
}
56-
}); // WVM: 300_000_000 gas limit
50+
500_000_000
51+
}); // WVM: 500_000_000 gas limit
5752

5853
/// The minimum tx fee below which the txpool will reject the transaction.
5954
///
@@ -66,14 +61,19 @@ pub const ETHEREUM_BLOCK_GAS_LIMIT: LazyCell<u64> = LazyCell::new(|| {
6661
/// significant harm in leaving this setting as is.
6762
// pub const MIN_PROTOCOL_BASE_FEE: u64 = 7;
6863

69-
pub static MIN_PROTOCOL_BASE_FEE: LazyLock<AtomicU64> = LazyLock::new(|| AtomicU64::new(7));
64+
// WVM: min base fee 7 => 500k
65+
pub static MIN_PROTOCOL_BASE_FEE: LazyLock<AtomicU64> = LazyLock::new(|| AtomicU64::new(500_000u64));
7066

7167
pub(crate) static WVM_FEE_MANAGER: LazyLock<Arc<WvmFeeManager>> = LazyLock::new(|| {
7268
let fee = WvmFee::new(Some(Box::new(move |price| {
7369
let original_price = price as f64 / 1_000_000_000f64;
7470
let lowest_possible_gas_price_in_gwei =
7571
raw_calculate_lowest_possible_gas_price(original_price, *ETHEREUM_BLOCK_GAS_LIMIT);
76-
let to_wei = lowest_possible_gas_price_in_gwei * 1e9;
72+
let mut to_wei = lowest_possible_gas_price_in_gwei * 1e9;
73+
// WVM: minimum fee check
74+
if to_wei < 500_000f64 {
75+
to_wei = 500_000f64;
76+
}
7777
MIN_PROTOCOL_BASE_FEE.store(to_wei as u64, SeqCst);
7878
Ok(())
7979
})));

0 commit comments

Comments
 (0)