Skip to content
Merged
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
13 changes: 8 additions & 5 deletions crates/handler/src/system_call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
use context::{result::ExecResultAndState, ContextSetters, ContextTr, Evm, JournalTr, TxEnv};
use database_interface::DatabaseCommit;
use interpreter::{interpreter::EthInterpreter, InterpreterResult};
use primitives::{address, eip7825, Address, Bytes, TxKind};
use primitives::{address, Address, Bytes, TxKind};
use state::EvmState;

/// The system address used for system calls.
Expand Down Expand Up @@ -62,7 +62,7 @@ impl SystemCallTx for TxEnv {
.caller(caller)
.data(data)
.kind(TxKind::Call(system_contract_address))
.gas_limit(eip7825::TX_GAS_LIMIT_CAP)
.gas_limit(30_000_000)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mainly curious; where does this 30M come from?

.build()
.unwrap()
}
Expand Down Expand Up @@ -197,7 +197,7 @@ mod tests {
use super::*;
use context::{
result::{ExecutionResult, Output, SuccessReason},
Context,
Context, Transaction,
};
use database::InMemoryDB;
use primitives::{b256, bytes, StorageKey, U256};
Expand All @@ -217,15 +217,18 @@ mod tests {
let block_hash =
b256!("0x1111111111111111111111111111111111111111111111111111111111111111");

let mut my_evm = Context::mainnet()
let mut evm = Context::mainnet()
.with_db(db)
// block with number 1 will set storage at slot 0.
.modify_block_chained(|b| b.number = U256::ONE)
.build_mainnet();
let output = my_evm
let output = evm
.transact_system_call_finalize(HISTORY_STORAGE_ADDRESS, block_hash.0.into())
.unwrap();

// system call gas limit is 30M
assert_eq!(evm.ctx.tx().gas_limit(), 30_000_000);

assert_eq!(
output.result,
ExecutionResult::Success {
Expand Down
Loading