Skip to content
This repository was archived by the owner on Jul 5, 2024. It is now read-only.

Commit e9eb6f2

Browse files
Fix #1451, option 1: Simply upgrade ethers (#1452)
### Description Change ethers-rs related packages from 0.17.0 to 2.0.7 ### Issue Link #1451 ### Type of change - [x] New feature (non-breaking change which adds functionality) ### Rationale We need nothing more than simply upgrading the package.
1 parent 3733326 commit e9eb6f2

File tree

19 files changed

+1205
-1137
lines changed

19 files changed

+1205
-1137
lines changed

Cargo.lock

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

bus-mapping/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ eth-types = { path = "../eth-types" }
1010
gadgets = { path = "../gadgets" }
1111
mock = { path = "../mock", optional = true }
1212

13-
ethers-core = "0.17.0"
14-
ethers-providers = "0.17.0"
13+
ethers-core = "2.0.7"
14+
ethers-providers = "2.0.7"
1515
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_04_20" }
1616
itertools = "0.10"
1717
lazy_static = "1.4"

bus-mapping/src/circuit_input_builder/input_state_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ impl<'a> CircuitInputStateRef<'a> {
716716
let init_code = get_create_init_code(call_ctx, step)?.to_vec();
717717
Ok(get_create2_address(
718718
self.call()?.address,
719-
salt.to_be_bytes().to_vec(),
719+
salt.to_be_bytes(),
720720
init_code,
721721
))
722722
}

bus-mapping/src/evm/opcodes/create.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<const IS_CREATE2: bool> Opcode for Create<IS_CREATE2> {
183183
address,
184184
get_create2_address(
185185
caller.address,
186-
salt.to_be_bytes().to_vec(),
186+
salt.to_be_bytes(),
187187
initialization_code.clone(),
188188
)
189189
);

bus-mapping/src/state_db.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ impl From<geth_types::Account> for Account {
7373
nonce: account.nonce.as_u64(),
7474
balance: account.balance,
7575
storage: account.storage.clone(),
76-
code_hash: CodeDB::hash(&account.code.to_vec()),
76+
code_hash: CodeDB::hash(&account.code),
7777
}
7878
}
7979
}

circuit-benchmarks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ rand = "0.8"
1616
itertools = "0.10"
1717
eth-types = { path = "../eth-types" }
1818
env_logger = "0.9"
19-
ethers-signers = "0.17.0"
19+
ethers-signers = "2.0.7"
2020
mock = { path="../mock" }
2121
rand_chacha = "0.3"
2222

eth-types/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ authors = ["The appliedzkp team"]
66
license = "MIT OR Apache-2.0"
77

88
[dependencies]
9-
ethers-core = "0.17.0"
10-
ethers-signers = "0.17.0"
9+
ethers-core = "2.0.7"
10+
ethers-signers = "2.0.7"
1111
hex = "0.4"
1212
lazy_static = "1.4"
1313
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_04_20" }

eth-types/src/geth_types.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,9 @@ impl GethData {
318318
assert_eq!(Word::from(wallet.chain_id()), self.chain_id);
319319
let geth_tx: Transaction = (&*tx).into();
320320
let req: TransactionRequest = (&geth_tx).into();
321-
let sig = wallet.sign_transaction_sync(&req.chain_id(self.chain_id.as_u64()).into());
321+
let sig = wallet
322+
.sign_transaction_sync(&req.chain_id(self.chain_id.as_u64()).into())
323+
.unwrap();
322324
tx.v = U64::from(sig.v);
323325
tx.r = sig.r;
324326
tx.s = sig.s;

integration-tests/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
88

99
[dependencies]
1010
lazy_static = "1.4"
11-
ethers = { version = "0.17.0", features = ["ethers-solc"] }
11+
ethers = { version = "2.0.7", features = ["ethers-solc"] }
1212
serde_json = "1.0.66"
1313
serde = { version = "1.0.130", features = ["derive"] }
1414
bus-mapping = { path = "../bus-mapping" , features = ["test"] }

integration-tests/src/bin/gen_blockchain_data.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use ethers::{
1111
middleware::SignerMiddleware,
1212
providers::{Middleware, PendingTransaction},
1313
signers::Signer,
14-
solc::Solc,
14+
solc::{CompilerInput, EvmVersion, Solc},
1515
};
1616
use integration_tests::{
1717
get_client, get_provider, get_wallet, log_init, CompiledContract, GenDataOutput, CONTRACTS,
@@ -75,11 +75,23 @@ async fn main() {
7575

7676
// Compile contracts
7777
info!("Compiling contracts...");
78+
let solc = Solc::default();
79+
info!("Solc version {}", solc.version().expect("version works"));
7880
let mut contracts = HashMap::new();
7981
for (name, contract_path) in CONTRACTS {
8082
let path_sol = Path::new(CONTRACTS_PATH).join(contract_path);
81-
let compiled = Solc::default()
82-
.compile_source(&path_sol)
83+
let inputs = CompilerInput::new(&path_sol).expect("Compile success");
84+
// ethers-solc: explicitly indicate the EvmVersion that corresponds to the zkevm circuit's
85+
// supported Upgrade, e.g. `London/Shanghai/...` specifications.
86+
let input = inputs
87+
.clone()
88+
.first_mut()
89+
.expect("first exists")
90+
.clone()
91+
.evm_version(EvmVersion::London);
92+
93+
let compiled = solc
94+
.compile(&input)
8395
.unwrap_or_else(|_| panic!("solc compile error {:?}", path_sol));
8496
if !compiled.errors.is_empty() {
8597
panic!("Errors compiling {:?}:\n{:#?}", &path_sol, compiled.errors)

0 commit comments

Comments
 (0)