From 7c21e91084fd66d39acdcd17c16cba831f48c401 Mon Sep 17 00:00:00 2001 From: jewelofchaos9 Date: Tue, 13 Jan 2026 06:55:13 +0000 Subject: [PATCH 1/2] fix(avm): fix asan crash during UpdateCheckTracegenTest.HashZeroInteractions --- .../barretenberg/vm2/simulation/gadgets/update_check.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp index 06e06ab936a0..89be90be88cd 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp @@ -15,13 +15,13 @@ class UpdateCheck : public UpdateCheckInterface { GreaterThanInterface& gt, HighLevelMerkleDBInterface& merkle_db, EventEmitterInterface& read_event_emitter, - const GlobalVariables& globals) + const GlobalVariables& globals_) : update_check_events(read_event_emitter) , poseidon2(poseidon2) , range_check(range_check) , gt(gt) , merkle_db(merkle_db) - , globals(globals) + , globals(globals_) {} void check_current_class_id(const AztecAddress& address, const ContractInstance& instance) override; @@ -32,7 +32,7 @@ class UpdateCheck : public UpdateCheckInterface { RangeCheckInterface& range_check; GreaterThanInterface& gt; HighLevelMerkleDBInterface& merkle_db; - const GlobalVariables& globals; + GlobalVariables globals; }; } // namespace bb::avm2::simulation From d8345bf988fd5fe32d7ad46eb9851d3b394321b9 Mon Sep 17 00:00:00 2001 From: jewelofchaos9 Date: Tue, 13 Jan 2026 07:11:40 +0000 Subject: [PATCH 2/2] move fix to the test --- .../barretenberg/vm2/simulation/gadgets/update_check.hpp | 6 +++--- .../barretenberg/vm2/tracegen/update_check_trace.test.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp b/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp index 89be90be88cd..06e06ab936a0 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp +++ b/barretenberg/cpp/src/barretenberg/vm2/simulation/gadgets/update_check.hpp @@ -15,13 +15,13 @@ class UpdateCheck : public UpdateCheckInterface { GreaterThanInterface& gt, HighLevelMerkleDBInterface& merkle_db, EventEmitterInterface& read_event_emitter, - const GlobalVariables& globals_) + const GlobalVariables& globals) : update_check_events(read_event_emitter) , poseidon2(poseidon2) , range_check(range_check) , gt(gt) , merkle_db(merkle_db) - , globals(globals_) + , globals(globals) {} void check_current_class_id(const AztecAddress& address, const ContractInstance& instance) override; @@ -32,7 +32,7 @@ class UpdateCheck : public UpdateCheckInterface { RangeCheckInterface& range_check; GreaterThanInterface& gt; HighLevelMerkleDBInterface& merkle_db; - GlobalVariables globals; + const GlobalVariables& globals; }; } // namespace bb::avm2::simulation diff --git a/barretenberg/cpp/src/barretenberg/vm2/tracegen/update_check_trace.test.cpp b/barretenberg/cpp/src/barretenberg/vm2/tracegen/update_check_trace.test.cpp index 7c27f3428a48..0545009ab7fb 100644 --- a/barretenberg/cpp/src/barretenberg/vm2/tracegen/update_check_trace.test.cpp +++ b/barretenberg/cpp/src/barretenberg/vm2/tracegen/update_check_trace.test.cpp @@ -126,8 +126,8 @@ TEST(UpdateCheckTracegenTest, HashZeroInteractions) mock_l1_to_l2_message_tree_check); EventEmitter update_check_event_emitter; - UpdateCheck update_check( - poseidon2, range_check, gt, merkle_db, update_check_event_emitter, { .timestamp = current_timestamp }); + const GlobalVariables globals = GlobalVariables{ .timestamp = current_timestamp }; + UpdateCheck update_check(poseidon2, range_check, gt, merkle_db, update_check_event_emitter, globals); uint32_t leaf_index = 27; EXPECT_CALL(mock_low_level_merkle_db, get_tree_roots()).WillRepeatedly(Return(trees));