Skip to content

Commit

Permalink
refactor: Switch core workspace to using workspace deps (matter-labs#…
Browse files Browse the repository at this point in the history
…1485)

## What ❔

Switches core workspace to using workspace deps.

⚠️ No-nitpick-territory ⚠️ 
During review, please focus on the fact that this should be an
incremental improvement. This PR was _**painful**_ to prepare, and I
would like to merge it ASAP, since it's also likely to get merge
conflicts. If there are non-critical comments, I'll try to address them
in follow-up PRs. I've touched a lot of code that was in imperfect state
before, and now it's in the diff (for example, incorrectly set features
for crates), and maybe some things I've done aren't as pretty as they
can be -- but IMHO the switch to using workspace deps has enough value
to merge it without addressing all and every minor thing beforehand.

Feel free to leave as many comments as you have to, but it'd be great if
they will still come with a ✅ unless I really broke something here.

## Why ❔

- Soft prerequisite for publishing on crates.io.
- More convenient.
- More modern.
- No need to worry that some dependency has multiple versions across
different crates.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
- [ ] Spellcheck has been run via `zk spellcheck`.
- [ ] Linkcheck has been run via `zk linkcheck`.
  • Loading branch information
popzxc authored Mar 25, 2024
1 parent c7c7356 commit 1245005
Show file tree
Hide file tree
Showing 52 changed files with 1,254 additions and 1,192 deletions.
307 changes: 77 additions & 230 deletions Cargo.lock

Large diffs are not rendered by default.

150 changes: 150 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,153 @@ exclude = []
[profile.perf]
inherits = "release"
debug = true

[workspace.package]
version = "0.1.0"
edition = "2021"
authors = ["The Matter Labs Team <[email protected]>"]
homepage = "https://zksync.io/"
repository = "https://github.com/matter-labs/zksync-era"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
categories = ["cryptography"]

[workspace.dependencies]
# "External" dependencies
anyhow = "1"
assert_matches = "1.5"
async-trait = "0.1"
axum = "0.6.19"
bigdecimal = "0.3.0"
bincode = "1"
bitflags = "1.3.2"
blake2 = "0.10"
chrono = "0.4"
clap = "4.2.2"
codegen = "0.2.0"
criterion = "0.4.0"
ctrlc = "3.1"
envy = "0.4"
ethabi = "18.0.0"
flate2 = "1.0.28"
futures = "0.3"
google-cloud-auth = "0.13.0"
google-cloud-storage = "0.15.0"
governor = "0.4.2"
hex = "0.4"
http = "0.2.9"
iai = "0.1"
insta = "1.29.0"
itertools = "0.10"
jsonrpc-core = "18"
jsonrpsee = { version = "0.21.0", default-features = false }
lazy_static = "1.4"
leb128 = "0.2.5"
lru = { version = "0.12.1", default-features = false }
metrics = "0.21"
metrics-exporter-prometheus = "0.12"
mini-moka = "0.10.0"
num = "0.4.0"
num_cpus = "1.13"
num_enum = "0.7.2"
once_cell = "1"
pin-project-lite = "0.2.13"
pretty_assertions = "1"
prost = "0.12.1"
rand = "0.8"
rayon = "1.3.1"
regex = "1"
reqwest = "0.11"
rlp = "0.5"
rocksdb = "0.21.0"
secp256k1 = "0.27.0"
semver = "1"
sentry = "0.31"
serde = "1"
serde_derive = "1.0.90"
serde_json = "1"
serde_with = "1"
serde_yaml = "0.9"
sha2 = "0.10.8"
sha3 = "0.10.8"
sqlx = "0.7.3"
static_assertions = "1.1"
structopt = "0.3.20"
strum = "0.24"
tempdir = "0.3.7"
tempfile = "3.0.2"
test-casing = "0.1.2"
thiserror = "1"
thread_local = "1.1"
tikv-jemallocator = "0.5"
tokio = "1"
tower = "0.4.13"
tower-http = "0.4.1"
tracing = "0.1"
tracing-subscriber = "0.3"
url = "2"
web3 = "0.19.0"

