Skip to content

Commit d7b7e71

Browse files
chore: resolve merge conflicts
1 parent 925745e commit d7b7e71

21 files changed

+1195
-4312
lines changed

Cargo.lock

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

crates/precompile/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ cometbft-proto = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.g
4444
cometbft-light-client = { git = "https://github.com/bnb-chain/greenfield-cometbft-rs.git", rev = "1282547" }
4545
prost = { version = "0.12.6" }
4646
bls_on_arkworks = "0.3.0"
47-
tendermint = { git = "https://github.com/bnb-chain/tendermint-rs-parlia", tag = "v0.1.0-beta.1", features = ["secp256k1"] }
47+
tendermint = { git = "https://github.com/bnb-chain/tendermint-rs-parlia", rev = "8c21ccbd58a174e07eed2c9343e63ccd00f0fbd5", features = ["secp256k1"] }
4848
parity-bytes = { version = "0.1.2", default-features = false }
4949

5050
# SHA2-256 and RIPEMD-160

crates/precompile/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,11 @@ impl PrecompileSpecId {
491491
#[cfg(feature = "opbnb")]
492492
FERMAT => Self::FERMAT,
493493
#[cfg(any(feature = "bsc", feature = "opbnb"))]
494-
HABER | HABER_FIX | WRIGHT | BOHR => Self::HABER,
494+
HABER => Self::HABER,
495+
#[cfg(feature = "opbnb")]
496+
WRIGHT => Self::HABER,
497+
#[cfg(feature = "bsc")]
498+
HABER_FIX | BOHR => Self::HABER,
495499
LATEST => Self::LATEST,
496500
}
497501
}

crates/primitives/src/specification.rs

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ pub enum SpecId {
3131
MERGE = 15, // Paris/Merge 15537394 (TTD: 58750000000000000000000)
3232
SHANGHAI = 16, // Shanghai 17034870 (Timestamp: 1681338455)
3333
CANCUN = 17, // Cancun 19426587 (Timestamp: 1710338135)
34-
PRAGUE = 18, // Praque TBD
35-
PRAGUE_EOF = 19, // Praque+EOF TBD
34+
PRAGUE = 18, // Prague TBD
35+
PRAGUE_EOF = 19, // Prague+EOF TBD
3636
#[default]
3737
LATEST = u8::MAX,
3838
}
@@ -71,8 +71,9 @@ pub enum SpecId {
7171
HABER = 23,
7272
WRIGHT = 24,
7373
FJORD = 25,
74-
PRAGUE = 26,
75-
PRAGUE_EOF = 27,
74+
GRANITE = 26,
75+
PRAGUE = 27,
76+
PRAGUE_EOF = 28,
7677
#[default]
7778
LATEST = u8::MAX,
7879
}
@@ -179,6 +180,8 @@ impl From<&str> for SpecId {
179180
"Ecotone" => SpecId::ECOTONE,
180181
#[cfg(feature = "optimism")]
181182
"Fjord" => SpecId::FJORD,
183+
#[cfg(feature = "optimism")]
184+
"Granite" => SpecId::GRANITE,
182185
#[cfg(feature = "bsc")]
183186
"Ramanujan" => SpecId::RAMANUJAN,
184187
#[cfg(feature = "bsc")]
@@ -259,6 +262,8 @@ impl From<SpecId> for &'static str {
259262
SpecId::ECOTONE => "Ecotone",
260263
#[cfg(feature = "optimism")]
261264
SpecId::FJORD => "Fjord",
265+
#[cfg(feature = "optimism")]
266+
SpecId::GRANITE => "Granite",
262267
#[cfg(feature = "bsc")]
263268
SpecId::RAMANUJAN => "Ramanujan",
264269
#[cfg(feature = "bsc")]
@@ -380,10 +385,13 @@ spec!(CANYON, CanyonSpec);
380385
spec!(ECOTONE, EcotoneSpec);
381386
#[cfg(feature = "optimism")]
382387
spec!(FJORD, FjordSpec);
388+
#[cfg(feature = "optimism")]
389+
spec!(GRANITE, GraniteSpec);
383390
#[cfg(feature = "opbnb")]
384391
spec!(FERMAT, FermatSpec);
385392
#[cfg(feature = "opbnb")]
386393
spec!(WRIGHT, WrightSpec);
394+
387395
#[cfg(all(not(feature = "optimism"), not(feature = "bsc")))]
388396
#[macro_export]
389397
macro_rules! spec_to_generic {
@@ -557,6 +565,10 @@ macro_rules! spec_to_generic {
557565
use $crate::FjordSpec as SPEC;
558566
$e
559567
}
568+
$crate::SpecId::GRANITE => {
569+
use $crate::GraniteSpec as SPEC;
570+
$e
571+
}
560572
}
561573
}};
562574
}
@@ -718,6 +730,8 @@ mod tests {
718730
spec_to_generic!(ECOTONE, assert_eq!(SPEC::SPEC_ID, ECOTONE));
719731
#[cfg(feature = "optimism")]
720732
spec_to_generic!(FJORD, assert_eq!(SPEC::SPEC_ID, FJORD));
733+
#[cfg(feature = "optimism")]
734+
spec_to_generic!(GRANITE, assert_eq!(SPEC::SPEC_ID, GRANITE));
721735
#[cfg(not(feature = "bsc"))]
722736
spec_to_generic!(PRAGUE, assert_eq!(SPEC::SPEC_ID, PRAGUE));
723737
#[cfg(not(feature = "bsc"))]
@@ -881,4 +895,32 @@ mod optimism_tests {
881895
assert!(SpecId::enabled(SpecId::FJORD, SpecId::ECOTONE));
882896
assert!(SpecId::enabled(SpecId::FJORD, SpecId::FJORD));
883897
}
898+
899+
#[test]
900+
fn test_granite_post_merge_hardforks() {
901+
assert!(GraniteSpec::enabled(SpecId::MERGE));
902+
assert!(GraniteSpec::enabled(SpecId::SHANGHAI));
903+
assert!(GraniteSpec::enabled(SpecId::CANCUN));
904+
assert!(!GraniteSpec::enabled(SpecId::LATEST));
905+
assert!(GraniteSpec::enabled(SpecId::BEDROCK));
906+
assert!(GraniteSpec::enabled(SpecId::REGOLITH));
907+
assert!(GraniteSpec::enabled(SpecId::CANYON));
908+
assert!(GraniteSpec::enabled(SpecId::ECOTONE));
909+
assert!(GraniteSpec::enabled(SpecId::FJORD));
910+
assert!(GraniteSpec::enabled(SpecId::GRANITE));
911+
}
912+
913+
#[test]
914+
fn test_granite_post_merge_hardforks_spec_id() {
915+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::MERGE));
916+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::SHANGHAI));
917+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::CANCUN));
918+
assert!(!SpecId::enabled(SpecId::GRANITE, SpecId::LATEST));
919+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::BEDROCK));
920+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::REGOLITH));
921+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::CANYON));
922+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::ECOTONE));
923+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::FJORD));
924+
assert!(SpecId::enabled(SpecId::GRANITE, SpecId::GRANITE));
925+
}
884926
}

