Skip to content

Commit e878170

Browse files
authored
Update evm config to shanghai (#1068)
1 parent 5d8abdb commit e878170

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

docs/frame/evm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ any Ethereum transaction into a transaction compatible with this
4242
module.
4343

4444
The gas configurations are configurable. Right now, a pre-defined
45-
London hard fork configuration option is provided.
45+
Shanghai hard fork configuration option is provided.

frame/ethereum/src/tests/eip1559.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ fn transaction_should_generate_correct_gas_used() {
327327
let (pairs, mut ext) = new_test_ext(1);
328328
let alice = &pairs[0];
329329

330-
let expected_gas = U256::from(893928);
330+
let expected_gas = U256::from(894198);
331331

332332
ext.execute_with(|| {
333333
let t = eip1559_erc20_creation_transaction(alice);

frame/ethereum/src/tests/eip2930.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn transaction_should_generate_correct_gas_used() {
259259
let (pairs, mut ext) = new_test_ext(1);
260260
let alice = &pairs[0];
261261

262-
let expected_gas = U256::from(893928);
262+
let expected_gas = U256::from(894198);
263263

264264
ext.execute_with(|| {
265265
let t = eip2930_erc20_creation_transaction(alice);

frame/ethereum/src/tests/legacy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ fn transaction_should_generate_correct_gas_used() {
259259
let (pairs, mut ext) = new_test_ext(1);
260260
let alice = &pairs[0];
261261

262-
let expected_gas = U256::from(893928);
262+
let expected_gas = U256::from(894198);
263263

264264
ext.execute_with(|| {
265265
let t = legacy_erc20_creation_transaction(alice);

frame/evm/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ pub mod pallet {
167167

168168
/// EVM config used in the module.
169169
fn config() -> &'static EvmConfig {
170-
&LONDON_CONFIG
170+
&SHANGHAI_CONFIG
171171
}
172172
}
173173

@@ -714,7 +714,7 @@ impl<T: Config> GasWeightMapping for FixedGasWeightMapping<T> {
714714
}
715715
}
716716

717-
static LONDON_CONFIG: EvmConfig = EvmConfig::london();
717+
static SHANGHAI_CONFIG: EvmConfig = EvmConfig::shanghai();
718718

719719
impl<T: Config> Pallet<T> {
720720
/// Check whether an account is empty.

primitives/evm/src/validation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ mod tests {
227227
InvalidChainId,
228228
}
229229

230-
static LONDON_CONFIG: evm::Config = evm::Config::london();
230+
static SHANGHAI_CONFIG: evm::Config = evm::Config::shanghai();
231231

232232
impl From<InvalidEvmTransactionError> for TestError {
233233
fn from(e: InvalidEvmTransactionError) -> Self {
@@ -293,7 +293,7 @@ mod tests {
293293
} = input;
294294
CheckEvmTransaction::<TestError>::new(
295295
CheckEvmTransactionConfig {
296-
evm_config: &LONDON_CONFIG,
296+
evm_config: &SHANGHAI_CONFIG,
297297
block_gas_limit: blockchain_gas_limit,
298298
base_fee: blockchain_base_fee,
299299
chain_id: blockchain_chain_id,

ts-tests/tests/test-execute.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => {
158158
},
159159
]);
160160

161-
expect(result.result).to.be.equal("0x3043a");
161+
expect(result.result).to.be.equal("0x30464");
162162
});
163163

164164
step("should estimateGas with gas limit up to 10x block gas limit", async function () {
@@ -170,7 +170,7 @@ describeWithFrontier("Frontier RPC (RPC execution)", (context) => {
170170
},
171171
]);
172172

173-
expect(result.result).to.be.equal("0x3043a");
173+
expect(result.result).to.be.equal("0x30464");
174174
});
175175

176176
step("shouldn't estimateGas with gas limit up higher than 10x block gas limit", async function () {

ts-tests/tests/test-fee-history.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ describeWithFrontier("Frontier RPC (Fee History)", (context) => {
7474
// baseFeePerGas is always the requested block range + 1 (the next derived base fee).
7575
expect(result.baseFeePerGas.length).to.be.eq(blockCount + 1);
7676
// gasUsedRatio for the requested block range.
77-
expect(result.gasUsedRatio).to.be.deep.eq(Array(blockCount).fill(0.03575712));
77+
expect(result.gasUsedRatio).to.be.deep.eq(Array(blockCount).fill(0.03576792));
7878
// two-dimensional reward list for the requested block range.
7979
expect(result.reward.length).to.be.eq(blockCount);
8080
// each block has a reward list which's size is the requested percentile list.

ts-tests/tests/test-gas.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => {
4242

4343
it("eth_estimateGas for contract creation", async function () {
4444
// The value returned as an estimation by the evm with estimate mode ON.
45-
let oneOffEstimation = 196657;
45+
let oneOffEstimation = 196701;
4646
let binarySearchEstimation = binarySearch(oneOffEstimation);
4747
// Sanity check expect a variance of 10%.
4848
expect(estimationVariance(binarySearchEstimation, oneOffEstimation)).to.be.lessThan(1);
@@ -105,7 +105,7 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => {
105105
it("eth_estimateGas should handle AccessList alias", async function () {
106106
// The value returned as an estimation by the evm with estimate mode ON.
107107
// 4300 == 1900 for one key and 2400 for one storage.
108-
let oneOffEstimation = 196657 + 4300;
108+
let oneOffEstimation = 196701 + 4300;
109109
let binarySearchEstimation = binarySearch(oneOffEstimation);
110110
// Sanity check expect a variance of 10%.
111111
expect(estimationVariance(binarySearchEstimation, oneOffEstimation)).to.be.lessThan(1);
@@ -132,12 +132,12 @@ describeWithFrontier("Frontier RPC (Gas)", (context) => {
132132
data: Test.bytecode,
133133
gasPrice: "0x0",
134134
});
135-
expect(result).to.equal(197690);
135+
expect(result).to.equal(197732);
136136
result = await context.web3.eth.estimateGas({
137137
from: GENESIS_ACCOUNT,
138138
data: Test.bytecode,
139139
});
140-
expect(result).to.equal(197690);
140+
expect(result).to.equal(197732);
141141
});
142142

143143
it("tx gas limit below ETH_BLOCK_GAS_LIMIT", async function () {

0 commit comments

Comments
 (0)