Skip to content

Commit

Permalink
Merge branch 'dev' into devops/enable-stage-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Deniallugo authored Jul 27, 2021
2 parents 153f6be + 940dfe7 commit fb6203c
Show file tree
Hide file tree
Showing 38 changed files with 1,189 additions and 1,200 deletions.
2,224 changes: 1,105 additions & 1,119 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,5 @@ members = [
]

[patch.crates-io]
ethabi = { git = "https://github.com/dvush/ethabi.git" }
web3 = { git = "https://github.com/Deniallugo/rust-web3", branch = "update_ethabi"}

4 changes: 2 additions & 2 deletions core/bin/block_revert/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zksync_eth_client = { path = "../../lib/eth_client", version = "1.0" }
zksync_config = { path = "../../lib/config", version = "1.0" }

tokio = { version = "0.2", features = ["full"] }
ethabi = "12.0.0"
ethabi = "14.0.0"
anyhow = "1.0"
web3 = "0.13.0"
web3 = "0.15.0"
structopt = "0.3.20"
6 changes: 3 additions & 3 deletions core/bin/data_restore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ vlog = { path = "../../lib/vlog", version = "1.0" }

num = { version = "0.3.1", features = ["serde"] }
tiny-keccak = "1.4.2"
ethabi = "12.0.0"
web3 = "0.13.0"
ethabi = "14.0.0"
web3 = "0.15.0"
hex = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0.0"
Expand All @@ -38,6 +38,6 @@ zksync_config = { path = "../../lib/config", version = "1.0" }
zksync_contracts = { path = "../../lib/contracts", version = "1.0" }

[dev-dependencies]
jsonrpc-core = "14.0.0"
jsonrpc-core = "16.0.0"
db_test_macro = { path = "../../lib/storage/db_test_macro" }
futures = "0.3.5"
30 changes: 15 additions & 15 deletions core/bin/data_restore/src/contract/v4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ use zksync_types::{AccountId, BlockNumber, H256};

