Skip to content

Commit

Permalink
cleanup: removed mock-node (#9654)
Browse files Browse the repository at this point in the history
Removing mock-node, the mock-node feature and any references to it that
I could find.
As discussed on
[zulip](https://near.zulipchat.com/#narrow/stream/295558-pagoda.2Fcore/topic/test_chunk_transaction_validity)
this code is not used but is causing problems.
  • Loading branch information
wacban authored Oct 10, 2023
1 parent ae10bee commit 7d7a18f
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 1,354 deletions.
36 changes: 0 additions & 36 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 46 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace.package]
version = "0.0.0" # managed by cargo-workspaces, see below
version = "0.0.0" # managed by cargo-workspaces, see below
authors = ["Near Inc <hello@nearprotocol.com>"]
edition = "2021"
rust-version = "1.73.0"
Expand Down Expand Up @@ -71,7 +71,6 @@ members = [
"tools/fork-network",
"tools/indexer/example",
"tools/mirror",
"tools/mock-node",
"tools/ping",
"tools/restaked",
"tools/rpctypegen/core",
Expand Down Expand Up @@ -124,7 +123,10 @@ clap = { version = "4.2.0", features = ["derive", "env", "string"] }
cloud-storage = "0.11.1"
conqueue = "0.4.0"
cpu-time = "1.0"
criterion = { version = "0.3.5", default_features = false, features = ["html_reports", "cargo_bench_support"] }
criterion = { version = "0.3.5", default_features = false, features = [
"html_reports",
"cargo_bench_support",
] }
crossbeam = "0.8"
crossbeam-channel = "0.5.8"
crossbeam-queue = "0.3.8"
Expand Down Expand Up @@ -174,7 +176,7 @@ more-asserts = "0.2"
near-account-id = { path = "core/account-id", features = ["internal_unstable"] }
near-actix-test-utils = { path = "test-utils/actix-test-utils" }
near-amend-genesis = { path = "tools/amend-genesis" }
near-database-tool= { path = "tools/database" }
near-database-tool = { path = "tools/database" }
near-async = { path = "core/async" }
near-cache = { path = "utils/near-cache" }
near-chain = { path = "chain/chain" }
Expand All @@ -198,7 +200,9 @@ near-indexer-primitives = { path = "chain/indexer-primitives" }
near-jsonrpc = { path = "chain/jsonrpc" }
near-jsonrpc-adversarial-primitives = { path = "chain/jsonrpc-adversarial-primitives" }
near-jsonrpc-client = { path = "chain/jsonrpc/client" }
near-jsonrpc-primitives = { path = "chain/jsonrpc-primitives", features = ["full"] }
near-jsonrpc-primitives = { path = "chain/jsonrpc-primitives", features = [
"full",
] }
near-jsonrpc-tests = { path = "chain/jsonrpc/jsonrpc-tests" }
near-mainnet-res = { path = "utils/mainnet-res" }
near-mirror = { path = "tools/mirror" }
Expand Down Expand Up @@ -272,7 +276,13 @@ reqwest = { version = "0.11.14", features = ["blocking"] }
ripemd = "0.1.1"
rkyv = "0.7.31"
rlimit = "0.7"
rocksdb = { version = "0.21.0", default-features = false, features = ["snappy", "lz4", "zstd", "zlib", "jemalloc"] }
rocksdb = { version = "0.21.0", default-features = false, features = [
"snappy",
"lz4",
"zstd",
"zlib",
"jemalloc",
] }
runtime-tester = { path = "test-utils/runtime-tester" }
rusqlite = { version = "0.29.0", features = ["bundled", "chrono", "functions"] }
rustc-demangle = "0.1"
Expand Down Expand Up @@ -306,7 +316,14 @@ test-log = { version = "0.2", default-features = false, features = ["trace"] }
thiserror = "1.0.30"
tikv-jemallocator = "0.5.0"
time = "0.3.9"
tokio = { version = "~1.28", features = ["fs", "macros", "net", "rt-multi-thread", "sync", "time"] }
tokio = { version = "~1.28", features = [
"fs",
"macros",
"net",
"rt-multi-thread",
"sync",
"time",
] }
tokio-stream = { version = "0.1.2", features = ["net"] }
tokio-util = { version = "0.7.1", features = ["codec", "io"] }
toml = "0.5.8"
Expand All @@ -315,27 +332,44 @@ tracing = { version = "0.1.36", features = ["std"] }
tracing-appender = "0.2.2"
tracing-opentelemetry = "0.17.0"
tracing-span-tree = "0.1"
tracing-subscriber = { version = "0.3.15", features = ["env-filter", "fmt", "registry", "std"] }
tracing-subscriber = { version = "0.3.15", features = [
"env-filter",
"fmt",
"registry",
"std",
] }
trybuild = "1.0.11"
turn = "0.6"
validator = "0.12"
wasm-encoder = "0.27.0"
wasmer-compiler = { package = "wasmer-compiler-near", version = "=2.4.1" }
wasmer-compiler-singlepass = { package = "wasmer-compiler-singlepass-near", version = "=2.4.1" }
wasmer-engine = { package = "wasmer-engine-near", version = "=2.4.1" }
wasmer-engine-universal = { package = "wasmer-engine-universal-near", version = "=2.4.1", features = ["compiler"] }
wasmer-runtime = { version = "0.18.0", package = "wasmer-runtime-near", features = ["default-backend-singlepass"], default-features = false }
wasmer-engine-universal = { package = "wasmer-engine-universal-near", version = "=2.4.1", features = [
"compiler",
] }
wasmer-runtime = { version = "0.18.0", package = "wasmer-runtime-near", features = [
"default-backend-singlepass",
], default-features = false }
wasmer-runtime-core = { version = "0.18.2", package = "wasmer-runtime-core-near" }
wasmer-types = { package = "wasmer-types-near", version = "=2.4.1" }
wasmer-vm = { package = "wasmer-vm-near", version = "=2.4.1" }
wasmparser = "0.78" # TODO: unify at least the versions of wasmparser we have in our codebase
wasmprinter = "0.2"
wasm-smith = "0.10"
wasmtime = { version = "9.0.3", default-features = false, features = ["cranelift"] }
wasmtime = { version = "9.0.3", default-features = false, features = [
"cranelift",
] }
wast = "40.0"
wat = "1.0.40"
webrtc-util = "0.7"
winapi = { version = "0.3", features = ["winbase", "memoryapi", "errhandlingapi", "winnt", "impl-default"] }
winapi = { version = "0.3", features = [
"winbase",
"memoryapi",
"errhandlingapi",
"winnt",
"impl-default",
] }
xshell = "0.2.1"
xz2 = "0.1.6"

Expand Down
1 change: 0 additions & 1 deletion chain/chain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,4 @@ nightly_protocol = [
"near-primitives/nightly_protocol",
"near-store/nightly_protocol",
]
mock_node = []
sandbox = ["near-primitives/sandbox"]
6 changes: 0 additions & 6 deletions chain/chain/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4076,14 +4076,8 @@ impl Chain {
return Err(Error::InvalidChunkProofs(Box::new(chunk_proof)));
}

// if we are running mock_node, ignore this check because
// this check may require old block headers, which may not exist in storage
// of the client in the mock network
#[cfg(not(feature = "mock_node"))]
let protocol_version =
self.epoch_manager.get_epoch_protocol_version(block.header().epoch_id())?;

#[cfg(not(feature = "mock_node"))]
if checked_feature!("stable", AccessKeyNonceRange, protocol_version) {
let transaction_validity_period = self.transaction_validity_period;
for transaction in transactions {
Expand Down
1 change: 0 additions & 1 deletion chain/epoch-manager/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ nightly = [
"near-primitives/nightly",
"near-store/nightly",
]
mock_node = []
nightly_protocol = [
"near-chain-configs/nightly_protocol",
"near-primitives/nightly_protocol",
Expand Down
53 changes: 0 additions & 53 deletions tools/mock-node/Cargo.toml

This file was deleted.

90 changes: 0 additions & 90 deletions tools/mock-node/README.md

This file was deleted.

Loading

0 comments on commit 7d7a18f

Please sign in to comment.