content: [workspace]
  members = [
      "components/bft",
      "components/executor",
      "components/network",
      "libs/concurrency",
      "libs/crypto",
      "libs/engine",
      "libs/protobuf",
      "libs/protobuf_build",
      "libs/roles",
      "libs/utils",
      "tools",
  ]
  resolver = "2"
  
  [workspace.package]
  authors    = ["The Matter Labs Team <hello@matterlabs.dev>"]
  edition    = "2021"
  homepage   = "https://matter-labs.io/"
  keywords   = ["blockchain", "zksync"]
  license    = "MIT OR Apache-2.0"
  repository = "https://github.com/matter-labs/era-consensus"
  version    = "0.13.0"                                        # x-release-please-version
  
  [workspace.dependencies]
  # Crates from this repo.
  zksync_concurrency        = { version = "=0.13.0", path = "libs/concurrency" }
  zksync_consensus_bft      = { version = "=0.13.0", path = "components/bft" }
  zksync_consensus_crypto   = { version = "=0.13.0", path = "libs/crypto" }
  zksync_consensus_engine   = { version = "=0.13.0", path = "libs/engine" }
  zksync_consensus_executor = { version = "=0.13.0", path = "components/executor" }
  zksync_consensus_network  = { version = "=0.13.0", path = "components/network" }
  zksync_consensus_roles    = { version = "=0.13.0", path = "libs/roles" }
  zksync_consensus_tools    = { version = "=0.13.0", path = "tools" }
  zksync_consensus_utils    = { version = "=0.13.0", path = "libs/utils" }
  zksync_protobuf           = { version = "=0.13.0", path = "libs/protobuf" }
  zksync_protobuf_build     = { version = "=0.13.0", path = "libs/protobuf_build" }
  
  # Crates from Matter Labs.
  vise          = "0.3.0"
  vise-exporter = "0.3.0"
  
  # Crates from third-parties.
  anyhow         = "1"
  assert_matches = "1.5.0"
  async-trait    = "0.1.71"
  bit-vec        = "0.6"
  # portable feature makes blst code check in runtime if ADX instruction set is
  # supported at every bigint multiplication:
  # https://github.com/supranational/blst/commit/0dbc2ce4138e9e5d2aa941ca4cd731d8814a67a2
  # and falls back to a portable implementation if not.
  # Apparently the cost of the check is negligible.
  # This is an undocumented feature, present since release 0.3.11:
  # https://github.com/supranational/blst/releases/tag/v0.3.11
  blst               = { version = "0.3.13", features = ["portable"] }
  build_html         = "2.4.0"
  clap               = { version = "4.3.3", features = ["derive"] }
  criterion          = "0.5.1"
  ed25519-dalek      = { version = "2.0.0", features = ["rand_core"] }
  elliptic-curve     = { version = "0.13" }
  heck               = "0.5.0"
  hex                = "0.4.3"
  http-body-util     = "0.1"
  human-repr         = "1.1.0"
  hyper              = { version = "1", features = ["full"] }
  hyper-util         = { version = "0.1", features = ["full"] }
  im                 = "15.1.0"
  jsonrpsee          = { version = "0.24.0", features = ["http-client", "server"] }
  k256               = { version = "0.13", features = ["ecdsa"] }
  num-bigint         = "0.4.4"
  once_cell          = "1.17.1"
  pin-project        = "1.1.0"
  pretty_assertions  = "1.4.0"
  prettyplease       = "0.2.6"
  proc-macro2        = "1.0.66"
  prost              = "0.12.0"
  prost-build        = "0.12.0"
  prost-reflect      = { version = "0.12.0", features = ["serde"] }
  protox             = "0.5.0"
  quick-protobuf     = "0.8.1"
  quote              = "1.0.33"
  rand               = "0.8.0"
  rocksdb            = "0.21.0"
  semver             = "1.0.23"
  serde              = { version = "1.0", features = ["derive"] }
  serde_json         = "1.0.95"
  serde_yaml         = "0.9"
  sha3               = "0.10.8"
  snow               = "0.9.3"
  syn                = { version = "2.0.17", features = ["extra-traits"] }
  tempfile           = "3"
  test-casing        = "0.1.0"
  thiserror          = "1.0.40"
  time               = "0.3.23"
  tls-listener       = { version = "0.10.3", features = ["rustls"] }
  tokio              = { version = "1.34.0", features = ["full"] }
  tokio-rustls       = "0.26.0"
  tower              = { version = "0.4.13" }
  tracing            = { version = "0.1.37", features = ["attributes"] }
  tracing-subscriber = { version = "0.3.16", features = ["env-filter", "fmt"] }
  zeroize            = { version = "1.7.0", features = ["zeroize_derive"] }
  
  # Note that "bench" profile inherits from "release" profile and
  # "test" profile inherits from "dev" profile.
  # https://doc.rust-lang.org/cargo/reference/profiles.html#test
  #
  # However "test" and "bench" profiles ignore the panic setting:
  # https://doc.rust-lang.org/cargo/reference/profiles.html#panic
  #
  # It won't change until panic-abort-tests is stable:
  # https://doc.rust-lang.org/cargo/reference/unstable.html#panic-abort-tests
  [profile.dev]
  panic = 'abort'
  
  [profile.release]
  panic = 'abort'
  
  [profile.dev.package.zksync_consensus_crypto]
  opt-level = 3
  
  # Compile all the external dependencies with optimizations, because
  # some of them (especially the cryptographic primitives) are extremely
  # slow when compiled without optimizations, and make the tests run slow.
  # Longer compilation is OK, because the compiled dependencies are cached.
  # Enabling compilation optimizations for the crates in this repository
  # is currently considered too slow for development.
  [profile.dev.package."*"]
  opt-level = 3
  
  [workspace.lints.rust]
  missing_docs          = "warn"
  unreachable_pub       = "warn"
  unsafe_code           = "deny"
  unused_qualifications = "warn"
  
  [workspace.lints.clippy]
  # restriction group
  create_dir                    = "warn"
  empty_structs_with_brackets   = "warn"
  float_arithmetic              = "warn"
  non_ascii_literal             = "warn"
  partial_pub_fields            = "warn"
  print_stdout                  = "warn"
  separated_literal_suffix      = "warn"
  string_to_string              = "warn"
  suspicious_xor_used_as_pow    = "warn"
  try_err                       = "warn"
  
  # pedantic group
  bool_to_int_with_if    = "warn"
  default_trait_access   = "warn"
  if_not_else            = "warn"
  manual_assert          = "warn"
  manual_instant_elapsed = "warn"
  manual_let_else        = "warn"
  manual_ok_or           = "warn"
  manual_string_new      = "warn"
  match_bool             = "warn"
  wildcard_imports       = "warn"
  
  # cargo group
  wildcard_dependencies = "warn"
  
  # Produces too many false positives.
  len_without_is_empty     = "allow"
  box_default              = "allow"
  needless_pass_by_ref_mut = "allow"
  redundant_locals         = "allow"
  borrow_deref_ref         = "allow" # &*x is not equivalent to x, because it affects borrowing in closures.
  