fn decode_commitment_parameters(input_data: Vec<u8>) -> anyhow::Result<Vec<Token>> {
let commit_operation = ParamType::Tuple(vec![
Box::new(ParamType::FixedBytes(32)), // bytes32 encoded_root,
Box::new(ParamType::Bytes), // bytes calldata _publicData,
Box::new(ParamType::Uint(256)), // uint256 _timestamp,
Box::new(ParamType::Array(Box::new(ParamType::Tuple(vec![
Box::new(ParamType::Bytes), // bytes eht_witness
Box::new(ParamType::Uint(32)), //uint32 public_data_offset
])))),
Box::new(ParamType::Uint(32)), // uint32 _blockNumber,
Box::new(ParamType::Uint(32)), // uint32 _feeAccount,
ParamType::FixedBytes(32), // bytes32 encoded_root,
ParamType::Bytes, // bytes calldata _publicData,
ParamType::Uint(256), // uint256 _timestamp,
ParamType::Array(Box::new(ParamType::Tuple(vec![
ParamType::Bytes, // bytes eht_witness
ParamType::Uint(32), //uint32 public_data_offset
]))),
ParamType::Uint(32), // uint32 _blockNumber,
ParamType::Uint(32), // uint32 _feeAccount,
]);
let stored_block = ParamType::Tuple(vec![
Box::new(ParamType::Uint(32)), // uint32 blockNumber
Box::new(ParamType::Uint(64)), // uint32 priorityOperations
Box::new(ParamType::FixedBytes(32)), // bytes32 pendingOnchainOperationsHash
Box::new(ParamType::Uint(256)), // uint256 timestamp
Box::new(ParamType::FixedBytes(32)), // bytes32 stateHash
Box::new(ParamType::FixedBytes(32)), // bytes32 commitment
(ParamType::Uint(32)), // uint32 blockNumber
(ParamType::Uint(64)), // uint32 priorityOperations
(ParamType::FixedBytes(32)), // bytes32 pendingOnchainOperationsHash
(ParamType::Uint(256)), // uint256 timestamp
(ParamType::FixedBytes(32)), // bytes32 stateHash
(ParamType::FixedBytes(32)), // bytes32 commitment
]);
ethabi::decode(
vec![stored_block, ParamType::Array(Box::new(commit_operation))].as_slice(),
Expand Down
4 changes: 2 additions & 2 deletions core/bin/prover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ zksync_prover_utils = { path = "../../lib/prover_utils", version = "1.0" }

hex = "0.4"
rust-crypto = "0.2"
web3 = "0.13.0"
web3 = "0.15.0"
tokio = { version = "0.2", features = ["full"] }
async-trait = "0.1"
futures = "0.3"
Expand All @@ -33,7 +33,7 @@ serde = "1.0.90"
serde_json = "1.0.0"
num = { version = "0.3.1", features = ["serde"] }
chrono = { version = "0.4", features = ["serde", "rustc-serialize"] }
reqwest = { version = "0.10", features = ["blocking", "json"] }
reqwest = { version = "0.10.0", features = ["blocking", "json"] }
jsonwebtoken = "7"
anyhow = "1.0"
backoff = { version = "0.2.1", features = ["tokio"] }
Expand Down
8 changes: 4 additions & 4 deletions core/bin/zksync_api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ zksync_gateway_watcher = { path = "../../lib/gateway_watcher", version = "1.0" }
vlog = { path = "../../lib/vlog", version = "1.0", features=['actix'] }

hex = "0.4"
ethabi = "12.0.0"
web3 = "0.13.0"
ethabi = "14.0.0"
web3 = "0.15.0"
serde = "1.0.90"
serde_json = "1.0.0"
serde_repr = "0.1"
itertools = "0.8"
jsonrpc-core = "14.0.3"
jsonrpc-core = "14.0"
jsonrpc-core-client = {version= "14.0.3", features=["ws", "http"]}
jsonrpc-pubsub = "14.0.3"
jsonrpc-ws-server = "14.0.3"
Expand All @@ -64,7 +64,7 @@ thiserror = "1.0"
structopt = "0.3"
# TODO: should be removed after json rpc deps are updated is updated, current version (14.0) (ZKS-98).
futures01 = { package = "futures", version = "0.1" }
reqwest = { version = "0.10", features = ["blocking", "json"] }
reqwest = { version = "0.10.0", features = ["blocking", "json"] }
tiny-keccak = "1.4.2"
async-trait = "0.1"
jsonwebtoken = "7"
Expand Down
6 changes: 3 additions & 3 deletions core/bin/zksync_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ zksync_gateway_watcher = { path = "../../lib/gateway_watcher", version = "1.0" }

num = { version = "0.3.1", features = ["serde"] }

ethabi = "12.0.0"
web3 = "0.13.0"
ethabi = "14.0.0"
web3 = "0.15.0"
serde = "1.0.90"
serde_json = "1.0.0"
metrics = "=0.13.0-alpha.8"
Expand All @@ -42,7 +42,7 @@ tokio = { version = "0.2", features = ["time"] }
futures = "0.3"
actix-rt = "1.1.1"
actix-web = "3.0.0"
reqwest = { version = "0.10", features = ["blocking", "json"] }
reqwest = { version = "0.10.0", features = ["blocking", "json"] }
chrono = { version = "0.4", features = ["serde", "rustc-serialize"] }
ctrlc = { version = "3.1", features = ["termination"] }
anyhow = "1.0"
Expand Down
4 changes: 2 additions & 2 deletions core/bin/zksync_eth_sender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ zksync_prometheus_exporter = { path = "../../lib/prometheus_exporter", version =
zksync_gateway_watcher = { path = "../../lib/gateway_watcher", version = "1.0" }

hex = "0.4"
ethabi = "12.0.0"
web3 = "0.13.0"
ethabi = "14.0.0"
web3 = "0.15.0"
serde = "1.0.90"
serde_json = "1.0.0"
metrics = "=0.13.0-alpha.8"
Expand Down
4 changes: 2 additions & 2 deletions core/bin/zksync_forced_exit_requests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ vlog = { path = "../../lib/vlog", version = "1.0" }
zksync_core = { path = "../zksync_core", version = "1.0" }
zksync_api = { path = "../zksync_api", version = "1.0" }
actix-web = "3.0.0"
ethabi = "12.0.0"
web3 = "0.13.0"
ethabi = "14.0.0"
web3 = "0.15.0"
log = "0.4"
hex = "0.4"
metrics = "0.13.0-alpha.8"
Expand Down
2 changes: 1 addition & 1 deletion core/bin/zksync_witness_generator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ async-trait = "0.1.42"
zksync_prover = { path = "../prover", version = "1.0" }
num = { version = "0.3.1", features = ["serde"] }
chrono = { version = "0.4", features = ["serde"] }
reqwest = { version = "0.10", features = ["blocking"] }
reqwest = { version = "0.10.0", features = ["blocking"] }
2 changes: 1 addition & 1 deletion core/lib/api_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ zksync_config = { path = "../config", version = "1.0" }
serde = "1.0.90"
serde_json = "1.0.0"
chrono = { version = "0.4", features = ["serde", "rustc-serialize"] }
reqwest = { version = "0.10", features = ["blocking", "json"] }
reqwest = { version = "0.10.0", features = ["blocking", "json"] }
thiserror = "1.0"
bigdecimal = { version = "0.2.0", features = ["serde"]}
hex = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion core/lib/basic_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ keywords = ["blockchain", "zksync"]
categories = ["cryptography"]

[dependencies]
web3 = "0.13.0"
web3 = "0.15.0"
serde = { version = "1.0", features = ["derive"] }
2 changes: 1 addition & 1 deletion core/lib/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ keywords = ["blockchain", "zksync"]
categories = ["cryptography"]

[dependencies]
ethabi = "12.0.0"
ethabi = "14.0.0"
serde_json = "1.0"
2 changes: 1 addition & 1 deletion core/lib/crypto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ rescue_poseidon = { package = "rescue_poseidon", version = "0.3.0", git = "https

num = { version = "0.3.1", features = ["serde"] }
zksync_basic_types = { path = "../basic_types", version = "1.0" }
ethabi = "12.0.0"
ethabi = "14.0.0"

serde = "1.0"
thiserror = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions core/lib/eth_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ zksync_contracts = { path = "../contracts", version = "1.0" }
vlog = { path = "../../lib/vlog", version = "1.0" }

serde = "1.0.90"
ethabi = "12.0.0"
web3 = "0.13.0"
parity-crypto = {version = "0.6.2", features = ["publickey"] }
ethabi = "14.0.0"
web3 = "0.15.0"
parity-crypto = {version = "0.8.0", features = ["publickey"] }
hex = "0.4"

anyhow = "1.0"
Expand Down
1 change: 0 additions & 1 deletion core/lib/eth_client/src/clients/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,6 @@ impl<S: EthereumSigner> ETHDirectClient<S> {
.next()
.unwrap()
.to_string()
.unwrap()
} else {
"unknown".to_string()
};
Expand Down
8 changes: 4 additions & 4 deletions core/lib/eth_signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ serde_derive = "1.0.90"
serde_json = "1.0.0"
hex = "0.4.2"

parity-crypto = {version = "0.6.2", features = ["publickey"] }
rlp = "0.4.0"
parity-crypto = {version = "0.8.0", features = ["publickey"] }
rlp = "0.5.0"

reqwest = { version = "0.10", features = ["json", "blocking"] }
reqwest = { version = "0.10.0", features = ["json", "blocking"] }
thiserror = "1.0"

jsonrpc-core = "14.0.3"
jsonrpc-core = "14.0"
async-trait = "0.1"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion core/lib/eth_signer/src/raw_ethereum_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl RawTransaction {
let s = &signature.s[s_start..];
tx.append(&s);
tx.finalize_unbounded_list();
tx.out()
tx.out().to_vec()
}

pub fn hash(&self) -> [u8; 32] {
Expand Down
2 changes: 1 addition & 1 deletion core/lib/gateway_watcher/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ zksync_utils = { path = "../../lib/utils", version = "1.0" }
thiserror = "1.0"
futures = "0.3"
vlog = { path = "../../lib/vlog", version = "1.0" }
web3 = "0.13.0"
web3 = "0.15.0"
tokio = { version = "0.2", features = ["rt-core"] }
metrics = "=0.13.0-alpha.8"
2 changes: 1 addition & 1 deletion core/lib/notifier/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serde_json = "1.0.0"
anyhow = "1.0"
futures = "0.3"
hex = "0.4"
reqwest = { version = "0.10", features = ["blocking", "json"] }
reqwest = { version = "0.10.0", features = ["blocking", "json"] }

[dev-dependencies]
serde_json = "1.0.0"
2 changes: 1 addition & 1 deletion core/lib/prover_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ zksync_config = { path = "../config", version = "1.0" }
lazy_static = "1.2.0"
anyhow = "1.0"
backoff = "0.1.6"
reqwest = { version = "0.10.6", features = ["blocking"] }
reqwest = { version = "0.10.0", features = ["blocking"] }
serde = "1.0"
serde_json = "1.0"
num = { version = "0.3.1", features = ["serde"] }
Expand Down
2 changes: 1 addition & 1 deletion core/lib/state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ serde_json = "1.0"

[dev-dependencies]
criterion = "0.3.0"
web3 = "0.13.0"
web3 = "0.15.0"

[[bench]]
name = "criterion"
Expand Down
2 changes: 1 addition & 1 deletion core/lib/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ once_cell = "1.4"
itertools = "0.8"
hex = "0.4"
metrics = "=0.13.0-alpha.8"
parity-crypto = { version = "0.6.2", features = ["publickey"] }
parity-crypto = { version = "0.8.0", features = ["publickey"] }

vlog = { path = "../../lib/vlog", version = "1.0" }

Expand Down
6 changes: 3 additions & 3 deletions core/lib/types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ serde_json = "1.0.0"
serde_with = "1.8.0"

# Crypto stuff
parity-crypto = { version = "0.6.2", features = ["publickey"] }
ethabi = "12.0.0"
parity-crypto = { version = "0.8.0", features = ["publickey"] }
ethabi = "14.0.0"

[dev-dependencies]
criterion = "0.3.0"
web3 = "0.13.0"
web3 = "0.15.0"
secp256k1 = { version = "0.17.2", features = ["std", "recovery"] }

[[bench]]
Expand Down
4 changes: 2 additions & 2 deletions core/lib/types/src/ethereum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,13 @@ impl TryFrom<Log> for CompleteWithdrawalsTx {
.ok_or(CompleteWithdrawalsTxParseError::TransactionHashMissing)?,
pending_withdrawals_queue_start_index: decoded_event
.remove(0)
.to_uint()
.into_uint()
.as_ref()
.map(U256::as_u32)
.ok_or(CompleteWithdrawalsTxParseError::PendingWithdrawalsQueueStartConversion)?,
pending_withdrawals_queue_end_index: decoded_event
.remove(0)
.to_uint()
.into_uint()
.as_ref()
.map(U256::as_u32)
.ok_or(CompleteWithdrawalsTxParseError::PendingWithdrawalsQueueEndConversion)?,
Expand Down
2 changes: 1 addition & 1 deletion core/lib/types/src/forced_exit_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ impl TryFrom<Log> for FundsReceivedEvent {
&event.data.0,
)?;

let amount = dec_ev.remove(0).to_uint().unwrap();
let amount = dec_ev.remove(0).into_uint().unwrap();
let block_number = event
.block_number
.ok_or(FundsReceivedEventParseError::UnfinalizedBlockAccess)?
Expand Down
10 changes: 5 additions & 5 deletions core/lib/types/src/priority_ops/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,22 +379,22 @@ impl TryFrom<Log> for PriorityOp {
&event.data.0,
)?;

let sender = dec_ev.remove(0).to_address().unwrap();
let sender = dec_ev.remove(0).into_address().unwrap();
Ok(PriorityOp {
serial_id: dec_ev
.remove(0)
.to_uint()
.into_uint()
.as_ref()
.map(U256::as_u64)
.unwrap(),
data: {
let op_type = dec_ev
.remove(0)
.to_uint()
.into_uint()
.as_ref()
.map(|ui| U256::as_u32(ui) as u8)
.unwrap();
let op_pubdata = dec_ev.remove(0).to_bytes().unwrap();
let op_pubdata = dec_ev.remove(0).into_bytes().unwrap();
let result =
ZkSyncPriorityOp::parse_from_priority_queue_logs(&op_pubdata, op_type, sender);

Expand All @@ -410,7 +410,7 @@ impl TryFrom<Log> for PriorityOp {
},
deadline_block: dec_ev
.remove(0)
.to_uint()
.into_uint()
.as_ref()
.map(U256::as_u64)
.unwrap(),
Expand Down
2 changes: 1 addition & 1 deletion core/lib/types/src/register_factory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ impl TryFrom<Log> for RegisterNFTFactoryEvent {
)
.map_err(RegisterNFTFactoryEventParseError::ParseError)?;
let creator_address = Address::from_slice(&event.topics[2].as_fixed_bytes()[12..]);
let factory_address = decoded_event.remove(0).to_address().unwrap();
let factory_address = decoded_event.remove(0).into_address().unwrap();
Ok(Self {
factory_address,
creator_address,
Expand Down
2 changes: 1 addition & 1 deletion core/tests/loadnext/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ num = { version = "0.3.1", features = ["serde"] }
tokio = { version = "0.2", features = ["full"] }
futures = "0.3"
anyhow = "1.0"
rand = { version = "0.7", features = ["small_rng"] }
rand = { version = "0.8", features = ["small_rng"] }
envy = "0.4"
hex = "0.4"
static_assertions = "1.1"
Expand Down
2 changes: 1 addition & 1 deletion core/tests/loadnext/src/account_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl AddressPool {

/// Randomly chooses one of the addresses stored in the pool.
pub fn random_address(&self, rng: &mut LoadtestRng) -> Address {
let index = rng.gen_range(0, self.addresses.len());
let index = rng.gen_range(0..self.addresses.len());
self.addresses[index]
}
}
Expand Down
Loading

0 comments on commit fb6203c

Please sign in to comment.