Skip to content

Commit 9d28fb7

Browse files
authored
feat: merge-train/avm (#19212)
BEGIN_COMMIT_OVERRIDE test: Fuzzer backfill prototype (#19084) fix(avm_differential_fuzzer): fix contract instance keys (#19213) fix(avm): de-duplicate in insertion order (#19211) feat(avm): adding hashes to fuzzer (#19187) feat(avm_fuzzing): add instruction settings to disable instructions (#19217) fix: backfill fuzzer implementations (#19207) feat(avm): fuzzer toradixbe (#19208) fix(avm): tag check before casting in sha (#19220) fix(avm): Add cancellation token to prevent C++ simulation race condition on timeout (#19219) chore!: opcode gas multipliers to account for slow simulation opcodes (#19130) chore: public processor should not do slow Tx.clone - second attempt (#19221) END_COMMIT_OVERRIDE
2 parents 3c5bf50 + 0a88cf2 commit 9d28fb7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+2301
-449
lines changed

barretenberg/cpp/src/barretenberg/avm_fuzzer/fuzz_lib/contract_db_proxy.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "barretenberg/avm_fuzzer/fuzz_lib/fuzzer_data.hpp"
77
#include "barretenberg/avm_fuzzer/fuzz_lib/simulator.hpp"
88
#include "barretenberg/common/log.hpp"
9+
#include "barretenberg/ecc/curves/grumpkin/grumpkin.hpp"
910
#include "barretenberg/vm2/simulation/lib/contract_crypto.hpp"
1011

1112
using namespace bb::avm2::fuzzer;
@@ -29,13 +30,21 @@ ContractClass create_default_class(const std::vector<uint8_t>& bytecode)
2930
// Temp Helper function to create a default contract instance from a class ID
3031
ContractInstance create_default_instance(const ContractClassId& class_id)
3132
{
33+
// To avoid Assertion failed: (contract_instance.public_keys.incoming_viewing_key.on_curve())
34+
auto affine_one = grumpkin::g1::affine_one;
3235
return ContractInstance{
3336
.salt = 0,
3437
.deployer = MSG_SENDER,
3538
.current_contract_class_id = class_id,
3639
.original_contract_class_id = class_id,
3740
.initialization_hash = 0,
38-
.public_keys = PublicKeys{},
41+
.public_keys =
42+
PublicKeys{
43+
.nullifier_key = affine_one,
44+
.incoming_viewing_key = affine_one,
45+
.outgoing_viewing_key = affine_one,
46+
.tagging_key = affine_one,
47+
},
3948
};
4049
}
4150

barretenberg/cpp/src/barretenberg/avm_fuzzer/fuzz_lib/fuzz.test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,7 +1091,7 @@ TEST(fuzz, GetEnvVarSmoke)
10911091
{
10921092
EXPECT_EQ(
10931093
getenvvar_helper(0),
1094-
FF("0x0eef563acf421c26743cea39f09b489599fda1ae169754cd181de40c377ee0af")); // address with bytecode commitment
1094+
FF("0x02fea672ef18fe4b8d13dcfd8943797c99b9885da7b338d224dd5136a0cc8a6f")); // address with bytecode commitment
10951095
EXPECT_EQ(getenvvar_helper(1), MSG_SENDER); // sender, see simulator.cpp globals
10961096
EXPECT_EQ(getenvvar_helper(2), TRANSACTION_FEE); // transaction fee, see simulator.cpp globals
10971097
EXPECT_EQ(getenvvar_helper(3), CHAIN_ID); // chain id, see simulator.cpp globals

0 commit comments

Comments
 (0)