Skip to content
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

Borrowing Capability from non existent address crashes emulator #488

Closed
justjoolz opened this issue Apr 8, 2022 · 3 comments
Closed

Borrowing Capability from non existent address crashes emulator #488

justjoolz opened this issue Apr 8, 2022 · 3 comments
Labels
Bug The issue represents a bug, malfunction, regression

Comments

@justjoolz
Copy link

🐞 Bug Report

If you send a transaction that tries to borrow a capability from an account that doesn't exist, the cli and emulator hang Waiting for transaction to be sealed...⠸

ERRO[0007] Failed to commit block error="[Failure Code: 2000] unknown failure: transaction invocation failed when executing transaction: fatal error: storage error: storage address allocation failed: failed to store the key storage index: failed to update storage used by key #73746f726167655f696e646578 on account 0000000000000001: account 0000000000000001 storage used is not initialized or not initialized correctly"

Reproduction steps

Steps to reproduce the behaviour:

  1. Run transaction that:
    let nonExistingAddr = Address(0x01) let ref = getAccount(nonExistingAddr).getCapability(ExampleNFT.CollectionPublicPath).borrow<&{NonFungibleToken.CollectionPublic}>()!
  2. See error

Expected behaviour

Transaction should execute with an error and block should still seal

Specifications

  • System: macOS 12.0.1
  • Flow CLI: v0.33.0

@sideninja
Copy link
Member

Thank you for this report. This looks like a bug to me and I will further investigate and provide a fix with the next release.

@sideninja sideninja added Bug The issue represents a bug, malfunction, regression L1 and removed Feedback labels Apr 8, 2022
@janezpodhostnik
Copy link
Contributor

Thank you for the report.

This is something that was also discovered on testnet and addressed in onflow/flow-go#2253. And included in the emulator in onflow/flow-emulator#143.

Just needs merging and releasing.

@sideninja
Copy link
Member

Issue moved to onflow/flow-emulator #148 via ZenHub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug The issue represents a bug, malfunction, regression
Projects
None yet
Development

No branches or pull requests

3 participants