Skip to content

Commit c67c132

Browse files
committed
feat: ongoing upstream merge
Signed-off-by: Gregory Edison <gregory.edison1993@gmail.com>
1 parent b0b508e commit c67c132

File tree

13 files changed

+964
-877
lines changed

13 files changed

+964
-877
lines changed

Cargo.lock

Lines changed: 894 additions & 811 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -485,18 +485,18 @@ reth-ress-protocol = { path = "crates/ress/protocol" }
485485
reth-ress-provider = { path = "crates/ress/provider" }
486486

487487
# revm
488-
revm = { git = "https://github.com/scroll-tech/revm", default-features = false, features = ["enable_eip7702", "enable_eip7623"] }
489-
revm-bytecode = { git = "https://github.com/scroll-tech/revm", default-features = false }
490-
revm-database = { git = "https://github.com/scroll-tech/revm", default-features = false }
491-
revm-state = { git = "https://github.com/scroll-tech/revm", default-features = false }
492-
revm-primitives = { git = "https://github.com/scroll-tech/revm", default-features = false }
493-
revm-interpreter = { git = "https://github.com/scroll-tech/revm", default-features = false }
494-
revm-inspector = { git = "https://github.com/scroll-tech/revm", default-features = false }
495-
revm-context = { git = "https://github.com/scroll-tech/revm", default-features = false }
496-
revm-context-interface = { git = "https://github.com/scroll-tech/revm", default-features = false }
497-
revm-database-interface = { git = "https://github.com/scroll-tech/revm", default-features = false }
498-
op-revm = { git = "https://github.com/scroll-tech/revm", default-features = false }
499-
revm-scroll = { git = "https://github.com/scroll-tech/scroll-revm", default-features = false }
488+
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false, features = ["enable_eip7702", "enable_eip7623"] }
489+
revm-bytecode = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
490+
revm-database = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
491+
revm-state = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
492+
revm-primitives = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
493+
revm-interpreter = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
494+
revm-inspector = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
495+
revm-context = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
496+
revm-context-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
497+
revm-database-interface = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
498+
op-revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97", default-features = false }
499+
revm-scroll = { git = "https://github.com/scroll-tech/scroll-revm", branch = "feat/v97", default-features = false }
500500
revm-inspectors = "0.32.0"
501501

502502
# eth
@@ -771,8 +771,8 @@ walkdir = "2.3.3"
771771
vergen-git2 = "1.0.5"
772772

773773
[patch.crates-io]
774-
revm = { git = "https://github.com/scroll-tech/revm" }
775-
op-revm = { git = "https://github.com/scroll-tech/revm" }
774+
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97" }
775+
op-revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97" }
776776
# alloy-consensus = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
777777
# alloy-contract = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }
778778
# alloy-eips = { git = "https://github.com/alloy-rs/alloy", rev = "cfb13aa" }