crates/revm/src/bsc/handler_register.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
//! Handler related to BNB-Smart-chain
22
3-
use crate::primitives::KECCAK_EMPTY;
43
use crate::{
54
handler::register::EvmHandler,
65
interpreter::Gas,
@@ -89,14 +88,14 @@ pub fn collect_system_reward<SPEC: Spec, EXT, DB: Database>(
8988
tx_fee = tx_fee.saturating_add(*data_fee);
9089
}
9190

92-
let (system_account, _) = context
91+
let system_account = context
9392
.evm
9493
.inner
9594
.journaled_state
9695
.load_account(SYSTEM_ADDRESS, &mut context.evm.inner.db)?;
9796

98-
system_account.mark_touch();
99-
system_account.info.balance = system_account.info.balance.saturating_add(tx_fee);
97+
system_account.data.mark_touch();
98+
system_account.data.info.balance = system_account.data.info.balance.saturating_add(tx_fee);
10099

101100
Ok(())
102101
}
@@ -126,17 +125,7 @@ pub fn output<EXT, DB: Database>(
126125
let instruction_result = result.into_interpreter_result();
127126

128127
// reset journal and return present state.
129-
let (mut state, logs) = context.evm.journaled_state.finalize();
130-
131-
// clear code of authorized accounts.
132-
for authorized in core::mem::take(&mut context.evm.inner.valid_authorizations).into_iter() {
133-
let account = state
134-
.get_mut(&authorized)
135-
.expect("Authorized account must exist");
136-
account.info.code = None;
137-
account.info.code_hash = KECCAK_EMPTY;
138-
account.storage.clear();
139-
}
128+
let (state, logs) = context.evm.journaled_state.finalize();
140129

141130
let result = match instruction_result.result.into() {
142131
SuccessOrHalt::Success(reason) => ExecutionResult::Success {

crates/revm/src/handler/handle_types.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ pub mod pre_execution;
77
pub mod validation;
88

99
// Exports
10-
1110
pub use execution::{
1211
ExecutionHandler, FrameCallHandle, FrameCallReturnHandle, FrameCreateHandle,
1312
FrameCreateReturnHandle, InsertCallOutcomeHandle, InsertCreateOutcomeHandle,

crates/revm/src/handler/mainnet.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ mod pre_execution;
66
mod validation;
77

88
// Public exports
9-
109
pub use execution::{
1110
call, call_return, create, create_return, eofcreate, eofcreate_return, execute_frame,
1211
insert_call_outcome, insert_create_outcome, insert_eofcreate_outcome, last_frame_return,

tests/eof_suite/eest/state_tests/prague/eip7692_eof_v1/eip7620_eof_create/eofcreate_failures/eofcreate_deploy_sizes.json

Lines changed: 0 additions & 50 deletions
Large diffs are not rendered by default.

tests/prague_suite/state_tests/prague/eip7702_eoa_code_tx/eoa_code_txs/address_from_set_code.json

Lines changed: 0 additions & 90 deletions
This file was deleted.

tests/prague_suite/state_tests/prague/eip7702_eoa_code_tx/eoa_code_txs/ext_code_on_set_code.json

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)