-
Notifications
You must be signed in to change notification settings - Fork 724
feat: improve block selection in stacks-inspect
#6735
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
feat: improve block selection in stacks-inspect
#6735
Conversation
Improves the UX by merging `validate-naka-block` and `validate-block,` improves the lookup time by optimizing the queries, and improves the output for a better experience. Adds `--early-exit` flag to exit on first error instead of completing all blocks.
Codecov Report❌ Patch coverage is
❌ Your project status has failed because the head coverage (72.93%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.
Additional details and impacted files@@ Coverage Diff @@
## develop #6735 +/- ##
===========================================
- Coverage 78.40% 72.93% -5.48%
===========================================
Files 585 585
Lines 361384 361530 +146
===========================================
- Hits 283360 263669 -19691
- Misses 78024 97861 +19837
... and 266 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Remove the `seen` tracking since it doesn't really gain us much and uses a lot of space when processing many blocks.
This option adds complexity to the block selection across pre-Nakamoto / Nakamoto blocks and it doesn't seem useful, so remove it. Also, make `range` exclusive of the `end` height.
benjamin-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left another comment about a question I'm not sure about, but in either case this change is an improvement on the status quo, so I'm happy to approve as is.
|
I think @wileyj should try this patch out on a block-replay before merging, because the corresponding block validation script will need to be updated to use this new CLI. That said, I'm kinda iffy on whether or not it was a good idea to put |
|
it's a block validation party today - will start once #6754 is complete. |
|
updated the validation script, and a few things are odd so far (not sure if it's bad or not, but it is behaving differently than stacks-inspect in 3.3.0.0.3 for example). for comparison, in 3.3.0.0.3 - each partition took roughly the same amount of time when using the (deprecated in this PR) function i'm running a complete validation now, will share more details once it's complete and the logs are full. |
This reverts commit 9203886.
|
attaching output from validating all blocks using as noted on the call, since hte blocks are processed serially - it makes more sense why the earlier blocks are validated much faster than the later blocks, and why some partitions take substantially longer than with version of stacks-inspect in develop branch (which doesn't process the blocks serially). overall, a full run with from this branch took roughly 13 hours whereas from develop it was around 11 hours. i will also introduce a block failure and re-run to see how the binary change logs validation failures |
|
@brice-stacks for readability - this is a little awkward. would be it possible to put the failure on a separate line? note that this is a synthetic failure i introduced for epoch 2.5 to see what the output looks like since the use case here is to not stop once a failure is discovered, it's helpful to have each one printed on their own line - that may be tricky with the change to a % based output though 🤔 |
|
I'm going to put the |
I can't come up with a way to combine these two that makes much sense, so I'm just creating two separate options for using an index range across each DB.
To simplofy usage of the `index-range` options, running the command without a start and end value will print the total number of blocks and then return. This can then be used to decide on the values to pass in.
|
Ok, I've added stacks-inspect validate-block <path-to-chainstate> index-range <start> <end>and stacks-inspect validate-block <path-to-chainstate> naka-index-range <start> <end>Also, for convenience, I added a feature so that if you don't pass |
|
neat! I'll give it a try tonight
…On Thu, Dec 18, 2025 at 14:20 Brice ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In contrib/stacks-inspect/src/lib.rs
<#6735 (comment)>
:
> &block,
block_size,
&next_staging_block.consensus_hash,
&next_staging_block.anchored_block_hash,
next_staging_block.commit_burn,
next_staging_block.sortition_burn,
);
+ Ok(())
I made this change in 9afaaf3
<9afaaf3>
.
—
Reply to this email directly, view it on GitHub
<#6735 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAVXIHF5XBK772UQH7BL6WL4CMSDBAVCNFSM6AAAAACNZ7AIJSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKOJVGM3TAMJVHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Sorry, I haven't updated the script yet. I'll get to that today. |
benjamin-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit and one minor question, but LGTM and if it works for @wileyj, ship it!
francesco-stacks
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, but I'll wait for @wileyj results before approving!
wileyj
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Double-checked the recent change - lgtm!
cf457b8
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Improves the UX by merging
validate-naka-blockandvalidate-block,improves the lookup time by optimizing the queries, and improves the output for a better experience. Adds--early-exitflag to exit on first error instead of completing all blocks.