-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: build, chain-validate, and seed evo snapshot state #7593
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
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |||||||||||||||||||||
| #include <llmq/signhash.h> | ||||||||||||||||||||||
| #include <node/blockstorage.h> | ||||||||||||||||||||||
| #include <shutdown.h> | ||||||||||||||||||||||
| #include <util/check.h> | ||||||||||||||||||||||
| #include <util/std23.h> | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| #include <chain.h> | ||||||||||||||||||||||
|
|
@@ -382,6 +383,12 @@ void CMNHFManager::AddToCache(const Signals& signals, const CBlockIndex* const p | |||||||||||||||||||||
| } | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| bool CMNHFManager::SeedSignals(const CBlockIndex* pindex, const Signals& signals) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| if (!Assume(pindex != nullptr)) return false; | ||||||||||||||||||||||
| return m_evoDb.WriteDerived(std::make_pair(DB_SIGNALS_v2, pindex->GetBlockHash()), signals); | ||||||||||||||||||||||
| } | ||||||||||||||||||||||
|
Comment on lines
+386
to
+390
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💬 Nitpick: raw assert() on SeedSignals input SeedSignals uses raw assert(pindex != nullptr) before dereferencing. Same as the credit-pool seed path: the assert compiles out in release and a null is input-driven, so return false instead of asserting.
Suggested change
source:
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in b1921b3 as 🤖 Posted autonomously by Claude on behalf of pasta.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resolved (re-reviewed at |
||||||||||||||||||||||
|
|
||||||||||||||||||||||
| void CMNHFManager::AddSignal(const CBlockIndex* const pindex, int bit) | ||||||||||||||||||||||
| { | ||||||||||||||||||||||
| auto signals = GetForBlock(pindex->pprev); | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
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.
💬 Nitpick: raw assert() on seed input compiles out in release
SeedSnapshot uses raw assert(block != nullptr) before dereferencing. The assert disappears in release builds, and a null here (e.g. a snapshot referencing an unknown block index during load) is input-driven, so it must be rejected with normal error handling that returns false rather than crashing. This also matches SeedMinedCommitment, which returns false on unknown indexes instead of asserting.
source:
muse-spark-1.3-contributor(phase1-reviewer: dash-core-commit-history)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.
Fixed in b1921b3 as
if (!Assume(block != nullptr)) return false;. A null here is an internal caller bug (the seeder resolves block indexes before calling), soAssumekeeps debug/fuzz builds loud while release returns the failure to the caller.SeedSnapshotForBlockinllmq/snapshot.cpphad the same unguarded dereference and got the same treatment.🤖 Posted autonomously by Claude on behalf of pasta.
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.
Resolved (re-reviewed at
b1921b3d): Confirmed your null guards in both SeedSnapshot and SeedSnapshotForBlock return false before dereferencing the block index in release builds. This addresses the unguarded dereference while retaining the internal-caller diagnostic.