Repository navigation
[v1.10] Port v1.10.6-rc - #4528
Merged
Merged
Conversation
…ternal into supun/validate-enum-import
…ternal into supun/validate-enum-import
Fix storage controller retarget
Validate enum raw value during import
…rasure Fix function parameter authorization erasure
…ility-auth-leak Prevent authorized capability recovery from bound container methods
…ion-type-auth-leak Prevent authorized reference recovery from bound container methods on function-typed elements
Clean up entitlement tests
…lidation Validate arguments during contract function invocation
…ce-detection Detect reference types nested in function types
…r-record-exists Assert storage controller update overwrites existing
…tion Harden enum case validation during import
Nested reference authorizations were intersected with the accessed
reference's raw authorization. For a field with mapping access that is too
restrictive: the authorization such a field grants is the image of the
accessed reference's authorization through the map, not the authorization
itself.
Given `entitlement mapping M { G -> E }`, reading an `access(mapping M)`
field through an `auth(G)` reference grants `E`, so a nested `auth(E)`
reference has to survive. Intersecting the raw `G` with `E` instead
produced no authorization at all, since the two are disjoint.
Introduce grantedMemberAuthorization for that distinction, and use it as
the cap in both branches.
The wrapping branch had the same flaw, independently of capability- and
function-typed fields: a mapped field of a container type holding
references, such as `access(mapping M) let x: [auth(E) &T]`, lost its
element authorization as well. The comment there claimed the mapped and
raw authorizations can only differ for non-mapped fields, because a mapped
field cannot have a reference type. That holds for a field that *is* a
reference, but not for one that merely *contains* references, which is
exactly the case this cap applies to.
Reported by @SupunS.
…WithoutStorageComparison
(cherry picked from commit 1587628)
(cherry picked from commit 52f5dfd)
(cherry picked from commit b24bb8f)
(cherry picked from commit f13cf5c)
(cherry picked from commit 20e73c2)
(cherry picked from commit d5fbea6)
Fix entitlements disjunction with empty set
…y-check-tool Improve analysis and compatibility check tool
…-auth #548 landed on the base branch and appended test functions to the same two files this branch appends to, which is the only conflict. Kept both sides: TestEntitlementMapEmptyDisjunctImage and TestEntitlementMapEmptyDisjunctImageControls from the base branch, followed by this branch's member capping tests.
The cap used the authorization of the reference the member is read through
even for members whose access restricts them to a location. Those are
gated by where the reading code is, not by any authorization: no code
outside that location can read them through a reference of any
authorization, so capping them only restricts the declaring code itself.
This broke FlowTransactionScheduler, which reads its own
`access(contract) let handler: Capability<auth(Execute) &{TransactionHandler}>`
through the unauthorized `&TransactionData` that borrowTransaction
returns, and then calls the handler's `access(Execute) fun`. Capping the
capability's borrow type left it unauthorized, so the call was rejected.
Cap only members that code anywhere may read: entitlement-based and
publicly readable ones. An unspecified access modifier counts as publicly
readable, which is both what it means outside a restricted access check
mode and the conservative answer.
The escalation this branch fixes is unaffected: an `access(all)` field of
capability or function type stays capped, which is the case an outside
holder of a weak reference can actually reach.
…ction-auth Cap nested reference authorizations of capability- and function-typed fields
intersectReferenceAuthorizationsInType intersected the authorization of every reference it found, including references in function parameter types. Parameters are contravariant: a reference there is one the reader has to supply, not one it obtains, so capping it grants the reader nothing. It instead weakens what callers are required to pass. A function-typed field or element whose parameter carries an entitlement, read through a weaker reference, therefore accepted an under-entitled argument. The checker allowed the call, and the runtime rejected it with `internal error: invalid reference conversion error`, since the function's actual parameter type is unchanged. Passing an under-entitled reference is now a type error again, as it was before the cap was introduced. Variance cannot be derived locally, because it only ever flips at parameters and flips back for the parameter of a parameter. It is therefore tracked through the traversal. That nested position is not merely theoretical: it is where a reader's own callback receives an authorized reference, so it must still be capped. It is what the generic function binder identity test now uses to force a rewrite, in place of the contravariant parameter it used before. Type parameter bounds keep being preserved unchanged, as before.
The binder identity test forced the rewriter to rebuild by putting an authorized reference in a parameter, which is exactly what this branch stops capping. Rather than replacing that parameter with the callback that now forces the rebuild, keep it and assert what it demonstrates: a reference in a parameter is contravariant, so it is left as declared, identity included. The test now covers both directions of the variance rule at the unit level, where only the language-level tests did before: - the callback's parameter is covariant again, and is capped - the parameter itself is contravariant, and is not Verified that each assertion fails on its own: making parameters covariant breaks the preserved-reference assertion, and never capping parameters breaks the rebuild the callback forces.
The variance tests covered a reference at parameter depth 0, 1 and 2 only. Two alternating data points are consistent with flipping once, and none of the cases mixed parameter and return positions, so they were also consistent with the wrong reading that the parity is of the total nesting depth rather than of the parameter nesting depth. Add a table pinning the resulting type exactly for depths 0 through 4, and for the four mixed parameter/return combinations, reading the resulting type from the type mismatch rather than inferring it from what is accessible. Each case also cross-checks the parity rule it demonstrates, so a typo in an expected type does not silently pass. Verified against three wrong implementations: never flipping fails 4 subtests, never capping parameters fails 3, and flipping at return types as well as parameters fails 4.
…ce-capping Only cap reference authorizations in covariant positions
Benchstat comparison
Results
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
SupunS
approved these changes
Aug 18, 2026
social4hyq
pushed a commit
to social4hyq/homebrew-core
that referenced
this pull request
Sep 20, 2026
cadence 1.10.6 Created-by: HarmonybrewBot Commit-by: HarmonybrewBot Merged-by: HarmonybrewBot Description: Created by `brew bump` --- Created with `brew bump-formula-pr`.<details> <summary>release notes</summary> <pre><!-- Release notes generated using configuration in .github/release.yml at v1.10.6 --> ## What's Changed ### Other Changes * [v1.10] Port v1.10.6-rc by @turbolent in onflow/cadence#4528 - https://github.com/onflow/cadence-internal/pull/532 - https://github.com/onflow/cadence-internal/pull/531 - https://github.com/onflow/cadence-internal/pull/534 - https://github.com/onflow/cadence-internal/pull/535 - https://github.com/onflow/cadence-internal/pull/536 - https://github.com/onflow/cadence-internal/pull/537 - https://github.com/onflow/cadence-internal/pull/538 - https://github.com/onflow/cadence-internal/pull/539 - https://github.com/onflow/cadence-internal/pull/540 - https://github.com/onflow/cadence-internal/pull/541 - https://github.com/onflow/cadence-internal/pull/542 - https://github.com/onflow/cadence-internal/pull/543 - https://github.com/onflow/cadence-internal/pull/544 - https://github.com/onflow/cadence-internal/pull/545 - https://github.com/onflow/cadence-internal/pull/546 - https://github.com/onflow/cadence-internal/pull/547 - https://github.com/onflow/cadence-internal/pull/549 - https://github.com/onflow/cadence-internal/pull/550 - https://github.com/onflow/cadence-internal/pull/554 - https://github.com/onflow/cadence-internal/pull/548 - https://github.com/onflow/cadence-internal/pull/555 - https://github.com/onflow/cadence-internal/pull/551 - https://github.com/onflow/cadence-internal/pull/552 **Full Changelog**: https://github.com/onflow/cadence/compare/v1.10.4...v1.10.6</pre> <p>View the full release notes at <a href="https://github.com/onflow/cadence/releases/tag/v1.10.6">https://github.com/onflow/cadence/releases/tag/v1.10.6</a>.</p> </details> <hr> See merge request: Harmonybrew/homebrew-core!17020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
masterbranchFiles changedin the Github PR explorer