Skip to content

Commit 688e455

Browse files
grandizzymattsse
andauthored
v1.3.2 backports (#11364)
* fix(lint): explicit message when lint on build failures (#11224) * fix(lint): lint only files that we build (#11247) * fix: force 4844 txtype in blobhashes setter (#11355) * test: add blobhashes repro * fix: force 4844 tx type * fix(forge): handle error if etherscan identifier cannot resolve config (#11356) * fix(forge): handle error if etherscan identifier cannot resolve config * warn on config failures * fix: disable tx gas limit cap (#11347) * fix(forge): write ordered deps in foundry.lock (#11360) * chore: fix clippy (#11361) * chore: bump version 1.3.2 (#11363) * chore: fix cargo deny - update slab to 0.4.11 --------- Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
1 parent 08d3a4a commit 688e455

File tree

11 files changed

+230
-49
lines changed

11 files changed

+230
-49
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ members = [
2929
resolver = "2"
3030

3131
[workspace.package]
32-
version = "1.3.1"
32+
version = "1.3.2"
3333
edition = "2024"
3434
# Remember to update clippy.toml as well
3535
rust-version = "1.88"

crates/cheatcodes/src/evm.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use crate::{
77
};
88
use alloy_consensus::TxEnvelope;
99
use alloy_genesis::{Genesis, GenesisAccount};
10+
use alloy_network::eip2718::EIP4844_TX_TYPE_ID;
1011
use alloy_primitives::{Address, B256, Bytes, U256, map::HashMap};
1112
use alloy_rlp::Decodable;
1213
use alloy_sol_types::SolValue;
@@ -437,6 +438,8 @@ impl Cheatcode for blobhashesCall {
437438
see EIP-4844: https://eips.ethereum.org/EIPS/eip-4844"
438439
);
439440
ccx.ecx.tx.blob_hashes.clone_from(hashes);
441+
// force this as 4844 txtype
442+
ccx.ecx.tx.tx_type = EIP4844_TX_TYPE_ID;
440443
Ok(Default::default())
441444
}
442445
}

crates/common/src/contracts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ impl ContractsByArtifact {
308308
pub fn find_abi_by_name_or_src_path(&self, name_or_path: &str) -> Option<(JsonAbi, String)> {
309309
self.iter()
310310
.find(|(artifact, _)| {
311-
artifact.name == name_or_path || artifact.source == PathBuf::from(name_or_path)
311+
artifact.name == name_or_path || artifact.source == Path::new(name_or_path)
312312
})
313313
.map(|(_, contract)| (contract.abi.clone(), contract.name.clone()))
314314
}

crates/evm/core/src/fork/init.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,7 @@ pub fn configure_env(chain_id: u64, memory_limit: u64, disable_block_gas_limit:
9292
cfg.disable_eip3607 = true;
9393
cfg.disable_block_gas_limit = disable_block_gas_limit;
9494
cfg.disable_nonce_check = true;
95+
// For Osaka EIP-7825
96+
cfg.tx_gas_limit_cap = Some(u64::MAX);
9597
cfg
9698
}

crates/evm/traces/src/identifier/etherscan.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,19 @@ impl EtherscanIdentifier {
4444
if config.offline {
4545
return Ok(None);
4646
}
47-
let Some(config) = config.get_etherscan_config_with_chain(chain)? else {
48-
return Ok(None);
47+
48+
let config = match config.get_etherscan_config_with_chain(chain) {
49+
Ok(Some(config)) => config,
50+
Ok(None) => {
51+
warn!(target: "traces::etherscan", "etherscan config not found");
52+
return Ok(None);
53+
}
54+
Err(err) => {
55+
warn!(?err, "failed to get etherscan config");
56+
return Ok(None);
57+
}
4958
};
59+
5060
trace!(target: "traces::etherscan", chain=?config.chain, url=?config.api_url, "using etherscan identifier");
5161
Ok(Some(Self {
5262
client: Arc::new(config.into_client()?),

crates/forge/src/cmd/build.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use super::{install, watch::WatchArgs};
22
use clap::Parser;
3-
use eyre::Result;
3+
use eyre::{Result, eyre};
44
use forge_lint::{linter::Linter, sol::SolidityLinter};
55
use foundry_cli::{
66
opts::{BuildOpts, solar_pcx_from_build_opts},
@@ -112,17 +112,18 @@ impl BuildArgs {
112112
sh_println!("{}", serde_json::to_string_pretty(&output.output())?)?;
113113
}
114114

115-
// Only run the `SolidityLinter` if there are no compilation errors
116-
if output.output().errors.iter().all(|e| !e.is_error()) {
117-
self.lint(&project, &config)?;
115+
// Only run the `SolidityLinter` if lint on build and no compilation errors.
116+
if config.lint.lint_on_build && !output.output().errors.iter().any(|e| e.is_error()) {
117+
self.lint(&project, &config, self.paths.as_deref())
118+
.map_err(|err| eyre!("Lint failed: {err}"))?;
118119
}
119120

120121
Ok(output)
121122
}
122123

123-
fn lint(&self, project: &Project, config: &Config) -> Result<()> {
124+
fn lint(&self, project: &Project, config: &Config, files: Option<&[PathBuf]>) -> Result<()> {
124125
let format_json = shell::is_json();
125-
if project.compiler.solc.is_some() && config.lint.lint_on_build && !shell::is_quiet() {
126+
if project.compiler.solc.is_some() && !shell::is_quiet() {
126127
let linter = SolidityLinter::new(config.project_paths())
127128
.with_json_emitter(format_json)
128129
.with_description(!format_json)
@@ -156,6 +157,10 @@ impl BuildArgs {
156157
.project_paths::<SolcLanguage>()
157158
.input_files_iter()
158159
.filter(|p| {
160+
// Lint only specified build files, if any.
161+
if let Some(files) = files {
162+
return files.iter().any(|file| &curr_dir.join(file) == p);
163+
}
159164
skip.is_match(p)
160165
&& !(ignored.contains(p) || ignored.contains(&curr_dir.join(p)))
161166
})

0 commit comments

Comments
 (0)