Tags: init4tech/storage
Tags
feat(cold): increase LRU cache from 128 to 2048 entries (#55) * feat(cold): increase LRU cache from 128 to 2048 entries per map 128 entries is too small for RPC workloads where the same recent blocks, transactions, and receipts are queried repeatedly by different concurrent callers, causing unnecessary cold storage round-trips. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: revert added comment, bump version to 0.7.2 Removes the explanatory comment on DEFAULT_CACHE_CAPACITY per review feedback. Bumps workspace version from 0.7.1 to 0.7.2. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Claude pre-push hooks for clippy and doc checks (#48) * Add Claude pre-push hooks for clippy and doc checks Adds a Claude Code hook that runs before every `git push`: - cargo +nightly fmt --check - cargo clippy with -D warnings - RUSTDOCFLAGS="-D warnings" cargo doc Clippy and doc warnings are hard failures that block the push. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * Un-ignore .claude/hooks/ and .claude/settings.json Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(cold-sql): pool starvation and query inefficiencies (#45) * fix(cold-sql): pool starvation and query inefficiencies (#45) - Add per-backend pool defaults and SqlConnector builder - Add safety checks to integer conversions - Replace get_logs COUNT+SELECT with single LIMIT query - Consolidate get_receipt and batch drain_above - Bump workspace version to 0.7.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: remove docs files and add docs/ to gitignore Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(cold-sql): replace PoolOverrides with sqlx PoolOptions Remove the custom `PoolOverrides` struct and accept `sqlx::pool::PoolOptions<Any>` directly, giving callers the full sqlx pool configuration surface. Only force `max_connections = 1` for in-memory SQLite URLs where per-connection state isolation requires it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * feat(cold-sql): mirror PoolOptions builder methods on SqlConnector Add convenience builder methods on SqlConnector for the most common pool settings: max_connections, min_connections, acquire_timeout, max_lifetime, and idle_timeout. The full PoolOptions can still be set via with_pool_options. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(cold-sql): correctness and cleanup in drain_above and get_receipt - Use from_i64 for prior_cumulative_gas (was bypassing debug assertion) - Use actual tx_index from DB row instead of enumerate index in drain_above - Read first_log_index from DB instead of recomputing in drain_above - Add debug_assert on gas_used subtraction for corruption detection - Import BTreeMap at file top instead of inline fully-qualified paths - Remove dead r_tx_index column from combined get_receipt query - Extract shared delete_above_in_tx helper from truncate/drain_above Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * test(cold): add regression coverage for drain_above receipt fields Enhance conformance tests to verify receipt properties that were previously only checked as counts: - test_drain_above: assert transaction_index, first_log_index (via log_index), gas_used, tx_hash, from, block_hash, block_timestamp on all drained receipts across multiple blocks - test_cold_receipt_metadata: verify all fields on get_receipts_in_block results (was only checking gas_used) - test_confirmation_metadata: add tx_hash and from assertions on receipt lookups Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * fix(cold-sql): use explicit column lists in batch receipt queries Replace `r.*` with explicit column lists in `drain_above` and `get_receipts_in_block` to avoid potential column name collisions from the JOIN with the transactions table. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(hot): avoid panic when bytecode_hash is None during revert writes (… …#44) * fix(hot): avoid panic when bytecode_hash is None during revert writes Account::from(AccountInfo) sets bytecode_hash to None when code_hash equals KECCAK256_EMPTY. However, the AccountInfo can still have code = Some(...) in this case. The .expect() on bytecode_hash then panics because it assumes code presence implies a non-empty hash. Replace the .expect() with an if-let that skips storing bytecode when the hash is None (i.e. empty code), fixing the panic in both write_plain_revert_sorted and write_changeset_account. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor: use option combinators instead of nested if-let Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore: bump workspace version to 0.6.9 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
feat(hot): add queue_db_init and auto-create tables on RW open (#43) * feat(hot): add queue_db_init and auto-create tables on RW open Add HotKvWrite::queue_db_init default method that creates all 9 standard hot storage tables in a single call. Mirror the cold-mdbx pattern by auto-creating tables when DatabaseEnv is opened in read-write mode. Simplify test_utils to rely on automatic table creation instead of manual queue_create calls. Closes ENG-2096 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * docs(hot): document idempotency expectation for queue_raw_create and queue_db_init Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(storage): keep !Send MDBX write tx out of async state machine (#41) * fix(storage): keep !Send MDBX write tx out of async state machine Extract synchronous hot-storage unwind logic from `drain_above` into `unwind_hot_above` so the `!Send` MDBX write transaction never appears in the async generator's state machine. This makes the future returned by `drain_above` `Send`, unblocking use from `Send`-bounded executors like `reth::install_exex`. Adds compile-time `Send` canaries for `drain_above` and `cold_lag` parameterized over `DatabaseEnv` to prevent regressions. Closes ENG-2080 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * chore(storage): add Send compile canaries to builder and replay_to_cold Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fix(cold): drain in-flight reads before executing writes (#39) The task runner's select loop executed writes immediately without waiting for spawned read tasks to complete, allowing reads and writes to race on the backend. Close and drain the TaskTracker before each write to ensure exclusive access, then reopen for subsequent reads. Closes ENG-1980 Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
PreviousNext