Collator stability and performance updates#127
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds additional telemetry for storage/cache memory usage, refactors some internal storage logic for better stability, and introduces log-parsing utilities to visualize allocation metrics over time.
Changes:
- Add RocksDB approximate memory-usage tracking (memtables + block cache) and expose it through storage/archive/internal DB layers into node telemetry.
- Add/extend allocation telemetry for account state cache size and storage dicts cache.
- Introduce
alloc_timelinebash/python scripts (+ README) to summarize and render allocation metric timelines from node logs; replace()“True” hashmap value usage withEmptyValue.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/node/tests/alloc_timeline/alloc_timeline.sh | Adds bash (grep+awk) log parser to summarize + timeline allocation metrics. |
| src/node/tests/alloc_timeline/alloc_timeline.py | Adds faster python log parser version with summary + sampled timeline output. |
| src/node/tests/alloc_timeline/README.md | Documents usage, filtering, sampling, and expected output. |
| src/node/storage/src/lib.rs | Adds RocksDB telemetry metrics and introduces RocksDbMemoryUsage accumulator type. |
| src/node/storage/src/dynamic_boc_rc_db.rs | Refactors counter-loading logic to reduce duplicate code/queries. |
| src/node/storage/src/db/rocksdb.rs | Adds RocksDb::memory_usage() using RocksDB perf memory usage builder. |
| src/node/storage/src/archives/epoch.rs | Adds summed RocksDB memory usage across all epochs. |
| src/node/storage/src/archives/db_provider.rs | Extends provider trait to report summed RocksDB memory usage. |
| src/node/storage/src/archives/archive_manager.rs | Exposes RocksDB memory usage from the archive DB provider. |
| src/node/storage/src/archive_shardstate_db.rs | Exposes RocksDB memory usage for the archive shardstate DB. |
| src/node/src/internal_db/mod.rs | Adds rocksdb_memory_usage() aggregation for node-level telemetry consumption. |
| src/node/src/engine_traits.rs | Adds new engine telemetry/alloc fields for cache memory reporting. |
| src/node/src/engine.rs | Wires new metrics into telemetry logger and reports RocksDB memory usage periodically. |
| src/node/src/network/liteserver.rs | Tracks account-state LRU cache byte usage in engine allocated telemetry. |
| src/node/src/validator/collator.rs | Stops processing new messages on cutoff timeout in addition to existing conditions. |
| src/node/src/types/accounts.rs | Switches hashmap “True” values from () to EmptyValue. |
| src/node/src/collator_test_bundle.rs | Updates test bundle telemetry/alloc constructors for new fields. |
| src/block/src/lib.rs | Introduces EmptyValue and removes Serializable/Deserializable impls for (). |
| src/block/src/master.rs | Updates publishers hashmap to use EmptyValue rather than (). |
| src/block/src/config_params.rs | Updates several “True” hashmaps to use EmptyValue. |
| src/block/src/tests/test_master.rs | Adjusts tests to use EmptyValue. |
| src/block/src/tests/test_config_params.rs | Adjusts tests to use EmptyValue. |
| src/adnl/src/overlay/mod.rs | Refactors overlay maintenance loop timeouts and improves peer-check warning logging context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+498
to
+505
| /// Returns approximate RocksDB memory usage summing main DB, | ||
| /// archive states DB (if archival), and all epoch DBs. | ||
| pub fn rocksdb_memory_usage(&self) -> storage::RocksDbMemoryUsage { | ||
| let mut usage = self.archive_manager.rocksdb_memory_usage(); | ||
| if let StateDb::Archive(db) = &self.state_db { | ||
| usage += db.rocksdb_memory_usage(); | ||
| } | ||
| usage |
Comment on lines
+48
to
+54
| path = args[0] if len(args) > 0 and os.path.isfile(args[0]) else None | ||
| filter_str = args[1] if len(args) > 1 else (args[0] if len(args) == 1 and not os.path.isfile(args[0]) else "Alloc") | ||
|
|
||
| if path: | ||
| src = open(path) | ||
| else: | ||
| src = sys.stdin |
Comment on lines
+26
to
+27
| grep -E "Engine::run|telemetry$|${FILTER}" "$INPUT" \ | ||
| | awk -v filter="$FILTER" -v full="$FULL" ' |
Comment on lines
+472
to
+476
| if self.cell_db().is_stored_cell(cell) { | ||
| // This cell is possibly in DB, trying to load counter | ||
| if let Some(counter) = try_load_counter(cell_id, cells_counters)? { | ||
| return Ok((false, Some(counter))); | ||
| } |
| } | ||
|
|
||
| pub fn rocksdb_memory_usage(&self) -> crate::RocksDbMemoryUsage { | ||
| self.db_provider.memory_usage() |
Sumrachek
approved these changes
Apr 30, 2026
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.