From 85ca3985fc6a6cb0193ceca54d21f0626ba8b071 Mon Sep 17 00:00:00 2001 From: 0xalpharush <0xalpharush@protonmail.com> Date: Mon, 8 Sep 2025 15:51:41 +0000 Subject: [PATCH 1/2] fix: refuse to process unsupported feature --- src/utils/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/utils/mod.rs b/src/utils/mod.rs index 80bf48eb7..bec847991 100644 --- a/src/utils/mod.rs +++ b/src/utils/mod.rs @@ -35,6 +35,11 @@ impl From<&proto::FeatureSet> for FeatureSet { let mut feature_set = FeatureSet::default(); for id in &input.features { if let Some(pubkey) = INDEXED_FEATURES.get(id) { + if !crate::SUPPORTED_FEATURES.contains(id) + && !crate::HARDCODED_FEATURES.contains(id) + { + panic!("Feature: ({}, {}) is not supported: ", pubkey, id); + } feature_set.activate(pubkey, 0); } } @@ -78,3 +83,13 @@ pub const fn pchash_inverse(hash: u32) -> u32 { x = x.wrapping_mul(0xdee13bb1); x } + +#[test] +#[should_panic(expected = "is not supported")] +fn test_reject_unsupported_feature() { + let unsupported_feature = feature_u64(&agave_feature_set::reenable_sbpf_v0_execution::id()); + let proto_features = proto::FeatureSet { + features: vec![unsupported_feature], + }; + let _ = FeatureSet::from(&proto_features); +} From c07e1f85e891dd7dba39cda867c40bfbd2cd24ad Mon Sep 17 00:00:00 2001 From: 0xalpharush <0xalpharush@protonmail.com> Date: Wed, 10 Sep 2025 17:24:07 +0000 Subject: [PATCH 2/2] cat log on failure --- scripts/run_test_vectors.sh | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/scripts/run_test_vectors.sh b/scripts/run_test_vectors.sh index 89a3ee35d..34d761ba0 100755 --- a/scripts/run_test_vectors.sh +++ b/scripts/run_test_vectors.sh @@ -26,13 +26,23 @@ else cd ../.. fi -find dump/test-vectors/instr/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_instr > $LOG_PATH/test_exec_instr.log 2>&1 -find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_txn > $LOG_PATH/test_exec_precompile.log 2>&1 -find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_txn > $LOG_PATH/test_exec_txn.log 2>&1 -find dump/test-vectors/block/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_block > $LOG_PATH/test_exec_block.log 2>&1 -find dump/test-vectors/syscall/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_vm_syscall > $LOG_PATH/test_exec_vm_syscall.log 2>&1 -find dump/test-vectors/vm_interp/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_vm_interp > $LOG_PATH/test_exec_vm_interp.log 2>&1 -find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_elf_loader > $LOG_PATH/test_exec_elf_loader.log 2>&1 +run_test() { + local log_file="$1" + local cmd="$2" + + if ! eval "$cmd > $log_file 2>&1"; then + cat "$log_file" + exit 1 + fi +} + +run_test "$LOG_PATH/test_exec_instr.log" "find dump/test-vectors/instr/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_instr" +run_test "$LOG_PATH/test_exec_precompile.log" "find dump/test-vectors/txn/fixtures/precompile -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_txn" +run_test "$LOG_PATH/test_exec_txn.log" "find dump/test-vectors/txn/fixtures/programs -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_txn" +run_test "$LOG_PATH/test_exec_block.log" "find dump/test-vectors/block/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_block" +run_test "$LOG_PATH/test_exec_vm_syscall.log" "find dump/test-vectors/syscall/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_vm_syscall" +run_test "$LOG_PATH/test_exec_vm_interp.log" "find dump/test-vectors/vm_interp/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_vm_interp" +run_test "$LOG_PATH/test_exec_elf_loader.log" "find dump/test-vectors/elf_loader/fixtures -type f -name '*.fix' | xargs -P $NUM_PROCESSES -n 1000 ./target/release/test_exec_elf_loader" failed=`grep -wR FAIL $LOG_PATH | wc -l` passed=`grep -wR OK $LOG_PATH | wc -l`