Skip to content

Commit e7eba51

Browse files
authored
fix: set gas_price when handling eth_call (#1649)
1 parent d8d3550 commit e7eba51

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

crates/rpc/src/eth_rpc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ impl EthApiServer for EthApi {
126126
if transaction.gas.is_none() {
127127
transaction.gas = Some(evm_block_state.block_header().gas_limit.to());
128128
}
129+
// If gas price is not set, set it to base fee
130+
if transaction.gas_price.is_none() {
131+
transaction.gas_price = evm_block_state
132+
.block_header()
133+
.base_fee_per_gas
134+
.map(|base_fee| base_fee.to());
135+
}
129136

130137
let result_and_state = execute_transaction(
131138
create_block_env(evm_block_state.block_header()),

crates/rpc/src/evm_state.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ use ethportal_api::{
1717
trie_traversal::{NodeTraversal, TraversalError, TraversalResult},
1818
},
1919
},
20-
ContentValue, ContentValueError, Header, StateContentKey, StateContentValue,
20+
ContentValue, ContentValueError, Header, OverlayContentKey, StateContentKey, StateContentValue,
2121
};
2222
use revm::primitives::{AccountInfo, Bytecode, KECCAK_EMPTY};
2323
use tokio::sync::mpsc;
24+
use tracing::debug;
2425
use trin_evm::async_db::AsyncDatabase;
2526

2627
use crate::{errors::RpcServeError, fetch::proxy_to_subnet};
@@ -161,6 +162,10 @@ impl EvmBlockState {
161162
return Ok(value.clone());
162163
}
163164

165+
debug!(
166+
content_id = ?Bytes::from(content_key.content_id()),
167+
content_key = ?content_key.to_bytes(),
168+
"Fetching state content");
164169
let endpoint = StateEndpoint::GetContent(content_key.clone());
165170
let GetContentInfo { content, .. } =
166171
proxy_to_subnet(&self.state_network, endpoint)

0 commit comments

Comments
 (0)