Skip to content

Commit 02d7be8

Browse files
committed
Fix incorrect implementation of cip145
1 parent 0424656 commit 02d7be8

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

crates/config/src/configuration.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ build_config! {
195195
(eoa_code_transition_height, (Option<u64>), None)
196196
(cip151_transition_height, (Option<u64>), None)
197197
(cip645_transition_height, (Option<u64>), None)
198+
(cip145_fix_transition_height, (Option<u64>), None)
198199
// For test only
199200
(align_evm_transition_height, (u64), u64::MAX)
200201

@@ -1507,14 +1508,17 @@ impl Configuration {
15071508
//
15081509
set_conf!(
15091510
self.raw_conf.eoa_code_transition_height.unwrap_or(default_transition_time);
1510-
params.transition_heights => { cip150, cip151, cip152, cip154, cip7702, cip645, eip2537, eip2935, eip7623 }
1511+
params.transition_heights => { cip150, cip151, cip152, cip154, cip7702, cip645, eip2537, eip2935, eip7623, cip145_fix }
15111512
);
15121513
if let Some(x) = self.raw_conf.cip151_transition_height {
15131514
params.transition_heights.cip151 = x;
15141515
}
15151516
if let Some(x) = self.raw_conf.cip645_transition_height {
15161517
params.transition_heights.cip645 = x;
15171518
}
1519+
if let Some(x) = self.raw_conf.cip145_fix_transition_height {
1520+
params.transition_heights.cip145_fix = x;
1521+
}
15181522
params.transition_heights.align_evm =
15191523
self.raw_conf.align_evm_transition_height;
15201524
}

crates/execution/executor/src/executive/executed.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ impl Executed {
8888
gas_sponsor_paid = false;
8989
storage_sponsor_paid = false;
9090
}
91+
if spec.cip145_fix {
92+
gas_sponsor_paid = false;
93+
}
9194

9295
let burnt_fee = spec.cip1559.then(|| {
9396
let target_burnt = tx.gas().saturating_mul(cost.burnt_gas_price);
@@ -122,7 +125,7 @@ impl Executed {
122125
gas_sponsor_paid = false;
123126
storage_sponsor_paid = false;
124127
}
125-
if spec.cip145 {
128+
if spec.cip145 && !spec.cip145_fix {
126129
gas_sponsor_paid = false;
127130
}
128131

crates/execution/executor/src/spec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub struct TransitionsEpochHeight {
157157
/// EIP-7623: Increase calldata cost
158158
pub eip7623: BlockHeight,
159159
pub cip_c2_fix: BlockHeight,
160+
pub cip145_fix: BlockHeight,
160161
}
161162

162163
impl Default for CommonParams {
@@ -214,6 +215,7 @@ impl CommonParams {
214215
spec.cip137 = number >= self.transition_numbers.cip137;
215216
spec.cip144 = number >= self.transition_numbers.cip144;
216217
spec.cip145 = number >= self.transition_numbers.cip145;
218+
spec.cip145_fix = height >= self.transition_heights.cip145_fix;
217219
spec.cip1559 = height >= self.transition_heights.cip1559;
218220
spec.cip150 = height >= self.transition_heights.cip150;
219221
spec.cip151 = height >= self.transition_heights.cip151;

crates/execution/vm-types/src/spec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ pub struct Spec {
185185
pub cip144: bool,
186186
/// CIP-145: Fix Receipts upon `NotEnoughBalance` Error
187187
pub cip145: bool,
188+
pub cip145_fix: bool,
188189
/// CIP-150: Reject New Contract Code Starting with the 0xEF byte
189190
pub cip150: bool,
190191
/// CIP-151: SELFDESTRUCT only in Same Transaction
@@ -400,6 +401,7 @@ impl Spec {
400401
cip133_core: false,
401402
cip137: false,
402403
cip145: false,
404+
cip145_fix: false,
403405
cip1559: false,
404406
cancun_opcodes: false,
405407
cip144: false,

0 commit comments

Comments
 (0)