fix(node): create hot storage tables before first read in prebuild#122
Closed
fix(node): create hot storage tables before first read in prebuild#122
Conversation
On a fresh MDBX database, named tables do not exist until explicitly
created in a write transaction. The prebuild() method was attempting
to read from the "Headers" table via a read-only transaction, which
cannot create tables, causing MDBX_NOTFOUND ("no matching key/data
pair found") to propagate as a fatal error.
This adds an initialization step that creates all standard hot storage
tables in a write transaction before any reads. The create operation
is idempotent, so it is safe on existing databases.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
During initial sync or rapid block processing, the cold storage channel can fill up faster than the PostgreSQL backend can drain it. The UnifiedStorage docs explicitly state that backpressure is transient and should be logged, not treated as fatal — hot storage is authoritative and cold will catch up. Change append_blocks error handling to log cold storage errors as warnings instead of crashing the node. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
During initial sync this fires on every block, flooding the logs. Demote to debug since it's expected transient behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
prestwich
requested changes
Mar 27, 2026
Member
prestwich
left a comment
There was a problem hiding this comment.
keep this deployed while we push upstream fix
| // named tables must be created in a write transaction before | ||
| // read-only transactions can open them. | ||
| { | ||
| let writer = storage.hot().writer()?; |
Member
There was a problem hiding this comment.
we should address this in the storage crate
Member
|
superseded by release of signet storage @0.6.8 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Headers) do not exist until explicitly created via a write transaction with theMDBX_CREATEflag.prebuild()was attemptingreader.has_block(0)?using a read-only transaction, which cannot create tables — MDBX returnsNOTFOUND. Adds an idempotent table creation step before the first read.append_blockstreated cold storage backpressure (channel full) as a fatal error, crashing the node around block ~1000-1900. TheUnifiedStoragedocs explicitly state backpressure is transient and should be logged, not fatal. Changed to log and continue since hot storage is authoritative.warntodebugsince it fires on every block during initial sync.Test plan
cargo check -p signet-nodepassescargo clippy -p signet-nodepassescargo fmt -- --checkpassescargo test -p signet-nodepassescargo test -p signet-node-testspasses (33 integration tests)🤖 Generated with Claude Code