-
Notifications
You must be signed in to change notification settings - Fork 166
docs: clarify FPI expiration requirements #3795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
5f3c9b9
83574a6
0a15a62
58430bb
8a6b0cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,24 @@ merged to form the account's `Code` and `Storage`. | |
|
|
||
| The component's code defines a library of functions that can perform arbitrary computations, as well as read and write to account storage. | ||
|
|
||
| ### FPI-callable mutable reads | ||
|
|
||
| Account component procedures can become part of an account's public interface and can be called | ||
| from note scripts, transaction scripts, and foreign accounts through FPI. If such a procedure reads | ||
| mutable security state, it must call `tx::update_expiration_block_delta` in the execution path that | ||
| reads that state. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Claude has a tendency to introduce newlines to
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true about claude, but this is not claude :) |
||
|
|
||
| This rule applies to asset callbacks and to procedures that read blocklists, allowlists, pause | ||
| flags, role maps, active policy roots, oracle values, risk parameters, or other mutable state where | ||
| stale reads can change an authorization or pricing decision. The component owns the recency bound: | ||
| callers can choose an old reference block, so callers cannot be trusted to set the expiration | ||
| policy for the component. | ||
|
partylikeits1983 marked this conversation as resolved.
Outdated
|
||
|
|
||
| Procedures that only read immutable data, or for which stale data is acceptable, may omit the | ||
| expiration delta. Standards components can use `miden::standards::expiration::apply_default` for | ||
| the common limit, or call `tx::update_expiration_block_delta` directly when they need a custom | ||
| limit. | ||
|
|
||
| ## Component metadata | ||
|
|
||
| The component metadata describes the account component entirely: its name, description, version, and storage layout. | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.