Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ledger): fuzz testing #452

Merged
merged 28 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
06644b4
Added fuzz for rockdb implementation for ledger
dadepo Dec 18, 2024
e6fd9d3
Merge branch 'main' into dade/ledger-fuzz-test
dadepo Dec 20, 2024
3946c33
Merge branch 'main' into dade/ledger-fuzz-test
dadepo Jan 1, 2025
c86db1f
Fix build
dadepo Jan 1, 2025
c7efe51
Have all imports at top of file
dadepo Jan 7, 2025
efd4025
Zig fmt
dadepo Jan 8, 2025
52bbbb2
Remove explicit type annotation
dadepo Jan 8, 2025
b419b4b
Remove concurrency
dadepo Jan 8, 2025
e73776c
No need to divide up the provided max action
dadepo Jan 8, 2025
9e06b51
Assert result of ledger calls
dadepo Jan 9, 2025
3e07071
Pass random as value
dadepo Jan 9, 2025
3917f2c
Added dbDeleteFilesInRange
dadepo Jan 9, 2025
50fdff8
Use method syntax
dadepo Jan 9, 2025
5c3a5f9
Skip count for rocksdb impl
dadepo Jan 10, 2025
db3c374
Rename batchOps to BatchAPI
dadepo Jan 10, 2025
0a0ac38
Fix style
dadepo Jan 10, 2025
9cfe206
Use if as expression
dadepo Jan 10, 2025
076d4b3
Remove explicit reference to rocksdb
dadepo Jan 10, 2025
c695ce7
Randomize method calls
dadepo Jan 12, 2025
e29fef7
Renamed variable and added documentation
dadepo Jan 13, 2025
a84612b
Added comments explaining why deleteFilesInRange is not included
dadepo Jan 13, 2025
0688ef9
Comment
dadepo Jan 13, 2025
de89d3c
Use the defined enum
dadepo Jan 13, 2025
ce9f552
Use just {} to represent the void value
dadepo Jan 13, 2025
26df2aa
test(ledger): discrete fuzzer test cases
dnut Jan 15, 2025
d16a81e
Merge branch 'main' into dade/ledger-fuzz-test
dnut Jan 15, 2025
c797b8a
use std.Random not std.rand
dnut Jan 15, 2025
efba458
test(ledger): key should sometimes found, sometimes not
dnut Jan 15, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,11 @@ pub fn build(b: *Build) void {
fuzz_exe.root_module.addImport("zig-network", zig_network_module);
fuzz_exe.root_module.addImport("httpz", httpz_mod);
fuzz_exe.root_module.addImport("zstd", zstd_mod);
fuzz_exe.root_module.addOptions("build-options", build_options);
switch (blockstore_db) {
.rocksdb => fuzz_exe.root_module.addImport("rocksdb", rocksdb_mod),
.hashmap => {},
}
fuzz_exe.linkLibC();

const fuzz_exe_run = b.addRunArtifact(fuzz_exe);
Expand Down
3 changes: 3 additions & 0 deletions src/fuzz.zig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const accountsdb_fuzz = sig.accounts_db.fuzz;
const gossip_fuzz_service = sig.gossip.fuzz_service;
const gossip_fuzz_table = sig.gossip.fuzz_table;
const accountsdb_snapshot_fuzz = sig.accounts_db.fuzz_snapshot;
const ledger_fuzz = sig.ledger.fuzz_ledger;
const StandardErrLogger = sig.trace.ChannelPrintLogger;
const Level = sig.trace.Level;

Expand All @@ -22,6 +23,7 @@ pub const FuzzFilter = enum {
gossip_service,
gossip_table,
allocators,
ledger,
};

pub fn main() !void {
Expand Down Expand Up @@ -86,6 +88,7 @@ pub fn main() !void {
.snapshot => try accountsdb_snapshot_fuzz.run(&cli_args),
.gossip_service => try gossip_fuzz_service.run(seed, &cli_args),
.gossip_table => try gossip_fuzz_table.run(seed, &cli_args),
.ledger => try ledger_fuzz.run(seed, &cli_args),
.allocators => try sig.utils.allocators.runFuzzer(seed, &cli_args),
}
}
Expand Down
Loading
Loading