Commit Graph

12619 Commits

Author SHA1 Message Date
yongkangc
f61bd7231f refactor: clean up imports and add comments in utils.rs
- Removed unused imports related to `StorageShardedKey` and `ShardedKey` to streamline the code.
- Added comments to clarify the logic for writing full shards keyed by the highest block and handling the last chunk in memory.
- These changes improve code readability and maintainability.
2026-01-05 11:56:13 +00:00
yongkangc
52e7632b92 dead code 2026-01-05 11:52:56 +00:00
yongkangc
fd73163a41 refactor: update unwind_history_via_rocksdb function signature and logic
- Changed the return type of `unwind_history_via_rocksdb` and related functions from `Result<usize, StageError>` to `Result<(), StageError>` to simplify the return value.
- Renamed parameters `mk_start_key` and `mk_sentinel_key` to `lowest_shard_key` and `sentinel_shard_key` for improved clarity.
- Removed the count variable and adjusted logic to focus on batch processing without tracking the count of affected keys.

These changes enhance code clarity and streamline the function's implementation while maintaining its core functionality.
2026-01-05 11:48:19 +00:00
yongkangc
1e27c3c206 refactor: rename unwind_history_via_rocksdb_generic to unwind_history_via_rocksdb
- Updated the function name from `unwind_history_via_rocksdb_generic` to `unwind_history_via_rocksdb` for improved clarity and consistency.
- Adjusted related function calls to reflect the new name, enhancing code readability.

These changes streamline the function's naming and maintain the existing functionality.
2026-01-05 11:41:37 +00:00
yongkangc
4c52062009 docs: add documentation for flush_account_shards function
- Introduced a new doc comment for the `flush_account_shards` function, detailing its purpose and behavior.
- Explained how the function splits a list into chunks and manages shard writing, including the handling of the last chunk when `flush_all` is false.
- Clarified the use of `u64::MAX` as the sentinel key in the final shard.

These changes enhance the understanding of the function's implementation and usage.
2026-01-05 11:38:29 +00:00
yongkangc
97e66c4326 docs: add documentation for flush_storage_shards function
- Introduced a new doc comment for the `flush_storage_shards` function, detailing its purpose and behavior.
- Explained how the function splits a list into chunks and manages shard writing, including the handling of the last chunk when `flush_all` is false.
- Improved clarity on the use of `u64::MAX` as a sentinel key in the final shard.

These changes enhance the understanding of the function's implementation and usage.
2026-01-05 11:37:56 +00:00
yongkangc
1123400407 comment 2026-01-05 11:35:25 +00:00
yongkangc
319bc394aa refactor: rename generic type parameters in unwind_history_via_rocksdb_generic
- Updated the generic type parameter from `PK` to `PartialKey` for clarity in the `unwind_history_via_rocksdb_generic` function.
- Adjusted related function signatures and internal references to maintain consistency.
- These changes improve code readability and better convey the purpose of the parameters.
2026-01-05 10:41:48 +00:00
yongkangc
9d9539e449 chore: fix clippy doc_markdown warnings
Add backticks around technical terms (RocksDB, unwind_to) in doc
comments to satisfy clippy's doc_markdown lint.
2026-01-05 10:32:45 +00:00
yongkangc
f637310216 test: add unwind tests for shard boundary handling in account and storage history
- Introduced a new test `unwind_crosses_shard_boundary` in both `index_account_history.rs` and `index_storage_history.rs`.
- The test verifies that unwinding correctly manages indices that span multiple shards, ensuring that the sentinel shard only contains blocks below the unwind threshold and that the old full shard is deleted.
- Enhancements to the existing test suite improve coverage for edge cases in shard management.

These changes enhance the robustness of the unwind functionality in the RocksDB implementation.
2026-01-05 10:15:12 +00:00
yongkangc
917a11c6ee comments cleanup 2026-01-05 10:15:12 +00:00
yongkangc
9936b5b99e refactor: streamline RocksDB provider usage in storage shard functions
- Consolidate RocksDB provider initialization to reduce redundancy in `flush_storage_shards` and related functions.
- Rename `flush` parameter to `flush_all` for clarity in intent.
- Ensure non-empty checks for chunk processing in storage shard logic.

