From 141ace31937311b74a2e1a473f62583ec1a04419 Mon Sep 17 00:00:00 2001 From: 0o-de-lally <1364012+0o-de-lally@users.noreply.github.com> Date: Mon, 19 Aug 2024 20:30:15 -0400 Subject: [PATCH] add abort to node start if diem-vm was built with testing feature --- Cargo.lock | 1 + tools/cli/Cargo.toml | 1 + tools/cli/src/node_cli.rs | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 9837837d6..cc1e05b3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5617,6 +5617,7 @@ dependencies = [ "diem", "diem-config", "diem-node", + "diem-vm", "libra-config", "libra-framework", "libra-genesis-tools", diff --git a/tools/cli/Cargo.toml b/tools/cli/Cargo.toml index fca600d4a..b8f2fba59 100644 --- a/tools/cli/Cargo.toml +++ b/tools/cli/Cargo.toml @@ -18,6 +18,7 @@ clap = { workspace = true } diem = { workspace = true } diem-config = { workspace = true } diem-node = { workspace = true } +diem-vm = { workspace = true } libra-config = { workspace = true } libra-framework = { workspace = true } libra-genesis-tools = { workspace = true } diff --git a/tools/cli/src/node_cli.rs b/tools/cli/src/node_cli.rs index d95abcbbc..ad1a9039d 100644 --- a/tools/cli/src/node_cli.rs +++ b/tools/cli/src/node_cli.rs @@ -17,7 +17,9 @@ impl NodeCli { // Production code should never have been compiled with // Test helpers in the MoveVm. This fuction is a safety check. // Check that we are not including any Move test natives - // diem_vm::natives::assert_no_test_natives(ERROR_MSG_BAD_FEATURE_FLAGS); + diem_vm::natives::assert_no_test_natives( + "SCARY: somehow your production binaries ended up with testing features. Aborting!", + ); // validators typically aren't looking for verbose logs. // but they can set it if they wish with RUST_LOG=info