Skip to content

feat: Cache and reuse registry data across rounds#10639

Open
alin-at-dfinity wants to merge 1 commit into
alin/bundle-OwnSubnetInfofrom
alin/reuse-NetworkTopology
Open

feat: Cache and reuse registry data across rounds#10639
alin-at-dfinity wants to merge 1 commit into
alin/bundle-OwnSubnetInfofrom
alin/reuse-NetworkTopology

Conversation

@alin-at-dfinity

Copy link
Copy Markdown
Contributor

Cache previously read registry values (NetworkTopology, OwnSubnetInfo and RegistryExecutionSettings) along with the registry version they were read at. On the next registry read (during the next execution round), if the same registry version is requested, return the cached values.

Reading the registry is now about 50% of the (admittedly already low) DSM overhead (~20 ms of a total ~40 ms; which is still 10% of the average 400 ms round).

Cache previously read registry values (`NetworkTopology`, `OwnSubnetInfo` and `RegistryExecutionSettings`) along with the registry version they were read at. On the next registry read (during the next execution round), if the same registry version is being requested, return the cached values.

Reading the registry is now about 50% of the (admittedly already low) DSM overhead (~20 ms of a total ~40 ms; which is still 10% of the average 400 ms round).
@alin-at-dfinity alin-at-dfinity requested a review from a team as a code owner July 2, 2026 14:22
@github-actions github-actions Bot added the feat label Jul 2, 2026
@zeropath-ai

zeropath-ai Bot commented Jul 2, 2026

Copy link
Copy Markdown

No security or compliance issues detected. Reviewed everything up to 0ee310e.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► rs/messaging/src/message_routing.rs
    Introduce RegistryReader with caching of registry data and Arc-based data sharing
► rs/messaging/src/message_routing.rs
    Replace direct registry reads with RegistryReader in BatchProcessorImpl
► rs/messaging/src/message_routing.rs
    Add CachedRegistryData structure and RegistryReader methods
► rs/messaging/src/message_routing.rs
    Update BatchProcessor and tests to use RegistryReader
► rs/messaging/src/message_routing/tests.rs
    Update tests to utilize RegistryReader in various scenarios
► rs/messaging/src/state_machine.rs
    Switch StateMachine to use Arc and Arc types in signatures
► rs/messaging/src/state_machine.rs
    Update implementation to assign Arc values directly
► rs/messaging/src/state_machine/tests.rs
    Adjust test fixtures and assertions for Arc-based topology/types
► rs/messaging/src/message_routing/tests.rs
    Adjust tests to call RegistryReader.read_registry and .try_to_read_registry via new interface
► rs/messaging/src/message_routing/tests.rs
    Extend tests with caching behavior verification for RegistryReader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant