Skip to content

Commit f4e149c

Browse files
committed
update activate logic
1 parent 66f62ec commit f4e149c

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

crates/config/src/configuration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1552,7 +1552,7 @@ impl Configuration {
15521552
self.raw_conf.align_evm_transition_height;
15531553

15541554
// hardfork (V3.1)
1555-
params.transition_numbers.eip7939 = self
1555+
params.transition_heights.eip7939 = self
15561556
.raw_conf
15571557
.eip7939_transition_number
15581558
.unwrap_or(default_transition_time);

crates/execution/executor/src/spec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ pub struct TransitionsBlockNumber {
115115
pub cip144: BlockNumber,
116116
/// CIP-145: Fix Receipts upon `NotEnoughBalance` Error
117117
pub cip145: BlockNumber,
118-
/// EIP-7939: Count Leading Zeros Instruction
119-
pub eip7939: BlockHeight,
120118
}
121119

122120
#[derive(Default, Debug, Clone)]
@@ -160,6 +158,8 @@ pub struct TransitionsEpochHeight {
160158
pub eip7623: BlockHeight,
161159
pub cip_c2_fix: BlockHeight,
162160
pub cip145_fix: BlockHeight,
161+
/// EIP-7939: Count Leading Zeros Instruction
162+
pub eip7939: BlockHeight,
163163
}
164164

165165
impl Default for CommonParams {
@@ -231,7 +231,7 @@ impl CommonParams {
231231
spec.cip_c2_fix = height >= self.transition_heights.cip_c2_fix;
232232
spec.cancun_opcodes = number >= self.transition_numbers.cancun_opcodes;
233233
spec.align_evm = height >= self.transition_heights.align_evm && cip645;
234-
spec.eip7939 = number >= self.transition_numbers.eip7939;
234+
spec.eip7939 = height >= self.transition_heights.eip7939;
235235

236236
spec.overwrite_gas_plan_by_cip();
237237

crates/execution/vm-interpreter/src/instructions.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,14 +434,14 @@ impl Instruction {
434434
pub fn info<const CANCUN: bool>(
435435
&self, cip645: bool, eip7939: bool,
436436
) -> &InstructionInfo {
437-
let instrs = if eip7939 {
438-
&*INSTRUCTIONS_EIP7939
439-
} else if cip645 {
440-
&*INSTRUCTIONS_CIP645
441-
} else if CANCUN {
437+
let instrs = if !CANCUN {
438+
&*INSTRUCTIONS
439+
} else if !cip645 {
442440
&*INSTRUCTIONS_CANCUN
441+
} else if !eip7939 {
442+
&*INSTRUCTIONS_CIP645
443443
} else {
444-
&*INSTRUCTIONS
444+
&*INSTRUCTIONS_EIP7939
445445
};
446446

447447
instrs[*self as usize].as_ref().expect("A instruction is defined in Instruction enum, but it is not found in InstructionInfo struct; this indicates a logic failure in the code.")

0 commit comments

Comments
 (0)