content: [workspace.package]
  version = "0.0.0"                               # managed by cargo-workspaces, see below
  authors = ["Near Inc <hello@nearprotocol.com>"]
  edition = "2024"
  rust-version = "1.86.0"
  repository = "https://github.com/near/nearcore"
  license = "MIT OR Apache-2.0"
  
  [workspace.metadata.workspaces]
  # Shared version of all public crates in the workspace.
  # This is only used for crates that are not stable.
  # Most crates are not stable on purpose, as maintaining API compatibility is a
  # significant developer time expense. Please think thoroughly before adding
  # anything to the list of stable crates.
  # Only bump  0.x.* to 0.(x+1).0 on any nearcore release as nearcore does not guarantee
  # semver compatibility. i.e. api can change without a protocol upgrade.
  version = "0.20.1"
  exclude = ["neard"]
  
  [workspace]
  resolver = "2"
  members = [
      "benchmarks/transactions-generator",
      "chain/chain",
      "chain/chunks",
      "chain/client",
      "chain/client-primitives",
      "chain/epoch-manager",
      "chain/indexer",
      "chain/indexer-primitives",
      "chain/jsonrpc",
      "chain/jsonrpc-adversarial-primitives",
      "chain/jsonrpc-primitives",
      "chain/jsonrpc/client",
      "chain/jsonrpc/jsonrpc-tests",
      "chain/jsonrpc/openapi",
      "chain/network",
      "chain/pool",
      "chain/rosetta-rpc",
      "chain/telemetry",
      "core/async",
      "core/async-derive",
      "core/chain-configs",
      "core/crypto",
      "core/crypto/ed25519-batch",
      "core/dyn-configs",
      "core/external-storage",
      "core/o11y",
      "core/parameters",
      "core/primitives",
      "core/primitives-core",
      "core/store",
      "core/schema-checker/schema-checker-core",
      "core/schema-checker/schema-checker-macro",
      "core/schema-checker/schema-checker-lib",
      "core/time",
      "genesis-tools/genesis-csv-to-json",
      "genesis-tools/genesis-populate",
      "genesis-tools/keypair-generator",
      "integration-tests",
      "nearcore",
      "neard",
      "runtime/near-vm/test-api",
      "runtime/near-vm/compiler",
      "runtime/near-vm/compiler-singlepass",
      "runtime/near-vm/engine",
      "runtime/near-vm/vm",
      "runtime/near-vm/types",
      "runtime/near-vm/wast",
      "runtime/near-vm/compiler-test-derive",
      "runtime/near-vm-runner",
      "runtime/near-wallet-contract",
      "runtime/runtime",
      "runtime/runtime-params-estimator",
      "runtime/runtime-params-estimator/estimator-warehouse",
      "test-loop-tests",
      "test-utils/store-validator",
      "test-utils/testlib",
      "tools/database",
      "tools/congestion-model",
      "tools/fork-network",
      "tools/indexer/example",
      "tools/mirror",
      "tools/mock-node",
      "tools/ping",
      "tools/protocol-schema-check",
      "tools/restaked",
      "tools/speedy_sync",
      "tools/state-parts",
      "tools/state-parts-dump-check",
      "tools/state-viewer",
      "tools/storage-usage-delta-calculator",
      "tools/themis",
      "tools/undo-block",
      "utils/config",
      "utils/fmt",
      "utils/mainnet-res",
      "utils/near-cache",
      "utils/near-stable-hasher",
      "utils/stdx",
  ]
  exclude = ["tracing", "benchmarks"]
  
  [workspace.lints.clippy]
  all = { level = "allow", priority = -100 }
  correctness = { level = "deny", priority = -50 }
  suspicious = { level = "deny", priority = -50 }
  perf = { level = "deny", priority = -50 }
  
  # overrides clippy::perf = "deny": https://github.com/rust-lang/rust-clippy/issues/8111
  single_char_pattern = "allow"
  
  assigning_clones = "deny"
  clone_on_copy = "deny"
  derivable_impls = "deny"
  disallowed_types = "deny"
  explicit_deref_methods = "deny"
  explicit_into_iter_loop = "deny"
  explicit_iter_loop = "deny"
  flat_map_option = "deny"
  inefficient_to_string = "deny"
  large_futures = "deny"
  large_stack_frames = "deny"
  large_types_passed_by_value = "deny"
  len_zero = "deny"
  manual_is_variant_and = "deny"
  needless_collect = "deny"
  needless_pass_by_ref_mut = "deny"
  redundant_clone = "deny"
  same_functions_in_if_condition = "deny"
  or_fun_call = "deny"
  unchecked_duration_subtraction = "deny"
  unnecessary_box_returns = "deny"
  unnecessary_join = "deny"
  unnecessary_lazy_evaluations = "deny"
  unused_async = "deny"
  
  [workspace.lints.rust]
  # Will take effect since Rust 1.80, produces unused warning before it: https://github.com/rust-lang/cargo/pull/13913
  unexpected_cfgs = { level = "allow", check-cfg = ['cfg(enable_const_type_id)'] }
  
  [workspace.dependencies]
  anyhow = "1.0.62"
  arbitrary = { version = "1.2.3", features = ["derive"] }
  arc-swap = "1.5"
  ark-bls12-381 = "0.4.0"
  ark-ec = "0.4.0"
  ark-ff = "0.4.0"
  ark-serialize = "0.4.0"
  ark-std = "0.4.0"
  assert_matches = "1.5.0"
  async-trait = "0.1.58"
  aurora-engine-transactions = "1.1"
  aurora-engine-types = "1.1"
  axum = { version = "0.8", features = ["macros"] }
  axum-test = "18.0"
  backtrace = "0.3"
  base64 = "0.21"
  bencher = "0.1.5"
  bitvec = "1.0.1"
  blake2 = { version = "0.10.6", features = ["reset"] }
  blst = { version = "0.3.11", features = ["portable"] }
  bn = { package = "zeropool-bn", version = "0.5.11", default-features = false }
  # TODO: remove this override when https://github.com/camshaft/bolero/issues/196 is fixed upstream
  # Currently the changes here are: https://github.com/camshaft/bolero/compare/master...Ekleog-NEAR:bolero:reduce-list-tests-run
  bolero = { version = "0.10.0", git = "https://github.com/Ekleog-NEAR/bolero", rev = "c37993bd70dcf5b1778b03daf29f686225e9a504", features = [
      "arbitrary",
  ] }
  borsh = { version = "1.0.0", features = ["derive", "rc"] }
  bs58 = "0.4"
  bytes = "1"
  bytesize = { version = "1.1", features = ["serde"] }
  cov-mark = "2.0.0-pre.1"
  cargo_metadata = "0.14.1"
  cc = "1.0"
  cfg-if = "1.0"
  chrono = { version = "0.4", default-features = false, features = [
      "clock",
      "alloc",
      "serde",
  ] }
  clap = { version = "4.2.0", features = ["derive", "env", "string"] }
  criterion = { version = "0.7.0", default-features = false, features = [
      "html_reports",
      "cargo_bench_support",
  ] }
  crossbeam = "0.8"
  crossbeam-channel = "0.5.8"
  crossbeam-utils = "0.8"
  csv = "1.2.1"
  curve25519-dalek = { version = "4.1.3", default-features = false }
  dashmap = { version = "6", default-features = false }
  derive_builder = "0.20.2"
  derive_more = "2.0"
  derive-where = "1.2.7"
  dirs = "4"
  dynasm = "2.0"
  dynasmrt = "2.0"
  easy-ext = "0.2"
  ed25519-dalek = { version = "2.2.0", default-features = false }
  enum-map = "2.1.0"
  enumset = "1.0"
  ethabi = "18"
  expect-test = "1.3.0"
  finite-wasm = "0.5.0"
  finite-wasm-6 = { package = "finite-wasm", version = "0.6.0" }
  futures = "0.3.5"
  futures-util = "0.3"
  genesis-populate = { path = "genesis-tools/genesis-populate" }
  hex = { version = "0.4.2", features = ["serde"] }
  hex-literal = "0.2"
  hkdf = "0.12.3"
  im = "15"
  indexmap = "2"
  indicatif = { version = "0.17.0", features = ["rayon"] }
  insta = { version = "1.41.0", features = ["json", "yaml", "redactions"] }
  integration-tests = { path = "integration-tests" }
  inventory = "0.3.15"
  itertools = "0.14.0"
  itoa = "1.0"
  json_comments = "0.2.1"
  libc = "0.2.81"
  lru = "0.12.3"
  memoffset = "0.8"
  merlin = { version = "3", default-features = false }
  more-asserts = "0.2"
  named-lock = "0.4.1"
  near-account-id = { version = "2.0.0", features = [
      "internal_unstable",
      "serde",
      "borsh",
  ] }
  near-gas = { version = "0.3.2" }
  near-token = { version = "0.3.2" }
  near-amend-genesis = { path = "tools/amend-genesis" }
  near-database-tool = { path = "tools/database" }
  near-async = { path = "core/async" }
  near-async-derive = { path = "core/async-derive" }
  near-cache = { path = "utils/near-cache" }
  near-chain = { path = "chain/chain" }
  near-chain-configs = { path = "core/chain-configs" }
  near-chain-primitives = { path = "chain/chain-primitives" }
  near-chunks = { path = "chain/chunks" }
  near-chunks-primitives = { path = "chain/chunks-primitives" }
  near-client = { path = "chain/client" }
  near-client-primitives = { path = "chain/client-primitives" }
  near-cold-store-tool = { path = "tools/cold-store", package = "cold-store-tool" }
  near-config-utils = { path = "utils/config" }
  nearcore = { path = "nearcore" }
  near-crypto = { path = "core/crypto", default-features = false }
  near-crypto-ed25519-batch = { path = "core/crypto/ed25519-batch" }
  near-dyn-configs = { path = "core/dyn-configs" }
  near-epoch-manager = { path = "chain/epoch-manager" }
  near-external-storage = { path = "core/external-storage" }
  near-flat-storage = { path = "tools/flat-storage" }
  near-fork-network = { path = "tools/fork-network" }
  near-fmt = { path = "utils/fmt" }
  near-indexer = { path = "chain/indexer" }
  near-indexer-primitives = { path = "chain/indexer-primitives" }
  near-jsonrpc = { path = "chain/jsonrpc" }
  near-jsonrpc-adversarial-primitives = { path = "chain/jsonrpc-adversarial-primitives" }
  near-jsonrpc-client-internal = { path = "chain/jsonrpc/client" }
  near-jsonrpc-primitives = { path = "chain/jsonrpc-primitives", features = [
      "full",
  ] }
  near-mainnet-res = { path = "utils/mainnet-res" }
  near-mirror = { path = "tools/mirror" }
  near-network = { path = "chain/network" }
  near-o11y = { path = "core/o11y" }
  near-parameters = { path = "core/parameters" }
  near-performance-metrics = { path = "utils/near-performance-metrics" }
  near-performance-metrics-macros = { path = "utils/near-performance-metrics-macros" }
  near-ping = { path = "tools/ping" }
  near-pool = { path = "chain/pool" }
  near-primitives = { path = "core/primitives" }
  near-primitives-core = { path = "core/primitives-core" }
  near-replay-archive-tool = { path = "tools/replay-archive" }
  near-rosetta-rpc = { path = "chain/rosetta-rpc" }
  near-stable-hasher = { path = "utils/near-stable-hasher" }
  near-state-parts = { path = "tools/state-parts" }
  near-state-parts-dump-check = { path = "tools/state-parts-dump-check" }
  near-state-viewer = { path = "tools/state-viewer", package = "state-viewer" }
  near-schema-checker-macro = { path = "core/schema-checker/schema-checker-macro" }
  near-schema-checker-core = { path = "core/schema-checker/schema-checker-core" }
  near-schema-checker-lib = { path = "core/schema-checker/schema-checker-lib" }
  near-store = { path = "core/store" }
  near-transactions-generator = { path = "benchmarks/transactions-generator" }
  near-telemetry = { path = "chain/telemetry" }
  near-test-contracts = { path = "runtime/near-test-contracts" }
  near-time = { path = "core/time" }
  near-undo-block = { path = "tools/undo-block" }
  near-dump-test-contract = { path = "tools/dump-test-contract" }
  near-vm-test-api = { path = "runtime/near-vm/test-api" }
  near-vm-compiler = { path = "runtime/near-vm/compiler" }
  near-vm-compiler-singlepass = { path = "runtime/near-vm/compiler-singlepass" }
  near-vm-compiler-test-derive = { path = "runtime/near-vm/compiler-test-derive" }
  near-vm-engine = { path = "runtime/near-vm/engine" }
  near-vm-runner = { path = "runtime/near-vm-runner" }
  near-vm-test-generator = { path = "runtime/near-vm/test-generator" }
  near-vm-types = { path = "runtime/near-vm/types" }
  near-vm-vm = { path = "runtime/near-vm/vm" }
  near-vm-wast = { path = "runtime/near-vm/wast" }
  near-wallet-contract = { path = "runtime/near-wallet-contract" }
  nix = "0.24"
  node-runtime = { path = "runtime/runtime" }
  num-bigint = "0.3"
  num_cpus = "1.11"
  num-rational = { version = "0.3.1", features = ["serde"] }
  num-traits = "0.2.15"
  num-integer = "0.1.46"
  
  okapi = { git = "https://github.com/near/near-okapi-fork.git", rev = "fd7de89e130ab99a546f04e3faefcd53044f98d0", features = ["schemars-alpha"] } # Upstream crate can be used as soon as schemars 1.0 is supported https://github.com/GREsau/okapi/pull/161
  object_store = { version = "0.12", features = ["gcp"] }
  oneshot = { version = "0.1.11", features = ["std"] }
  openssl-probe = "0.1.4"
  opentelemetry = { version = "0.30", features = ["trace"] }
  opentelemetry_sdk = { version = "0.30", features = ["rt-tokio"] }
  opentelemetry-otlp = { version = "0.30", default-features = false, features = ["grpc-tonic", "trace"] }
  opentelemetry-semantic-conventions = "0.30"
  ordered-float = { version = "4.2.0", features = ["serde", "borsh"] }
  parking_lot = "0.12.1"
  percent-encoding = "2.2.0"
  pin-project = "1.0"
  pid-lite = "1.2.0"
  prefix-sum-vec = "0.1.2"
  pretty_assertions = "1.2"
  primitive-types = { version = "0.10", default-features = false }
  proc-macro2 = "1.0.64"
  prometheus = { version = "0.13.1", default-features = false }
  protobuf = "3.0.1"
  protobuf-codegen = "3.0.1"
  quote = "1.0"
  rand = "0.8.5"
  rand_chacha = "0.3.1"
  rand_core = "0.6.1"
  rand_hc = "0.3.1"
  rand_xorshift = "0.3"
  rayon = "1.10"
  redis = "0.23.0"
  reed-solomon-erasure = { version = "6.0.0", features = ["simd-accel"] }
  regex = "1.7.1"
  region = "3.0"
  reqwest = { version = "0.12.0", features = ["blocking", "native-tls-vendored"] }
  ripemd = "0.1.1"
  rkyv = "0.8.0"
  rlimit = "0.7"
  rlp = "0.5.2"
  rocksdb = { version = "0.21.0", default-features = false }
  rusqlite = { version = "0.29.0", features = ["bundled", "chrono", "functions"] }
  rustc-demangle = "0.1"
  rust-s3 = { version = "0.32.3", features = ["blocking"] }
  rustix = "1"
  secp256k1 = { version = "0.27.0", default-features = false }
  semver = "1.0.4"
  serde = { version = "1.0.136", features = ["alloc", "derive", "rc"] }
  serde_ignored = "0.1"
  serde_json = "1.0.68"
  serde_repr = "0.1.8"
  serde_with = { version = "3.0", features = ["base64"] }
  serde_yaml = "0.9"
  schemars = { version = "1.0.3", features = ["chrono04"]}
  sha2 = "0.10"
  sha3 = "0.10"
  smallvec = "1.6"
  smart-default = "0.7"
  smartstring = "1.0.1"
  strum = { version = "0.24", features = ["derive"] }
  stun = "0.7"
  subtle = "2.2"
  static_assertions = "1.1"
  syn = { version = "2.0.4", features = ["extra-traits", "full"] }
  sysinfo = "0.24.5"
  target-lexicon = { version = "0.12.2", default-features = false }
  tempfile = "3.3"
  testlib = { path = "test-utils/testlib" }
  test-log = { version = "0.2", default-features = false, features = ["trace"] }
  thiserror = "2.0"
  thread-priority = "1.2.0"
  tikv-jemallocator = "0.5.0"
  time = { version = "0.3.9", default-features = false }
  tokio = { version = "1.28", default-features = false }
  tokio-stream = { version = "0.1.2", features = ["net"] }
  tokio-util = { version = "0.7.1", features = ["codec", "io"] }
  toml = "0.5.8"
  tower-http = { version = "0.6", features = ["cors", "trace", "limit"] }
  tqdm = "0.4.4"
  tracing = { version = "0.1.40", features = ["std"] }
  tracing-appender = "0.2.3"
  tracing-opentelemetry = "0.31"
  tracing-span-tree = "0.1"
  tracing-subscriber = { version = "0.3.20", features = [
      "env-filter",
      "fmt",
      "registry",
      "std",
  ] }
  trybuild = "1.0.11"
  turn = "0.9"
  url = "2.5.0"
  utoipa = "5.4"
  utoipa-swagger-ui = "9"
  wasm-encoder = "0.236"
  wasmparser = "0.78" # TODO: unify at least the versions of wasmparser we have in our codebase
  wasmparser-236 = { package = "wasmparser", version = "0.236" }
  wasmprinter = "0.236"
  wasm-smith = "0.236"
  wasmtime = { version = "36", default-features = false, features = [
      "cranelift",
  ] }
  wast = "40.0"
  wat = "1.0.40"
  webrtc-util = "0.10"
  winapi = { version = "0.3", features = [
      "winbase",
      "memoryapi",
      "errhandlingapi",
      "winnt",
      "impl-default",
  ] }
  wiremock = "0.5.19"
  xshell = "0.2.1"
  xz2 = "0.1.6"
  yansi = "0.5.1"
  zstd = { version = "0.13.1", features = ["zstdmt"] }
  
  stdx = { package = "near-stdx", path = "utils/stdx" }
  
  [patch.crates-io]
  protobuf = { git = "https://github.com/near/rust-protobuf.git", branch = "3.0.2-patch" }
  protobuf-support = { git = "https://github.com/near/rust-protobuf.git", branch = "3.0.2-patch" }
  
  # 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
  
  [profile.dev]
  panic = 'abort'
  
  [profile.release]
  overflow-checks = true
  panic = 'abort'
  lto = "fat"
  codegen-units = 1
  
  # A much faster to compile version of `release`, for development use.
  [profile.dev-release]
  inherits = "release"
  lto = false
  codegen-units = 16
  debug-assertions = true
  
  # Needed to ensure that artifacts generated by `cargo run` and `cargo nextest` are
  # the same on nightly and can be reused. Not sure why it is the case.
  [profile.dev-artifacts]
  inherits = "dev"
  panic = 'unwind'
  
  # Compile some dependencies with optimizations to speed up tests.
  [profile.dev.package.hex]
  opt-level = 3
  [profile.dev.package.rand]
  opt-level = 3
  [profile.dev.package.bs58]
  opt-level = 3
  [profile.dev.package.sha2]
  opt-level = 3
  [profile.dev.package.curve25519-dalek]
  opt-level = 3
  [profile.dev.package.unsafe-libyaml]
  opt-level = 3
  [profile.dev.package.hashbrown]
  opt-level = 3
  [profile.dev.package.dynasmrt]
  opt-level = 3
  [profile.dev.package."*"]
  opt-level = 1
  