F
Flow4mo ago
Giovanni S

Giovanni S | Flow (2024-07-25)

I'm getting some weird errors running a load<@AnyResource> in the latest pre-release CLI 🧵
10 Replies
Needle
Needle4mo ago
I've created a thread for your message. Please continue any relevant discussion in this thread. You can rename this thread using /title <new title> If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadence
Giovanni S
Giovanni S4mo ago
The test here - https://github.com/onflow/hybrid-custody/actions/runs/10086158860/job/27888252177?pr=170#step:5:73 Previously passed with the same code using v1.21.0-cadence-v1.0.0-preview.27, but fails with v1.21.0-cadence-v1.0.0-preview.31 with the message:
[Error Code: 1101] cadence runtime error: Execution failed:\nerror: invalid transfer of value: expected `<<invalid>>`, got `HybridCustody.Manager
[Error Code: 1101] cadence runtime error: Execution failed:\nerror: invalid transfer of value: expected `<<invalid>>`, got `HybridCustody.Manager
The txn is failing on loading the HybridCustody.Manager resource as @AnyResource with this txn
import "HybridCustody"
import "Burner"

transaction {
prepare(acct: auth(Storage) &Account) {
let m <- acct.storage.load<@AnyResource>(from: HybridCustody.ManagerStoragePath)
?? panic("no resource found in manager storage path")
Burner.burn(<- m)
}
}
import "HybridCustody"
import "Burner"

transaction {
prepare(acct: auth(Storage) &Account) {
let m <- acct.storage.load<@AnyResource>(from: HybridCustody.ManagerStoragePath)
?? panic("no resource found in manager storage path")
Burner.burn(<- m)
}
}
The message line expected <<invalid>> when trying to load @AnyResource is odd considering all other non-load test cases succeed So looks like the txn succeeds in .27 but starts failing in .28 which had a Cadence update to Cadence v1.0.0-preview.35. I don't see anything in that version's release notes that would lead me to believe there's a significant change in load behavior. Does this look like a bug? cc @turbolent @Supun
turbolent
turbolent4mo ago
Hmm, that looks odd. Do you have this as a reproducer somewhere? (e.g. test in repo) ah, sorry, I didn't see the link could you please try with the versions in between, i.e. 28, 29, 30? that way we can maybe better pinpoint where the regression was introduced
Giovanni S
Giovanni S4mo ago
27 succeeds, 28, 29, 30, 31 all fail with the same output
turbolent
turbolent4mo ago
great thanks! I guess it should be possible to check out that branch locally and run the tests right? I'll try to replace the Cadence version and see what changed
turbolent
turbolent4mo ago
@Giovanni S and I guess even main of https://github.com/onflow/hybrid-custody fails with the newer CLI/Cadence versions?
Giovanni S
Giovanni S4mo ago
Yes it does. I also rolled back CLI version in https://github.com/onflow/hybrid-custody/pull/170/commits/dced96ebdf964c0b0bd21a96b64779dcd6027ec1 and the successive CI run passed https://github.com/onflow/hybrid-custody/actions/runs/10100835346/job/27933086660 Wa able to repro on migrationnet in transaction 55ac88fd65ed289e67d5aa960a1f6f3d4e8ab9b702f2687e3cab65b916d3e3e0
turbolent
turbolent4mo ago
Supun already has a fix https://github.com/onflow/cadence/pull/3493 🎉 👏
Giovanni S
Giovanni S4mo ago
Awesome, thank you!
Want results from more Discord servers?
Add your server