crates/engine/tree/src/tree/payload_validator.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ use alloy_consensus::transaction::Either;
1515
use alloy_eips::{eip1898::BlockWithParent, NumHash};
1616
use alloy_evm::Evm;
1717
use alloy_primitives::B256;
18-
use reth_chain_state::{
19-
CanonicalInMemoryState, ExecutedBlock, ExecutedBlockWithTrieUpdates, ExecutedTrieUpdates,
20-
};
18+
use reth_chain_state::{CanonicalInMemoryState, ExecutedBlock};
2119
use reth_consensus::{ConsensusError, FullConsensus, HeaderValidator};
2220
use reth_engine_primitives::{
2321
ConfigureEngineEvm, ExecutableTxIterator, ExecutionPayload, InvalidBlockHook, PayloadValidator,

crates/node/builder/src/components/pool.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use crate::{BuilderContext, FullNodeTypes};
44

55
use alloy_primitives::Address;
66
use reth_chain_state::CanonStateSubscriptions;
7-
use reth_chainspec::ChainSpecProvider;
8-
use reth_node_api::TxTy;
7+
use reth_chainspec::{ChainSpecProvider, EthereumHardforks};
8+
use reth_node_api::{NodeTypes, TxTy};
99
use reth_transaction_pool::{
1010
blobstore::DiskFileBlobStore, CoinbaseTipOrdering, PoolConfig, PoolTransaction, SubPoolLimit,
1111
TransactionPool, TransactionValidationTaskExecutor, TransactionValidator,

crates/scroll/alloy/evm/src/block/mod.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use alloy_primitives::{B256, U256};
2828
use revm::{
2929
context::{
3030
result::{InvalidTransaction, ResultAndState},
31-
TxEnv,
31+
Block, TxEnv,
3232
},
3333
database::State,
3434
handler::PrecompileProvider,
@@ -154,7 +154,7 @@ where
154154
fn apply_pre_execution_changes(&mut self) -> Result<(), BlockExecutionError> {
155155
// set state clear flag if the block is after the Spurious Dragon hardfork.
156156
let state_clear_flag =
157-
self.spec.is_spurious_dragon_active_at_block(self.evm.block().number.to());
157+
self.spec.is_spurious_dragon_active_at_block(self.evm.block().number().to());
158158
self.evm.db_mut().set_state_clear_flag(state_clear_flag);
159159

160160
// load the l1 gas oracle contract in cache.
@@ -169,7 +169,7 @@ where
169169
if self
170170
.spec
171171
.scroll_fork_activation(ScrollHardfork::Curie)
172-
.transitions_at_block(self.evm.block().number.to())
172+
.transitions_at_block(self.evm.block().number().to())
173173
{
174174
if let Err(err) = apply_curie_hard_fork(self.evm.db_mut()) {
175175
return Err(BlockExecutionError::msg(format!(
@@ -183,7 +183,7 @@ where
183183
if self
184184
.spec
185185
.scroll_fork_activation(ScrollHardfork::Feynman)
186-
.active_at_timestamp(self.evm.block().timestamp.to())
186+
.active_at_timestamp(self.evm.block().timestamp().to())
187187
{
188188
if let Err(err) = apply_feynman_hard_fork(self.evm.db_mut()) {
189189
return Err(BlockExecutionError::msg(format!(
@@ -206,7 +206,7 @@ where
206206
let is_l1_message = tx.tx().ty() == L1_MESSAGE_TRANSACTION_TYPE;
207207
// The sum of the transaction’s gas limit and the gas utilized in this block prior,
208208
// must be no greater than the block’s gasLimit.
209-
let block_available_gas = self.evm.block().gas_limit - self.gas_used;
209+
let block_available_gas = self.evm.block().gas_limit() - self.gas_used;
210210
if tx.tx().gas_limit() > block_available_gas {
211211
return Err(BlockValidationError::TransactionGasLimitMoreThanAvailableBlockGas {
212212
transaction_gas_limit: tx.tx().gas_limit(),
@@ -219,14 +219,14 @@ where
219219

220220
let block = self.evm.block();
221221
// verify the transaction type is accepted by the current fork.
222-
if tx.tx().is_eip2930() && !chain_spec.is_curie_active_at_block(block.number.to()) {
222+
if tx.tx().is_eip2930() && !chain_spec.is_curie_active_at_block(block.number().to()) {
223223
return Err(BlockValidationError::InvalidTx {
224224
hash,
225225
error: Box::new(InvalidTransaction::Eip2930NotSupported),
226226
}
227227
.into())
228228
}
229-
if tx.tx().is_eip1559() && !chain_spec.is_curie_active_at_block(block.number.to()) {
229+
if tx.tx().is_eip1559() && !chain_spec.is_curie_active_at_block(block.number().to()) {
230230
return Err(BlockValidationError::InvalidTx {
231231
hash,
232232
error: Box::new(InvalidTransaction::Eip1559NotSupported),
@@ -241,7 +241,7 @@ where
241241
.into())
242242
}
243243
if tx.tx().is_eip7702() &&
244-
!chain_spec.is_euclid_v2_active_at_timestamp(block.timestamp.to())
244+
!chain_spec.is_euclid_v2_active_at_timestamp(block.timestamp().to())
245245
{
246246
return Err(BlockValidationError::InvalidTx {
247247
hash,
@@ -296,6 +296,7 @@ where
296296
receipts: self.receipts,
297297
requests: Default::default(),
298298
gas_used: self.gas_used,
299+
blob_gas_used: 0,
299300
},
300301
))
301302
}

crates/scroll/alloy/evm/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ where
112112
type Error = EVMError<DB::Error>;
113113
type HaltReason = HaltReason;
114114
type Spec = ScrollSpecId;
115+
type BlockEnv = BlockEnv;
115116
type Precompiles = P;
116117
type Inspector = I;
117118

@@ -207,6 +208,7 @@ impl<P: ScrollPrecompilesFactory> EvmFactory for ScrollEvmFactory<P> {
207208
type Error<DBError: core::error::Error + Send + Sync + 'static> = EVMError<DBError>;
208209
type HaltReason = HaltReason;
209210
type Spec = ScrollSpecId;
211+
type BlockEnv = BlockEnv;
210212
type Precompiles = PrecompilesMap;
211213

212214
fn create_evm<DB: Database>(

crates/scroll/alloy/evm/src/system_caller.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ use alloy_evm::{
66
Evm,
77
};
88
use alloy_primitives::B256;
9-
use revm::{context::result::ResultAndState, DatabaseCommit};
9+
use revm::{
10+
context::{result::ResultAndState, Block},
11+
DatabaseCommit,
12+
};
1013
use scroll_alloy_hardforks::ScrollHardforks;
1114

1215
/// An ephemeral helper type for executing system calls.
@@ -62,13 +65,13 @@ fn transact_blockhashes_contract_call<Halt>(
6265
evm: &mut impl Evm<HaltReason = Halt>,
6366
) -> Result<Option<ResultAndState<Halt>>, BlockExecutionError> {
6467
// if Feynman is not active at timestamp then no system transaction occurs.
65-
if !spec.is_feynman_active_at_timestamp(evm.block().timestamp.to()) {
68+
if !spec.is_feynman_active_at_timestamp(evm.block().timestamp().to()) {
6669
return Ok(None);
6770
}
6871

6972
// if the block number is zero (genesis block) then no system transaction may occur as per
7073
// EIP-2935
71-
if evm.block().number.to::<u64>() == 0u64 {
74+
if evm.block().number().to::<u64>() == 0u64 {
7275
return Ok(None);
7376
}
7477

crates/scroll/engine-primitives/src/payload/built.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ use alloy_rpc_types_engine::{
1010
ExecutionPayloadEnvelopeV4, ExecutionPayloadFieldV2, ExecutionPayloadV1, ExecutionPayloadV3,
1111
PayloadId,
1212
};
13-
use reth_chain_state::ExecutedBlockWithTrieUpdates;
14-
use reth_payload_primitives::BuiltPayload;
13+
use reth_payload_primitives::{BuiltPayload, BuiltPayloadExecutedBlock};
1514
use reth_primitives_traits::SealedBlock;
1615
use reth_scroll_primitives::{ScrollBlock, ScrollPrimitives};
1716

@@ -23,7 +22,7 @@ pub struct ScrollBuiltPayload {
2322
/// Sealed block
2423
pub(crate) block: Arc<SealedBlock<ScrollBlock>>,
2524
/// Block execution data for the payload
26-
pub(crate) executed_block: Option<ExecutedBlockWithTrieUpdates<ScrollPrimitives>>,
25+
pub(crate) executed_block: Option<BuiltPayloadExecutedBlock<ScrollPrimitives>>,
2726
/// The fees of the block
2827
pub(crate) fees: U256,
2928
}
@@ -33,7 +32,7 @@ impl ScrollBuiltPayload {
3332
pub const fn new(
3433
id: PayloadId,
3534
block: Arc<SealedBlock<ScrollBlock>>,
36-
executed_block: Option<ExecutedBlockWithTrieUpdates<ScrollPrimitives>>,
35+
executed_block: Option<BuiltPayloadExecutedBlock<ScrollPrimitives>>,
3736
fees: U256,
3837
) -> Self {
3938
Self { id, block, executed_block, fees }
@@ -71,7 +70,7 @@ impl BuiltPayload for ScrollBuiltPayload {
7170
self.fees
7271
}
7372

74-
fn executed_block(&self) -> Option<ExecutedBlockWithTrieUpdates<Self::Primitives>> {
73+
fn executed_block(&self) -> Option<BuiltPayloadExecutedBlock<Self::Primitives>> {
7574
self.executed_block.clone()
7675
}
7776

crates/scroll/evm/src/build.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use reth_evm::execute::{BlockAssembler, BlockAssemblerInput};
77
use reth_execution_types::BlockExecutionResult;
88
use reth_primitives_traits::SignedTransaction;
99
use reth_scroll_primitives::ScrollReceipt;
10+
use revm::context::Block;
1011
use scroll_alloy_evm::ScrollBlockExecutionCtx;
1112
use scroll_alloy_hardforks::ScrollHardforks;
1213

@@ -53,7 +54,7 @@ where
5354
..
5455
} = input;
5556

56-
let timestamp = evm_env.block_env.timestamp;
57+
let timestamp = evm_env.block_env.timestamp();
5758

5859
let transactions_root = proofs::calculate_transaction_root(&transactions);
5960
let receipts_root = ScrollReceipt::calculate_receipt_root_no_memo(receipts);
@@ -69,15 +70,15 @@ where
6970
withdrawals_root: None,
7071
logs_bloom,
7172
timestamp: timestamp.to(),
72-
mix_hash: evm_env.block_env.prevrandao.unwrap_or_default(),
73+
mix_hash: evm_env.block_env.prevrandao().unwrap_or_default(),
7374
nonce: BEACON_NONCE.into(),
7475
base_fee_per_gas: self
7576
.chain_spec
76-
.is_curie_active_at_block(evm_env.block_env.number.to())
77-
.then_some(evm_env.block_env.basefee),
78-
number: evm_env.block_env.number.to(),
79-
gas_limit: evm_env.block_env.gas_limit,
80-
difficulty: evm_env.block_env.difficulty,
77+
.is_curie_active_at_block(evm_env.block_env.number().to())
78+
.then_some(evm_env.block_env.basefee()),
79+
number: evm_env.block_env.number().to(),
80+
gas_limit: evm_env.block_env.gas_limit(),
81+
difficulty: evm_env.block_env.difficulty(),
8182
gas_used: *gas_used,
8283
extra_data: Default::default(),
8384
parent_beacon_block_root: None,

crates/scroll/openvm-compat/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ scroll-alloy-consensus = { path = "../alloy/consensus", default-features = false
2828
scroll-alloy-rpc-types = { path = "../alloy/rpc-types", default-features = false }
2929

3030
[patch.crates-io]
31-
revm = { git = "https://github.com/scroll-tech/revm" }
31+
revm = { git = "https://github.com/scroll-tech/revm", branch = "feat/v97" }

0 commit comments

Comments
 (0)