Skip to content

Commit 665fc04

Browse files
authored
chore: activate prague hardfork and Solidity version 0.8.30 as default (#10565)
* start defaulting to prague, add fix for blob handle scaling post cancun * fix anvil test * switch to 0.8.30 for tests * switch foundry-compilers to default to prague, small test fixes * add workaround for Vyper not yet supporting Prague * fix issues * fix tests, questionable gas difference and address difference * make prague explicit * fix clippy * bump compilers version * bump to 0.16.3 * pass in blob params, add normalize vyper evm version helper, fix solar iter 0.1.4 * temporarily allow compilers git patch * bump to msrv 1.87 in line with foundry-compilers * bump compilers version * bump to foundry-compilers 0.17.1
1 parent 132cb13 commit 665fc04

File tree

22 files changed

+275
-234
lines changed

22 files changed

+275
-234
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ resolver = "2"
3131
version = "1.2.2"
3232
edition = "2021"
3333
# Remember to update clippy.toml as well
34-
rust-version = "1.86"
34+
rust-version = "1.87"
3535
authors = ["Foundry Contributors"]
3636
license = "MIT OR Apache-2.0"
3737
homepage = "https://github.com/foundry-rs/foundry"
@@ -198,14 +198,14 @@ foundry-wallets = { path = "crates/wallets" }
198198
foundry-linking = { path = "crates/linking" }
199199

200200
# solc & compilation utilities
201-
foundry-block-explorers = { version = "0.17.0", default-features = false }
202-
foundry-compilers = { version = "0.16.1", default-features = false }
201+
foundry-block-explorers = { version = "0.18.0", default-features = false }
202+
foundry-compilers = { version = "0.17.1", default-features = false }
203203
foundry-fork-db = "0.15"
204204
solang-parser = { version = "=0.3.9", package = "foundry-solang-parser" }
205-
solar-ast = { version = "=0.1.3", default-features = false }
206-
solar-parse = { version = "=0.1.3", default-features = false }
207-
solar-interface = { version = "=0.1.3", default-features = false }
208-
solar-sema = { version = "=0.1.3", default-features = false }
205+
solar-ast = { version = "=0.1.4", default-features = false }
206+
solar-parse = { version = "=0.1.4", default-features = false }
207+
solar-interface = { version = "=0.1.4", default-features = false }
208+
solar-sema = { version = "=0.1.4", default-features = false }
209209

210210
## alloy
211211
alloy-consensus = { version = "1.0.7", default-features = false }
@@ -401,4 +401,5 @@ zip-extract = "=0.2.1"
401401
# revm-inspectors = { git = "https://github.com/paradigmxyz/revm-inspectors.git", rev = "a625c04" }
402402

403403
## foundry
404+
# foundry-compilers = { git = "https://github.com/foundry-rs/compilers.git", rev = "855dee4" }
404405
# foundry-fork-db = { git = "https://github.com/foundry-rs/foundry-fork-db", rev = "811a61a" }

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
msrv = "1.86"
1+
msrv = "1.87"
22

33
# `bytes::Bytes` is included by default and `alloy_primitives::Bytes` is a wrapper around it,
44
# so it is safe to ignore it as well.

crates/anvil/src/eth/backend/mem/mod.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -780,11 +780,17 @@ impl Backend {
780780

781781
/// Returns [`BlobParams`] corresponding to the current spec.
782782
pub fn blob_params(&self) -> BlobParams {
783-
if self.env.read().evm_env.cfg_env.spec >= SpecId::PRAGUE {
784-
BlobParams::prague()
785-
} else {
786-
BlobParams::cancun()
783+
let spec_id = self.env.read().evm_env.cfg_env.spec;
784+
785+
if spec_id >= SpecId::OSAKA {
786+
return BlobParams::osaka();
787787
}
788+
789+
if spec_id >= SpecId::PRAGUE {
790+
return BlobParams::prague();
791+
}
792+
793+
BlobParams::cancun()
788794
}
789795

790796
/// Returns an error if EIP1559 is not active (pre Berlin)

crates/anvil/src/eth/fees.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ pub fn calculate_next_block_base_fee(gas_used: u64, gas_limit: u64, base_fee: u6
192192

193193
/// An async service that takes care of the `FeeHistory` cache
194194
pub struct FeeHistoryService {
195+
/// blob parameters for the current spec
196+
blob_params: BlobParams,
195197
/// incoming notifications about new blocks
196198
new_blocks: NewBlockNotifications,
197199
/// contains all fee history related entries
@@ -204,11 +206,18 @@ pub struct FeeHistoryService {
204206

205207
impl FeeHistoryService {
206208
pub fn new(
209+
blob_params: BlobParams,
207210
new_blocks: NewBlockNotifications,
208211
cache: FeeHistoryCache,
209212
storage_info: StorageInfo,
210213
) -> Self {
211-
Self { new_blocks, cache, fee_history_limit: MAX_FEE_HISTORY_CACHE_SIZE, storage_info }
214+
Self {
215+
blob_params,
216+
new_blocks,
217+
cache,
218+
fee_history_limit: MAX_FEE_HISTORY_CACHE_SIZE,
219+
storage_info,
220+
}
212221
}
213222

214223
/// Returns the configured history limit
@@ -245,7 +254,8 @@ impl FeeHistoryService {
245254
let base_fee = header.base_fee_per_gas.map(|g| g as u128).unwrap_or_default();
246255
let excess_blob_gas = header.excess_blob_gas.map(|g| g as u128);
247256
let blob_gas_used = header.blob_gas_used.map(|g| g as u128);
248-
let base_fee_per_blob_gas = header.blob_fee(BlobParams::cancun());
257+
let base_fee_per_blob_gas = header.blob_fee(self.blob_params);
258+
249259
let mut item = FeeHistoryCacheItem {
250260
base_fee,
251261
gas_used_ratio: 0f64,

crates/anvil/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ use crate::{
1919
shutdown::Signal,
2020
tasks::TaskManager,
2121
};
22+
use alloy_eips::eip7840::BlobParams;
2223
use alloy_primitives::{Address, U256};
2324
use alloy_signer_local::PrivateKeySigner;
2425
use eth::backend::fork::ClientFork;
2526
use eyre::Result;
2627
use foundry_common::provider::{ProviderBuilder, RetryProvider};
2728
use futures::{FutureExt, TryFutureExt};
2829
use parking_lot::Mutex;
30+
use revm::primitives::hardfork::SpecId;
2931
use server::try_spawn_ipc;
3032
use std::{
3133
future::Future,
@@ -198,6 +200,11 @@ pub async fn try_spawn(mut config: NodeConfig) -> Result<(EthApi, NodeHandle)> {
198200

199201
let fee_history_cache = Arc::new(Mutex::new(Default::default()));
200202
let fee_history_service = FeeHistoryService::new(
203+
match backend.spec_id() {
204+
SpecId::OSAKA => BlobParams::osaka(),
205+
SpecId::PRAGUE => BlobParams::prague(),
206+
_ => BlobParams::cancun(),
207+
},
201208
backend.new_block_notifications(),
202209
Arc::clone(&fee_history_cache),
203210
StorageInfo::new(Arc::clone(&backend)),

crates/cast/src/cmd/run.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ impl RunArgs {
165165
if evm_version.is_none() {
166166
// if the block has the excess_blob_gas field, we assume it's a Cancun block
167167
if block.header.excess_blob_gas.is_some() {
168-
evm_version = Some(EvmVersion::Cancun);
168+
evm_version = Some(EvmVersion::Prague);
169169
}
170170
}
171171
apply_chain_and_block_specific_env_changes::<AnyNetwork>(env.as_env_mut(), block);

crates/cast/tests/cli/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ contract CounterInExternalLibScript is Script {
23292329
...
23302330
Traces:
23312331
[..] → new <unknown>@0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512
2332-
├─ [..] 0x52F3e85EC3F0f9D0a2200D646482fcD134D5adc9::updateCounterInExternalLib(0, 100) [delegatecall]
2332+
├─ [..] 0x6fD8bf6770F4bEe578348D24028000cE9c4D2bB9::updateCounterInExternalLib(0, 100) [delegatecall]
23332333
│ └─ ← [Stop]
23342334
└─ ← [Return] 62 bytes of code
23352335

crates/common/src/preprocessor/deps.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ impl<'hir> Visit<'hir> for BytecodeDependencyCollector<'hir> {
234234
for &var in clause.args {
235235
self.visit_nested_var(var)?;
236236
}
237-
for stmt in clause.block {
237+
for stmt in clause.block.stmts {
238238
self.visit_stmt(stmt)?;
239239
}
240240
}

crates/config/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ allow_paths = []
7979
# additional solc include paths
8080
include_paths = []
8181
force = false
82-
evm_version = 'shanghai'
82+
evm_version = 'prague'
8383
gas_reports = ['*']
8484
gas_reports_ignore = []
8585
## Sets the concrete solc version to use, this overrides the `auto_detect_solc` value

0 commit comments

Comments
 (0)