These changes enhance code readability and maintainability while preserving existing functionality.
2026-01-05 10:15:12 +00:00
yongkangc
3641b23712 chore: fix trailing whitespace in index_account_history.rs 2026-01-05 10:15:12 +00:00
yongkangc
12fa2a4488 test: simplify RocksDB history indexing tests
Consolidate 8 tests per stage into 3 essential tests each:
- execute_writes_to_rocksdb: verifies basic execute routing
- incremental_sync_merges_indices: critical merge behavior
- unwind_removes_indices: verifies unwind routing

Removed redundant edge case tests that duplicate MDBX test coverage.
Added helper functions and module-level docstrings for clarity.

Reduces test code by ~757 lines while maintaining coverage of
critical RocksDB-specific behaviors.
2026-01-05 10:15:12 +00:00
yongkangc
2284ede549 feat(stages): add RocksDB support for IndexStorageHistoryStage and IndexAccountHistoryStage
Implements #20390 - Modify history indexing stages to use EitherWriter for RocksDB writes.

**Execute changes:**
- Add RocksDB write path to IndexStorageHistoryStage using EitherWriter
- Add RocksDB write path to IndexAccountHistoryStage using EitherWriter
- Add load_storage_history_indices_via_writer and load_account_history_indices_via_writer
  helpers with proper sharding logic and merge support for incremental syncs
- Add StorageSettingsCache, RocksDBProviderFactory, NodePrimitivesProvider trait bounds

**Unwind changes:**
- Add unwind_history_via_rocksdb_generic helper to reduce code duplication
- Stream changesets directly into BTreeSet instead of collecting Vec first
- Add comprehensive test coverage for edge cases

When storages_history_in_rocksdb or account_history_in_rocksdb is enabled,
writes and unwinds are routed to RocksDB instead of MDBX.

