Skip to content

feature: add signet-cold-mdbx crate with MDBX table definitions#4

Merged
prestwich merged 10 commits into
mainfrom
claude-storage
Feb 3, 2026
Merged

feature: add signet-cold-mdbx crate with MDBX table definitions#4
prestwich merged 10 commits into
mainfrom
claude-storage

Conversation

@prestwich
Copy link
Copy Markdown
Member

Summary

  • Introduces a new signet-cold-mdbx crate with MDBX table definitions for cold storage
  • Adds 8 tables: 5 primary data tables (ColdHeaders, ColdTransactions, ColdReceipts, ColdSignetEvents, ColdZenithHeaders), 2 index tables (ColdBlockHashIndex, ColdTxHashIndex), and 1 metadata table (ColdMetadata)
  • Adds TxLocation type in signet-storage-types for transaction location indexing (16-byte fixed-size struct)
  • Adds KeySer/ValSer serialization implementations for cold storage types in signet-hot

Test plan

  • cargo build -p signet-cold-mdbx compiles successfully
  • cargo test -p signet-cold-mdbx passes (8 tests)
  • cargo test -p signet-hot passes (including cold_impls serialization tests)
  • Full workspace builds and tests

🤖 Generated with Claude Code

prestwich and others added 10 commits February 2, 2026 13:20
Introduces a new crate for cold storage MDBX tables with 8 tables:
- Primary data: ColdHeaders, ColdTransactions, ColdReceipts, ColdSignetEvents, ColdZenithHeaders
- Index: ColdBlockHashIndex, ColdTxHashIndex
- Metadata: ColdMetadata with MetadataKey enum

Also adds:
- TxLocation type in signet-storage-types for transaction location indexing
- KeySer/ValSer implementations for cold storage types in signet-hot

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Implements the ColdStorage trait using MDBX as the backend. Includes
proper feature flagging with `backend` and `test-utils` features.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add `impl From<MdbxColdError> for ColdStorageError` to enable automatic
error conversion via the `?` operator. Refactor backend methods to use
internal helpers returning `MdbxColdError`, eliminating ~90 repetitive
`.map_err(ColdStorageError::backend)` calls.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Extract specifier resolution into dedicated methods (resolve_header_spec,
  resolve_tx_spec, resolve_receipt_spec)
- Replace large match blocks with function invocations
- Use iterator collection patterns to avoid manual loop allocation
- Simplify table creation with a loop over table metadata
- Use scoped blocks to manage cursor lifetimes in truncate_above_inner

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the optional `backend` feature and make both `signet-hot-mdbx`
and `signet-cold` required dependencies. The backend implementation
is now always available. Gate conformance test behind `test-utils`
feature since it requires `signet_cold::conformance`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@prestwich prestwich merged commit c40b9fb into main Feb 3, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant