Skip to content

Collator stability and performance updates#127

Merged
Sumrachek merged 1 commit into
release/node/v0.6.0from
collator_update
Apr 30, 2026
Merged

Collator stability and performance updates#127
Sumrachek merged 1 commit into
release/node/v0.6.0from
collator_update

Conversation

@bvscd
Copy link
Copy Markdown
Collaborator

@bvscd bvscd commented Apr 30, 2026

No description provided.

Copilot AI review requested due to automatic review settings April 30, 2026 07:15
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_timeline bash/python scripts (+ README) to summarize and render allocation metric timelines from node logs; replace () “True” hashmap value usage with EmptyValue.

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 Sumrachek merged commit db09232 into release/node/v0.6.0 Apr 30, 2026
10 checks passed
@Sumrachek Sumrachek deleted the collator_update branch April 30, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants