Skip to content

fix(standards): bound transfer policy dispatch to the reference block - #3748

Open
onurinanc wants to merge 10 commits into
nextfrom
fix-apply-expiration-transfer-callbacks
Open

fix(standards): bound transfer policy dispatch to the reference block#3748
onurinanc wants to merge 10 commits into
nextfrom
fix-apply-expiration-transfer-callbacks

Conversation

@onurinanc

Copy link
Copy Markdown
Collaborator

Summary

  • Apply the default expiration limit in invoke_transfer_policy, before the pause check, so the pause flag and every active policy are bounded to the reference block.
  • Document the limit on invoke_send_policy, invoke_receive_policy, TransferAllowAll and TokenPolicyManager.

Closes #3744.

@partylikeits1983

Copy link
Copy Markdown
Contributor

Was this not addressed already here? #3512

@onurinanc

Copy link
Copy Markdown
Collaborator Author

@partylikeits1983

After #3512 is merged I believe the following are still left:

  • The active policy root itself is read by the dispatcher before the dispatch happens, which means that switching from an allow_all policy to a more restrictive policy could be indefinitely bypassed by anchoring to a reference block that existed before the switch.
  • The pause flag is read by the dispatcher rather than by the policy itself, so it was only incidentally limited whenever the active policy happened to set its own limit
  • Policy roots that were registered using TransferPolicy::custom were not enforced
  • An active TransferAllowAll policy does not set any expiration date, and the dispatcher does not set one either, which is why these transfers remained unbounded and limitless.

So, I've done this updates to fully close #3744

@mmagician mmagician left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, thanks for closing this gap on the policy dispatch procedure

@partylikeits1983 partylikeits1983 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks great! Thank you!

@partylikeits1983

partylikeits1983 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

@onurinanc apologies for updating your branch, I thought updating with latest next wouldn't break anything. Will fix.

@partylikeits1983

partylikeits1983 commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Updated this PR against next pushed minimal fixes.

  1. removed the stale AccountBuilder::with_asset_callbacks(AssetCallbackFlag::Enabled)
  2. regenerated the note cost tables with make update-note-costs (where the majority of the diff is from now)

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.

H-04: Transfer Policy Enforcement Reads Faucet State From Prover-Chosen Historical Reference Blocks

3 participants