Skip to content

Commit

Permalink
Merge branch 'upstream-59f354c' of github.com:matter-labs/foundry-zks…
Browse files Browse the repository at this point in the history
…ync into upstream-59f354c
  • Loading branch information
nbaztec committed Dec 23, 2024
2 parents d3cb0fc + 0e5ad05 commit e81fcec
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion crates/cheatcodes/assets/cheatcodes.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions crates/evm/core/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,13 @@ pub fn create2_handler_register<I: InspectorExt>(
let mut code_hash = ctx.evm.load_account(create2_deployer)?.info.code_hash;
// NOTE(zk): We check which deployer we are using to separate the logic for zkSync
// and original foundry.
// TODO(zk): adding this check to skip comparing to evm create2 deployer
// hash, should we compare vs zkevm one?
let mut zk_is_create2_deployer = false;
if call_inputs.target_address == DEFAULT_CREATE2_DEPLOYER_ZKSYNC {
code_hash = ctx.evm.load_account(call_inputs.target_address)?.info.code_hash;
};
zk_is_create2_deployer = true;
}
if code_hash == KECCAK_EMPTY {
return Ok(FrameOrResult::Result(FrameResult::Call(CallOutcome {
result: InterpreterResult {
Expand All @@ -229,7 +233,7 @@ pub fn create2_handler_register<I: InspectorExt>(
},
memory_offset: 0..0,
})))
} else if code_hash != DEFAULT_CREATE2_DEPLOYER_CODEHASH {
} else if code_hash != DEFAULT_CREATE2_DEPLOYER_CODEHASH && !zk_is_create2_deployer {
return Ok(FrameOrResult::Result(FrameResult::Call(CallOutcome {
result: InterpreterResult {
result: InstructionResult::Revert,
Expand Down
1 change: 1 addition & 0 deletions crates/forge/tests/it/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ impl ForgeTestProfile {
zk_config.zksync.optimizer_mode = '3';
zk_config.zksync.zksolc = Some(foundry_config::SolcReq::Version(Version::new(1, 5, 7)));
zk_config.fuzz.no_zksync_reserved_addresses = true;
zk_config.invariant.depth = 15;

zk_config
}
Expand Down
2 changes: 1 addition & 1 deletion crates/zksync/compilers/src/artifacts/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl Contract {

// CompactContract variants
// TODO: for zkEvm, the distinction between bytecode and deployed_bytecode makes little sense,
// and there some fields that the ouptut doesn't provide (e.g: source_map)
// and there some fields that the output doesn't provide (e.g: source_map)
// However, we implement these because we get the Artifact trait and can reuse lots of
// the crate's helpers without needing to duplicate everything. Maybe there's a way
// we can get all these without having to add the same bytecode twice on each struct.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ impl ZkContractArtifact {

// CompactContract variants
// TODO: for zkEvm, the distinction between bytecode and deployed_bytecode makes little sense,
// and there some fields that the ouptut doesn't provide (e.g: source_map)
// and there some fields that the output doesn't provide (e.g: source_map)
// However, we implement these because we get the Artifact trait and can reuse lots of
// the crate's helpers without needing to duplicate everything. Maybe there's a way
// we can get all these without having to add the same bytecode twice on each struct.
Expand Down
4 changes: 2 additions & 2 deletions crates/zksync/compilers/src/compilers/zksolc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ fn compiler_blocking_install(
let _lock = try_lock_file(lock_path)?;
trace!("got lock for {label}");

// Only write to file if it is not there. The check is doneafter adquiring the lock
// Only write to file if it is not there. The check is done after acquiring the lock
// to ensure the thread remains blocked until the required compiler is
// fully installed
if !compiler_path.exists() {
Expand All @@ -679,7 +679,7 @@ fn compiler_blocking_install(
response.status()
)));
}
trace!("{label} instalation completed");
trace!("{label} installation completed");
Ok(compiler_path)
})
}
Expand Down

0 comments on commit e81fcec

Please sign in to comment.