-
Notifications
You must be signed in to change notification settings - Fork 24
feat(checker): Firewood checker framework #936
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
Merged
Merged
Changes from 40 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
f6d903a
feat(fsck): add checker template
qusuyan 8df1b8a
Batch dependabot opentelemetry updates (#913)
aaronbuchwald 0e0c525
refactor(ffi): Cleanup unused and duplicate code (#926)
alarso16 0b8078f
feat(fsck): checker traverse trie
qusuyan bc77ca4
Cleanup ffi unit tests (#932)
aaronbuchwald 89b3405
ci: Require conventional commit format (#933)
rkuris 314bc24
Merge branch 'main' into qusuyan/fsck
qusuyan 4e2c553
fix(fsck): fix clippy and add licenses
qusuyan 3d558cd
feat(fsck): add bound checks and area overlapping checks
qusuyan 2c8afe6
Merge branch 'main' into qusuyan/fsck
qusuyan a155004
test(fsck): add more tests for LinearAddressRangeSet
qusuyan 2dfc795
test(fsck): fix clippy
qusuyan 08ae8b7
docs(fsck): remove comments by cursor
qusuyan 97644ca
refactor(fsck): avoid changing the visibility of NodeStoreHeader
qusuyan b73d777
refactor(fsck): move checker function into nodestore
qusuyan 7d0b904
feat(fsck): range set return complement
qusuyan 83ae327
refactor(fsck): fix clippy
qusuyan e15234b
fix: Use saturating subtraction for metrics counter (#937)
rkuris a3e6f86
refactor(fsck): simplify range set complement
qusuyan 8826b0b
refactor(fsck): test check error content in assert
qusuyan d9fb9c0
build(fsck): add custom range set implementation
qusuyan a135abd
test(fsck): add test for range sets
qusuyan f8b26d3
feat(fsck): add insert_disjoint_area interface that returns the inter…
qusuyan 353247f
refactor(fsck): print test seed on e2e testing and refactor code
qusuyan 32a21c8
test(fsck): add more test cases
qusuyan 6584e86
feat: Improve error handling and add sync iterator (#941)
qusuyan 4ec72e1
build(deps): update fastrace-opentelemetry requirement from 0.11.0 to…
dependabot[bot] b8b8b33
fix(attach-static-libs): push commit/branch to remote on tag events (…
aaronbuchwald da278b9
style(attach-static-libs): use go mod edit instead of sed to update m…
aaronbuchwald 3c0d6d4
feat(metrics): Add read_node counters (#947)
rkuris 737a571
Create two pkgs for firewood differential testing against eth and mer…
aaronbuchwald 6666dda
ci: add push to main to attach static libs triggers (#952)
aaronbuchwald 507dd69
ci: Check the PR title for conventional commits (#953)
rkuris 476845b
chore: add Brandon to CODEOWNERS (#954)
rkuris 9f23bec
test(ethhash): convert ethhash test to fuzz test for ethhash compatib…
aaronbuchwald 5e3b7f8
Merge branch 'main' into qusuyan/fsck
qusuyan 0955b03
fix(fsck): fix checker test
qusuyan 1806d22
refactor(fsck): fix clippy
qusuyan a6e8050
refactor(fsck): refactor code for better readability
qusuyan 1de8e38
refactor(checker): refactor checker code
qusuyan 129f41a
test(checker): add more tests for range sets
qusuyan 985c1fd
Merge branch 'main' into qusuyan/fsck
qusuyan 04b3055
refactor(checker): add helper branch iterator functions
qusuyan 05fc365
refactor(checker): make checker run sync
qusuyan dc2edb6
refactor(checker): use std::collections::BTreeMap in RangeSet
qusuyan 156ee71
docs(checker): add more comments
qusuyan 2967de6
Merge branch 'main' into qusuyan/fsck
qusuyan 3a1afe6
refactor(checker): update range set logic
qusuyan 38dde3c
refactor(checker): refactor interface
qusuyan ae66d20
Merge branch 'main' into qusuyan/fsck
qusuyan 4a3212e
Merge branch 'main' into qusuyan/fsck
qusuyan cbe2f8c
docs(checker): add lisence
qusuyan 6077b92
Merge branch 'main' into qusuyan/fsck
qusuyan 4f34ac2
Merge branch 'main' into qusuyan/fsck
qusuyan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| // Copyright (C) 2023, Ava Labs, Inc. All rights reserved. | ||
| // See the file LICENSE.md for licensing terms. | ||
|
|
||
| use std::path::Path; | ||
| use std::sync::Arc; | ||
|
|
||
| use clap::Args; | ||
| use firewood::v2::api; | ||
| use nonzero_ext::nonzero; | ||
| use storage::{CacheReadStrategy, FileBacked, NodeStore}; | ||
|
|
||
| // TODO: (optionally) add a fix option | ||
| #[derive(Args)] | ||
| pub struct Options { | ||
| /// The database path (if no path is provided, return an error). Defaults to firewood. | ||
| #[arg( | ||
| long, | ||
| required = false, | ||
| value_name = "DB_NAME", | ||
| default_value_t = String::from("firewood"), | ||
| help = "Name of the database" | ||
| )] | ||
| pub db: String, | ||
| } | ||
|
|
||
| pub(super) async fn run(opts: &Options) -> Result<(), api::Error> { | ||
| let db_path = Path::new(&opts.db); | ||
qusuyan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| let node_cache_size = nonzero!(1usize); | ||
| let free_list_cache_size = nonzero!(1usize); | ||
|
|
||
| let storage = Arc::new(FileBacked::new( | ||
| db_path.to_path_buf(), | ||
| node_cache_size, | ||
| free_list_cache_size, | ||
| false, | ||
| CacheReadStrategy::WritesOnly, // cache none since this is a read-only workload - we don't want to cache any nodes since we won't read a node more than once | ||
qusuyan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| )?); | ||
|
|
||
| let node_store = NodeStore::open(storage)?; | ||
| node_store.check().await.map_err(Into::into) | ||
qusuyan marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.