# "Internal" dependencies
circuit_sequencer_api = { package = "circuit_sequencer_api", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.2" }
circuit_sequencer_api_1_3_3 = { package = "circuit_sequencer_api", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.3.3" }
circuit_sequencer_api_1_4_0 = { package = "circuit_sequencer_api", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.0" }
circuit_sequencer_api_1_4_1 = { package = "circuit_sequencer_api", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.1" }
circuit_sequencer_api_1_4_2 = { package = "circuit_sequencer_api", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.2" }
crypto_codegen = { package = "codegen", git = "https://github.com/matter-labs/solidity_plonk_verifier.git", branch = "dev" }
kzg = { package = "kzg", git = "https://github.com/matter-labs/era-zkevm_test_harness.git", branch = "v1.4.2" }
vise = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "1c9cc500e92cf9ea052b230e114a6f9cce4fb2c1" }
vise-exporter = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "1c9cc500e92cf9ea052b230e114a6f9cce4fb2c1" }
zk_evm = { git = "https://github.com/matter-labs/era-zk_evm.git", tag = "v1.3.3-rc2" }
zk_evm_1_3_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag = "v1.3.1-rc2" }
zk_evm_1_3_3 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", tag = "v1.3.3-rc2" }
zk_evm_1_4_0 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.0" }
zk_evm_1_4_1 = { package = "zk_evm", git = "https://github.com/matter-labs/era-zk_evm.git", branch = "v1.4.1" }
zksync_concurrency = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_bft = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_crypto = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_executor = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_network = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_roles = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_storage = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_utils = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_protobuf = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_protobuf_build = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }

# "Local" dependencies
multivm = { path = "core/lib/multivm" }
prometheus_exporter = { path = "core/lib/prometheus_exporter" }
prover_dal = { path = "prover/prover_dal" }
vlog = { path = "core/lib/vlog" }
vm_utils = { path = "core/lib/vm_utils" }
vm-benchmark-harness = { path = "core/tests/vm-benchmark/harness" }
zksync = { path = "sdk/zksync-rs" }
zksync_basic_types = { path = "core/lib/basic_types" }
zksync_circuit_breaker = { path = "core/lib/circuit_breaker" }
zksync_commitment_utils = { path = "core/lib/commitment_utils" }
zksync_config = { path = "core/lib/config" }
zksync_contracts = { path = "core/lib/contracts" }
zksync_core = { path = "core/lib/zksync_core" }
zksync_crypto = { path = "core/lib/crypto" }
zksync_dal = { path = "core/lib/dal" }
zksync_db_connection = { path = "core/lib/db_connection" }
zksync_env_config = { path = "core/lib/env_config" }
zksync_eth_client = { path = "core/lib/eth_client" }
zksync_eth_signer = { path = "core/lib/eth_signer" }
zksync_health_check = { path = "core/lib/health_check" }
zksync_l1_contract_interface = { path = "core/lib/l1_contract_interface" }
zksync_mempool = { path = "core/lib/mempool" }
zksync_merkle_tree = { path = "core/lib/merkle_tree" }
zksync_mini_merkle_tree = { path = "core/lib/mini_merkle_tree" }
zksync_object_store = { path = "core/lib/object_store" }
zksync_protobuf_config = { path = "core/lib/protobuf_config" }
zksync_prover_interface = { path = "core/lib/prover_interface" }
zksync_queued_job_processor = { path = "core/lib/queued_job_processor" }
zksync_snapshots_applier = { path = "core/lib/snapshots_applier" }
zksync_state = { path = "core/lib/state" }
zksync_storage = { path = "core/lib/storage" }
zksync_system_constants = { path = "core/lib/constants" }
zksync_test_account = { path = "core/tests/test_account" }
zksync_types = { path = "core/lib/types" }
zksync_utils = { path = "core/lib/utils" }
zksync_web3_decl = { path = "core/lib/web3_decl" }
38 changes: 19 additions & 19 deletions core/bin/block_reverter/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
[package]
name = "block_reverter"
version = "0.1.0"
edition = "2021"
authors = ["The Matter Labs Team <[email protected]>"]
homepage = "https://zksync.io/"
repository = "https://github.com/matter-labs/zksync-era"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
categories = ["cryptography"]
publish = false # We don't want to publish our binaries.
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]
zksync_config = { path = "../../lib/config" }
zksync_env_config = { path = "../../lib/env_config" }
zksync_dal = { path = "../../lib/dal" }
zksync_types = { path = "../../lib/types" }
zksync_core = { path = "../../lib/zksync_core" }
vlog = { path = "../../lib/vlog" }
zksync_config.workspace = true
zksync_env_config.workspace = true
zksync_dal.workspace = true
zksync_types.workspace = true
zksync_core.workspace = true
vlog.workspace = true

