Feature/core 288 optimisations of indexing process - #5435
Closed
zajko wants to merge 6 commits into
Closed
Conversation
- **Disk-backed indexed.** `block_height_index` / `switch_block_era_id_index` / `transaction_hash_index` are now LMDB tables. If a node boots against a store where they're missing or empty, they're rebuilt from a one-off full header scan - **`IndexedLmdbBlockStore` merged into `LmdbBlockStore`.** Eliminated the separate wrapper type and the largely pass-through `DataReader`/`DataWriter` duplication; index-aware logic now lives directly on `LmdbBlockStore`. Also removed the now-unused in-memory `temp_map`. - **Protocol upgrade commit restructured.** Dropped `ReactorState::Upgrading` / `upgrading_instruction.rs`. The commit now happens synchronously in `MainReactor::new`, before the event loop starts, for a node restarting with its tip already at the pre-activation switch block; `CatchUp` just finishes (signs + gossips) the resulting immediate switch block. Also removed a redundant in-`CatchUp` commit path for nodes syncing through a _historical_ activation point — verified empirically against `dev` that this case never needs it; those nodes just fetch the post-upgrade chain normally, like any other historical data. - **New test coverage**: `emergency_upgrade.rs` (hard-reset upgrade with block peeling) and `legacy_storage_reindex_and_upgrade.rs`, which boots a 4-node network from a committed pre-refactor block store (real blocks/transactions across 3 eras, no persisted indexes), confirms the indexes rebuild and the network stays live, then drives it through an ordinary protocol upgrade. - **Test harness additions** in `fixture.rs`: `new_with_keys_and_storage_dirs` (boot nodes from pre-existing storage) and a generalized `schedule_upgrade` (arbitrary era/version, not just era 2).
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.
No description provided.