Amp-Thread-ID: https://ampcode.com/threads/T-019b8ca2-143e-73fa-93d3-c806e9da7b92
2026-01-05 05:34:43 +00:00
github-actions[bot]
3d4efdb271 chore(deps): weekly cargo update (#20735)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
2026-01-04 11:31:03 +00:00
Doohyun Cho
5ac9184ba6 perf(era-utils): replace Box<dyn Fn> with function pointer (#20701) 2026-01-03 10:46:42 +00:00
Rej Ect
0e6efdb91c chore: bump license year to 2026 (#20704) 2026-01-03 10:45:34 +00:00
zhygis
986e07f21a feat(cli): make Cli extensible with custom subcommands (#20710)
Co-authored-by: Amp <amp@ampcode.com>
2026-01-03 10:41:56 +00:00
Sophia Raye
5307da4794 docs(eth-wire): sync code examples with source (#20724) 2026-01-03 11:45:07 +01:00
Karl Yu
0c69e294c3 chore: optimize evm_env if header is available (#20691) 2025-12-31 13:45:35 +00:00
かりんとう
dc931f5669 chore: use chain_id() method instead of direct field access in prometheus setup (#20687) 2025-12-31 08:53:44 +00:00
Hwangjae Lee
9cfe5c7363 fix(ipc): trim leading whitespace in StreamCodec decode (#20615)
Signed-off-by: Hwangjae Lee <meetrick@gmail.com>
2025-12-31 08:51:56 +00:00
fig
454b060d5a chore(tree): use with_capacity at collect_blocks_for_canonical_unwind() (#20682) 2025-12-30 12:32:02 +00:00
Matthias Seitz
0808bd67c2 chore: shrink outgoing broadcast messages (#20672) 2025-12-30 11:30:37 +00:00
iPLAY888
3b4bc77532 docs(network): update FetchClient struct to use NetworkPrimitives generic (#20680) 2025-12-30 11:23:12 +00:00
Sophia Raye
4eaa5c7d46 docs(eth-wire): add missing eth/70 message types (#20676) 2025-12-30 10:25:43 +00:00
iPLAY888
34c6b8d81c docs(network): update Swarm struct to use NetworkPrimitives generic (#20677) 2025-12-30 10:12:00 +00:00
Matthias Seitz
f79fdf3564 perf: pre-alloc removed vec (#20679) 2025-12-30 10:09:39 +00:00
Karl Yu
16f75bb0c3 feat: avoid mutex locking (#20678) 2025-12-30 09:28:40 +00:00
Hwangjae Lee
5053322711 docs(storage): fix typos in storage crates (#20673)
Signed-off-by: Hwangjae Lee <meetrick@gmail.com>
Co-authored-by: YK <chiayongkang@hotmail.com>
2025-12-30 06:18:35 +00:00
YK
d72105b47c fix(storage): rocksdb consistency check on startup (#20596)
Co-authored-by: Federico Gimenez <fgimenez@users.noreply.github.com>
2025-12-30 06:17:32 +00:00
YK
0f585f892e perf(trie): flatten sparse trie branch node masks to reduce overhead (#20664) 2025-12-30 03:38:24 +00:00
iPLAY888
f7c77e72a7 docs(network): update NetworkConfig struct to match current API (#20665) 2025-12-29 22:00:40 +00:00
fig
fc248e3323 chore(stages): use with_capacity() at populate_range() (#20671) 2025-12-29 21:34:54 +00:00
Karl Yu
d564d9ba36 feat: add append_pooled_transaction_elements (#20654)
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2025-12-29 21:00:40 +00:00
Hwangjae Lee
b7883953c4 chore(rpc): shrink active filters HashMap after clearing stale entries (#20660)
Signed-off-by: Hwangjae Lee <meetrick@gmail.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2025-12-29 20:45:52 +00:00
lisenokdonbassenok
b40b7dc210 docs: document http/ws api none option (#20666) 2025-12-29 20:43:27 +00:00
Matthias Seitz
65b5a149be chore: use with capacity (#20670) 2025-12-29 20:35:46 +00:00
Matthias Seitz
05ed753e58 chore: shrink range result vec to fit (#20639) 2025-12-29 10:22:11 +00:00
fig
624bfa1f49 perf(engine): paralellize evm_state_to_hashed_post_state() (#20635) 2025-12-29 10:06:08 +00:00
Desant pivo
d9c6f745c6 fix(chain-state): correct balance deduction in test block builder (#20308) 2025-12-29 09:59:19 +00:00
YK
240dc8602b perf(trie): flatten branch node mask to reduce overhead (#20659) 2025-12-29 07:35:46 +00:00
Matthias Seitz
489da4a38b perf: allocate signer vec exact size (#20638) 2025-12-29 02:18:27 +00:00
Matthias Seitz
05b3a8668c perf(trie): add FromIterator for HashedPostState and simplify from_bundle_state (#20653) 2025-12-28 11:29:07 +00:00
Hwangjae Lee
cb1de1ac19 docs(rpc): fix typos and complete incomplete doc comments (#20642)
Signed-off-by: Hwangjae Lee <meetrick@gmail.com>
2025-12-28 10:26:03 +00:00
github-actions[bot]
751a985ea7 chore(deps): weekly cargo update (#20650)
Co-authored-by: github-merge-queue <118344674+github-merge-queue@users.noreply.github.com>
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
2025-12-28 09:37:00 +00:00
YK
a92cbb5e8b feat(storage): add AccountsHistory RocksDB consistency check (#20594) 2025-12-28 01:59:02 +00:00
DaniPopes
e595b58c28 feat: switch samply feature for CLI flags (#20586) 2025-12-27 15:16:49 +00:00
oooLowNeoNooo
a852084b43 fix(chainspec): use lazy error formatting in chain spec macro (#20643) 2025-12-26 11:18:57 +00:00