Executing a Cadence script fails on any block that is not the latest unsealed block
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 361
- Forks
- 159
- PR merge metrics
- No merged PRs in 30d
Description
Problem
Hi, I have been trying to execute Cadence scripts at specified block heights, but doing so in any block which is not the latest unsealed block results in this error message:
* rpc error: code = Internal desc = failed to execute the script on the execution node execution-4ab025ab974e7ad7f344fbd16e5fbcb17fb8769fc8849b9d241ae518787695bd@execution-003.mainnet5.nodes.onflow.org:3569=1000: rpc error: code = Internal desc = failed to execute script: failed to execute script (internal error): ledger returns unsuccessful: error getting register (account_address_state) value at ba315e60d57ce02ca75e72509c50a3a7acbb02b5dbf23e36747d18a7fd3d4560: trie with the given rootHash [ba315e60d57ce02ca75e72509c50a3a7acbb02b5dbf23e36747d18a7fd3d4560] not found
Steps to Reproduce
I've been using a generated Rust client from the gRPC protobuf files, but I have also been able to reproduce the bug when following this tutorial:
Steps to reproduce:
- Clone the repo from the article (https://github.com/rrrkren/topshot-sales)
go run main.go
I've tried running on the latest unsealed block, latest sealed block, and current_height - <arbitary_number> block. Only the latest unsealed block works for me.
Acceptance Criteria
- Being able to run Cadence scripts at arbitrary block heights
Context
Trying to query the network for topshot events.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running main.go from the linked topshot-sales reproduction and compare execution at the latest unsealed, latest sealed, and earlier block heights. Then trace the relevant Flow execution path using the reported trie-root error; the issue is done when Cadence scripts execute successfully at arbitrary block heights.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, rust
- Domain
- blockchain
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100