Skip to content

feat: enforce maximum subnet state size from registry in DSM#9299

Draft
mraszyk wants to merge 29 commits intomasterfrom
mraszyk/subnet-resource-limits
Draft

feat: enforce maximum subnet state size from registry in DSM#9299
mraszyk wants to merge 29 commits intomasterfrom
mraszyk/subnet-resource-limits

Conversation

@mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Mar 10, 2026

This PR enforces the maximum subnet state size from the registry's subnet record in the DSM.

In more detail, this PR

  • adds a field own_resource_limits to SystemMetadata in ReplicatedState (preserved across checkpoints and overridden at the beginning of every round based on the registry value);
  • uses that field to refine subnet_memory_capacity in ExecutionEnvironment;
  • makes resource limits configurable in StateMachine and ExecutionTest frameworks.

The subnet resource limits are passed to ExecutionEnvironment via a field in SystemMetadata so that they are also available to non-replicated execution (query handler) which does not have access to the registry.

@github-actions github-actions bot added the feat label Mar 10, 2026
@mraszyk mraszyk changed the title feat: add resource_limits to SubnetRecord feat: add subnet resource limits to registry subnet record Mar 13, 2026
@mraszyk mraszyk marked this pull request as ready for review March 13, 2026 16:49
@mraszyk mraszyk requested review from a team as code owners March 13, 2026 16:49
@mraszyk mraszyk requested review from a team as code owners March 13, 2026 16:49
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

This pull request changes code owned by the Governance team. Therefore, make sure that
you have considered the following (for Governance-owned code):

  1. Update unreleased_changelog.md (if there are behavior changes, even if they are
    non-breaking).

  2. Are there BREAKING changes?

  3. Is a data migration needed?

  4. Security review?

How to Satisfy This Automatic Review

  1. Go to the bottom of the pull request page.

  2. Look for where it says this bot is requesting changes.

  3. Click the three dots to the right.

  4. Select "Dismiss review".

  5. In the text entry box, respond to each of the numbered items in the previous
    section, declare one of the following:

  • Done.

  • $REASON_WHY_NO_NEED. E.g. for unreleased_changelog.md, "No
    canister behavior changes.", or for item 2, "Existing APIs
    behave as before.".

Brief Guide to "Externally Visible" Changes

"Externally visible behavior change" is very often due to some NEW canister API.

Changes to EXISTING APIs are more likely to be "breaking".

If these changes are breaking, make sure that clients know how to migrate, how to
maintain their continuity of operations.

If your changes are behind a feature flag, then, do NOT add entrie(s) to
unreleased_changelog.md in this PR! But rather, add entrie(s) later, in the PR
that enables these changes in production.

Reference(s)

For a more comprehensive checklist, see here.

GOVERNANCE_CHECKLIST_REMINDER_DEDUP

@schneiderstefan
Copy link
Contributor

Would it be possible to break that down into smaller, reviewable, PRs? Maybe start with the registry, and ignore it in the new fields in the replica in the first PR. The rest could also be broken down into refactor and reading the registry.

@mraszyk mraszyk marked this pull request as draft March 16, 2026 11:49
@mraszyk mraszyk changed the title feat: add subnet resource limits to registry subnet record feat: enforce maximum subnet state size from registry in DSM Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants