Skip to content

fix: distinguish explicit vs implicit delegation permission revocation for Intents#2661

Merged
JoeCap08055 merged 11 commits intomainfrom
fix/add-missing-revoked-at-delegation-response
Jan 8, 2026
Merged

fix: distinguish explicit vs implicit delegation permission revocation for Intents#2661
JoeCap08055 merged 11 commits intomainfrom
fix/add-missing-revoked-at-delegation-response

Conversation

@JoeCap08055
Copy link
Copy Markdown
Collaborator

@JoeCap08055 JoeCap08055 commented Jan 5, 2026

Description

This PR does the following:

  • Adds revoked_at block number to the overall DelegationResponse, indicating the revocation of the overall Provider relationship, rather than individual Intent(s)
  • Adds explicit_revoked_at block number to DelegationResponse for each delegated Intent; the existing revoked_at maintains its original meaning of the earlier of the Intent or overall Delegation revocation block.
  • Changes the newly-added runtime API method get_granted_intents_by_msa_id to get_delegation_for_msa_and_provider, to provide a stable method for obtaining an entire delegation rather than just the list of delegated intents. Previously getting the entire delegation would have required a direct storage query, or retrieving ALL delegations. As this was a recently-added API method, the only downstream effect is internal, as it had not been deployed yet.

Goal

Closes #2660

Checklist

  • Updated Pallet Readme?
  • Updated js/api-augment for Custom RPC APIs?
  • Unit Tests added?
  • Spec version incremented?

Comment on lines +97 to +100
/// Block number when the permission was/will be EFFECTIVELY revoked, taking into consideration the overall provider delegation revocation.
pub revoked_at: BlockNumber,
/// Block number the permission was/will be explicitly revoked (i.e., not implicitly revoked by a top-level revocation) (0 = not revoked)
pub explicit_revoked_at: BlockNumber,
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Opted to add new explicit_revoked_at instead of effective_revoked_at, because revoked_at in this context has historically ALWAYS meant the effective revocation block.

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jan 5, 2026
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Jan 5, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Jan 5, 2026

Codecov Report

❌ Patch coverage is 96.00000% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
common/primitives/src/msa.rs 90.00% 1 Missing ⚠️
Files with missing lines Coverage Δ
pallets/msa/src/lib.rs 92.39% <100.00%> (+0.01%) ⬆️
pallets/msa/src/rpc/src/lib.rs 67.28% <ø> (ø)
common/primitives/src/msa.rs 88.42% <90.00%> (-0.22%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jan 5, 2026
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jan 5, 2026
Copy link
Copy Markdown
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

Looks good, ship it!

Copy link
Copy Markdown
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

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

Approving, added a few comment just to make sure.

Copy link
Copy Markdown
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

great! 👍

@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jan 7, 2026
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Jan 7, 2026
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jan 7, 2026
Copy link
Copy Markdown
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

Approving, though reading through the tests to understand what you did, is making me rethink creating a bunch of setup at the very top of a long test file since I completely lose context in a diff, especially for a test file I'm unfamiliar with. Anyway, not for this PR, but food for thought.

@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jan 8, 2026
@JoeCap08055 JoeCap08055 merged commit 2e66500 into main Jan 8, 2026
35 checks passed
@JoeCap08055 JoeCap08055 deleted the fix/add-missing-revoked-at-delegation-response branch January 8, 2026 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

metadata-changed Metadata has changed since the latest full release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Delegation API is missing top-level revocation block

4 participants