anyhow = "1.0"
clap = { version = "4.2.4", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
serde_json = "1.0"
anyhow.workspace = true
clap = { workspace = true, features = ["derive"] }
tokio = { workspace = true, features = ["full"] }
serde_json.workspace = true
66 changes: 33 additions & 33 deletions core/bin/contract-verifier/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[package]
name = "zksync_contract_verifier"
version = "0.1.0"
edition = "2018"
authors = ["The Matter Labs Team <[email protected]>"]
homepage = "https://zksync.io/"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
categories = ["cryptography"]
description = "The zkEVM contract verifier"
publish = false # We don't want to publish our binaries.
version.workspace = true
edition.workspace = true
authors.workspace = true
homepage.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]
zksync_types = { path = "../../lib/types" }
zksync_dal = { path = "../../lib/dal" }
zksync_env_config = { path = "../../lib/env_config" }
zksync_config = { path = "../../lib/config" }
zksync_contracts = { path = "../../lib/contracts" }
zksync_queued_job_processor = { path = "../../lib/queued_job_processor" }
zksync_utils = { path = "../../lib/utils" }
prometheus_exporter = { path = "../../lib/prometheus_exporter" }
vlog = { path = "../../lib/vlog" }
zksync_types.workspace = true
zksync_dal.workspace = true
zksync_env_config.workspace = true
zksync_config.workspace = true
zksync_contracts.workspace = true
zksync_queued_job_processor.workspace = true
zksync_utils.workspace = true
prometheus_exporter.workspace = true
vlog.workspace = true

anyhow = "1.0"
tokio = { version = "1", features = ["full"] }
futures = { version = "0.3", features = ["compat"] }
ctrlc = { version = "3.1", features = ["termination"] }
thiserror = "1.0"
chrono = "0.4"
serde_json = "1.0"
ethabi = "18.0.0"
metrics = "0.21"
hex = "0.4"
serde = { version = "1.0", features = ["derive"] }
structopt = "0.3.20"
lazy_static = "1.4"
tempfile = "3.0.2"
regex = "1"
tracing = "0.1"
anyhow.workspace = true
tokio = { workspace = true, features = ["full"] }
futures.workspace = true
ctrlc.workspace = true
thiserror.workspace = true
chrono.workspace = true
serde_json.workspace = true
ethabi.workspace = true
metrics.workspace = true
hex.workspace = true
serde = { workspace = true, features = ["derive"] }
structopt.workspace = true
lazy_static.workspace = true
tempfile.workspace = true
regex.workspace = true
tracing.workspace = true
76 changes: 38 additions & 38 deletions core/bin/external_node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,45 +1,45 @@
[package]
name = "zksync_external_node"
version = "0.1.0"
edition = "2021"
authors = ["The Matter Labs Team <[email protected]>"]
homepage = "https://zksync.io/"
repository = "https://github.com/matter-labs/zksync-era"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
categories = ["cryptography"]
publish = false # We don't want to publish our binaries.
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]
zksync_core = { path = "../../lib/zksync_core" }
zksync_dal = { path = "../../lib/dal" }
zksync_db_connection = { path = "../../lib/db_connection" }
zksync_config = { path = "../../lib/config" }
zksync_storage = { path = "../../lib/storage" }
zksync_utils = { path = "../../lib/utils" }
zksync_state = { path = "../../lib/state" }
zksync_basic_types = { path = "../../lib/basic_types" }
zksync_contracts = { path = "../../lib/contracts" }
zksync_l1_contract_interface = { path = "../../lib/l1_contract_interface" }
zksync_snapshots_applier = { path = "../../lib/snapshots_applier" }
zksync_object_store = { path = "../../lib/object_store" }
prometheus_exporter = { path = "../../lib/prometheus_exporter" }
zksync_health_check = { path = "../../lib/health_check" }
zksync_web3_decl = { path = "../../lib/web3_decl" }
zksync_types = { path = "../../lib/types" }
vlog = { path = "../../lib/vlog" }
zksync_core.workspace = true
zksync_dal.workspace = true
zksync_db_connection.workspace = true
zksync_config.workspace = true
zksync_storage.workspace = true
zksync_utils.workspace = true
zksync_state.workspace = true
zksync_basic_types.workspace = true
zksync_contracts.workspace = true
zksync_l1_contract_interface.workspace = true
zksync_snapshots_applier.workspace = true
zksync_object_store.workspace = true
prometheus_exporter.workspace = true
zksync_health_check.workspace = true
zksync_web3_decl.workspace = true
zksync_types.workspace = true
vlog.workspace = true

zksync_concurrency = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
zksync_consensus_roles = { version = "0.1.0", git = "https://github.com/matter-labs/era-consensus.git", rev = "5329a809cfc06d4939fb5ece26c9ad1e1741c50a" }
vise = { git = "https://github.com/matter-labs/vise.git", version = "0.1.0", rev = "1c9cc500e92cf9ea052b230e114a6f9cce4fb2c1" }
zksync_concurrency.workspace = true
zksync_consensus_roles.workspace = true
vise.workspace = true

anyhow = "1.0"
tokio = { version = "1", features = ["full"] }
futures = "0.3"
serde = { version = "1.0", features = ["derive"] }
envy = "0.4"
url = "2.4"
clap = { version = "4.2.4", features = ["derive"] }
serde_json = "1"
semver = "1"
tracing = "0.1"
anyhow.workspace = true
tokio = { workspace = true, features = ["full"] }
futures.workspace = true
serde = { workspace = true, features = ["derive"] }
envy.workspace = true
url.workspace = true
clap = { workspace = true, features = ["derive"] }
serde_json.workspace = true
semver.workspace = true
tracing.workspace = true
34 changes: 17 additions & 17 deletions core/bin/merkle_tree_consistency_checker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[package]
name = "merkle_tree_consistency_checker"
version = "0.1.0"
edition = "2021"
authors = ["The Matter Labs Team <[email protected]>"]
homepage = "https://zksync.io/"
repository = "https://github.com/matter-labs/zksync-era"
license = "MIT OR Apache-2.0"
keywords = ["blockchain", "zksync"]
categories = ["cryptography"]
publish = false # We don't want to publish our binaries.
edition.workspace = true
authors.workspace = true
homepage.workspace = true
repository.workspace = true
license.workspace = true
keywords.workspace = true
categories.workspace = true
publish = false

[dependencies]
zksync_config = { path = "../../lib/config" }
zksync_env_config = { path = "../../lib/env_config" }
zksync_merkle_tree = { path = "../../lib/merkle_tree" }
zksync_types = { path = "../../lib/types" }
zksync_storage = { path = "../../lib/storage" }
vlog = { path = "../../lib/vlog" }
zksync_config.workspace = true
zksync_env_config.workspace = true
zksync_merkle_tree.workspace = true
zksync_types.workspace = true
zksync_storage.workspace = true
vlog.workspace = true

anyhow = "1.0"
clap = { version = "4.2.4", features = ["derive"] }
tracing = "0.1"
anyhow.workspace = true
clap = { workspace = true, features = ["derive"] }
tracing.workspace = true
Loading

0 comments on commit 1245005

Please sign in to comment.