You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add StateSource enum and thread trie_node_writer through ChainSync
Introduce StateSource enum to properly signal state import mode:
- TrieNodes::AlreadyImported: trie nodes written incrementally, skip import
- TrieNodes::Pending: trie nodes accumulated in memory, write to DB
- KeyValues: legacy key-value import path
This eliminates 30GiB+ memory usage during state sync by:
1. Using StateSyncMode enum with Incremental and Accumulated variants
2. Skipping key-value accumulation in Incremental mode
3. Signaling to client that trie nodes are already imported
Thread trie_node_writer through ChainSync:
- Add trie_node_writer field to ChainSync struct
- Add parameter to ChainSync::new() constructor
- Pass trie_node_writer to StateSync in chain sync state initiation
- Update PolkadotSyncingStrategy to thread parameter through
- Update all test cases with None parameter
0 commit comments