feat: make reference subnet size in CyclesAccountManager configurable at runtime#10469
Draft
mraszyk wants to merge 9 commits into
Draft
feat: make reference subnet size in CyclesAccountManager configurable at runtime#10469mraszyk wants to merge 9 commits into
mraszyk wants to merge 9 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes the CyclesAccountManager’s “reference subnet size” (used for cycles cost scaling) updateable at runtime based on registry state, so that enabling/disabling SEV on a subnet is reflected in cycles scaling without restarting or rebuilding configuration.
Changes:
- Adds
reference_subnet_sizetoRegistryExecutionSettingsand populates it when reading the registry (with SEV-aware behavior for app subnets). - Updates
SchedulerImpl::execute_roundto apply the registry-providedreference_subnet_sizeintoCyclesAccountManagereach round. - Refactors
CyclesAccountManagerto store the reference size in a shared atomic (to keep clones consistent) and updates tests/utilities accordingly.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| rs/test_utilities/execution_environment/src/lib.rs | Populates the new registry execution setting field in test utilities. |
| rs/messaging/src/message_routing/tests.rs | Updates test scaffolding for the new field and adds a regression test for SEV-driven updates. |
| rs/messaging/src/message_routing.rs | Computes reference_subnet_size from subnet type + SEV feature and includes it in RegistryExecutionSettings. |
| rs/interfaces/src/execution_environment.rs | Extends RegistryExecutionSettings with reference_subnet_size. |
| rs/execution_environment/tests/subnet_size_test.rs | Adds a test asserting SEV reference size affects execution costs as expected. |
| rs/execution_environment/src/scheduler/threshold_signatures.rs | Updates test settings construction to include reference_subnet_size. |
| rs/execution_environment/src/scheduler.rs | Sets CyclesAccountManager reference subnet size from registry each round. |
| rs/execution_environment/src/hypervisor.rs | Adjusts to CyclesAccountManager no longer being Copy (uses clone()). |
| rs/execution_environment/src/execution_environment.rs | Adjusts call sites to use clones where needed and keeps fee computations working. |
| rs/embedders/tests/wasmtime_random_memory_writes.rs | Updates test construction for non-Copy CyclesAccountManager. |
| rs/embedders/tests/system_api.rs | Updates tests to pass cloned CyclesAccountManager. |
| rs/embedders/tests/sandbox_safe_system_state.rs | Updates tests to pass cloned CyclesAccountManager. |
| rs/cycles_account_manager/src/cycles_account_manager/tests.rs | Updates internal test helper to set the new shared reference size field. |
| rs/cycles_account_manager/src/cycles_account_manager.rs | Introduces shared atomic reference subnet size, adds runtime setter, and updates scaling to use it. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This PR makes the reference subnet size in CyclesAccountManager configurable at runtime so that a subnet's security can be changed from
Noneto SEV-SNP and this change is properly picked up from the registry and reflected in cycles scaling at runtime.