-
Notifications
You must be signed in to change notification settings - Fork 139
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
Add access top type to model inaccessible access for identity maps #3406
Conversation
Cadence Benchstat comparisonThis branch with compared with the base branch onflow:master commit 58c36c5 Collapsed results for better readability
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
The behaviour in the tests is looking really good 👌 It's great to see that we can specifically reject references and prevent rights escalation, while at the same time allow support owned value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. great tests!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! 👏
Closes https://github.com/dapperlabs/cadence-internal/issues/236
The
Identity
entitlement mapping has a codomain (output space) that is theoretically infinite, as any number of possible entitlements can be produced from it. This means that in order to be safe when initializing a field that is mapped with theIdentity
, or a mapping that includes it, the reference used to initialize this field must be authorized to an impossible access, an infinite set of entitlements. Otherwise, theIdentity
mapping could be used to escalate entitlements, as seen in one of the tests added in this PR.This PR introduces a new
None
access to represent this impossible set, and ensures that this permits no other access besides itself (functionally the top type of the access lattice, the same way thatall
is the bottom). Initializing a reference with theIdentity
map type requires this top access value, which can only be obtained via immediately creating a reference to an owned value. This way we ensure thatIdentity
-mapped fields can never be initialized with a reference that has a limited entitlement set.master
branchFiles changed
in the Github PR explorer