Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
282 changes: 133 additions & 149 deletions Cargo.lock

Large diffs are not rendered by default.

156 changes: 78 additions & 78 deletions Cargo.toml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bin/tempo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ reth-prune-types.workspace = true
reth-rpc-server-types.workspace = true
secp256k1.workspace = true
reth-storage-api.workspace = true
reth-storage-overlay.workspace = true
reth-static-file-types.workspace = true
reth-trie.workspace = true
reth-trie-common.workspace = true
Expand Down
1 change: 1 addition & 0 deletions bin/tempo/src/regenesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ where
self.env.chain.clone(),
static_file_provider,
rocksdb_provider,
reth_storage_overlay::OverlayManager::default(),
runtime,
)?;
let provider_rw = provider_factory.database_provider_rw()?;
Expand Down
7 changes: 5 additions & 2 deletions contrib/antithesis/reth-state-root/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{input::Operation, persistence::Persistence, Node};
use alloy_consensus::Header;
use alloy_primitives::{keccak256, B256};
use eyre::{ensure, Result};
use reth_chain_state::ExecutedBlock;
use reth_chain_state::{ExecutedBlock, InMemoryState};
use reth_chainspec::ChainSpec;
use reth_db::DatabaseEnv;
use reth_engine_primitives::MIN_PERSISTENCE_BACKPRESSURE_THRESHOLD;
Expand Down Expand Up @@ -122,7 +122,10 @@ impl Engine {
println!("{}", json!({"recovery": "start"}));
let factory = runtime.handle().block_on(
context.create_provider_factory_with_recovery::<Node, EthEvmConfig>(
OverlayManager::new(runtime.state_trie_overlay_worker_pool()),
OverlayManager::with_worker_pool(
InMemoryState::default(),
runtime.state_trie_overlay_worker_pool(),
),
None,
&[],
|factory| {
Expand Down
1 change: 1 addition & 0 deletions crates/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ reth-prune-types.workspace = true
reth-rpc-builder.workspace = true
reth-stages.workspace = true
reth-static-file.workspace = true
reth-storage-overlay.workspace = true

tempfile.workspace = true
tempo-chainspec = { workspace = true, features = ["reth"] }
Expand Down
1 change: 1 addition & 0 deletions crates/e2e/src/testing_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@ where
Arc::new(execution_runtime::chainspec()),
static_file_provider,
rocksdb,
reth_storage_overlay::OverlayManager::default(),
reth_ethereum::tasks::Runtime::test(),
)
.expect("failed to create provider factory");
Expand Down
14 changes: 9 additions & 5 deletions crates/evm/src/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ fn intrinsic_gas(
regular = regular
.saturating_add(params.get(GasId::TxEip7702PerEmptyAccountCost))
.saturating_add(tempo_signature_verification_gas(authorization.signature()));
state = state.saturating_add(params.eip7702_auth_state_gas());
state = state
.saturating_add(params.new_account_state_gas())
.saturating_add(params.get(GasId::TxEip7702PerAuthState));
if spec.is_t1() && authorization.nonce == 0 {
// TIP-1000: Storage pricing updates for launch
// EIP-7702 authorisation list entries with `auth_list.nonce == 0` require an additional 250,000 gas.
Expand Down Expand Up @@ -1611,7 +1613,6 @@ fn prepare_aa(
gas_limit: tx.gas_limit,
floor_gas,
initial_state_gas,
state_refund: 0,
result,
},
)?)
Expand Down Expand Up @@ -1711,7 +1712,7 @@ fn execute_aa(
result
.gas
.record_refund(i64::try_from(regular_refund).unwrap_or(i64::MAX));
TempoHandlerHooks::settle_transaction(
let mut result = TempoHandlerHooks::settle_transaction(
request.host,
request.envelope,
GasSettlement {
Expand All @@ -1720,10 +1721,13 @@ fn execute_aa(
gas_limit: tx.gas_limit,
floor_gas,
initial_state_gas,
state_refund,
result,
},
)
)?;
// The authorization state-gas refund was credited to the reservoir, so it is not state gas
// spent.
result.state_gas_spent = result.state_gas_spent.saturating_sub(state_refund);
Ok(result)
}

#[cfg(test)]
Expand Down
4 changes: 0 additions & 4 deletions crates/evm/src/handler/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,6 @@ fn test_refund_cap_removed_on_t7() {
gas_limit: SPENT,
floor_gas: 0,
initial_state_gas: 0,
state_refund: 0,
result,
},
)
Expand Down Expand Up @@ -2059,7 +2058,6 @@ fn test_negative_refund_counter_refunds_the_cap() {
gas_limit: SPENT,
floor_gas,
initial_state_gas: 0,
state_refund: 0,
result,
},
)
Expand Down Expand Up @@ -4175,7 +4173,6 @@ fn test_state_gas_aa_auth_list_nonce_zero() {
gas_limit,
floor_gas: floor,
initial_state_gas: state,
state_refund: 0,
result: MessageResult::<TempoEvmTypes> {
stop: InstrStop::Stop,
gas: GasTracker::new_with_execution_gas_and_reservoir(remaining, reservoir),
Expand Down Expand Up @@ -4444,7 +4441,6 @@ fn test_state_gas_batch_create_accounting() {
gas_limit: TX_GAS_LIMIT,
floor_gas: 0,
initial_state_gas: 0,
state_refund: 0,
result,
},
)
Expand Down
6 changes: 3 additions & 3 deletions crates/hardfork/src/gas_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,9 @@ mod tests {
"EIP-7702 per auth regular gas per spec"
);
assert_eq!(gas[GasId::TxEip7702PerAuthState], 0);
assert_eq!(gas.eip7702_auth_state_gas(), 225_000);
assert_eq!(gas.new_account_state_gas(), 225_000);
assert_eq!(
u64::from(gas[GasId::TxEip7702PerEmptyAccountCost]) + gas.eip7702_auth_state_gas(),
u64::from(gas[GasId::TxEip7702PerEmptyAccountCost]) + gas.new_account_state_gas(),
250_000,
"EIP-7702 per auth total = 25k regular + 225k state per spec"
);
Expand Down Expand Up @@ -400,7 +400,7 @@ mod tests {

// EIP-7702: 25,000 regular + 225,000 state = 250,000 per auth
assert_eq!(
u64::from(gas[GasId::TxEip7702PerEmptyAccountCost]) + gas.eip7702_auth_state_gas(),
u64::from(gas[GasId::TxEip7702PerEmptyAccountCost]) + gas.new_account_state_gas(),
250_000,
"EIP-7702 per auth total must be 250,000"
);
Expand Down
Loading