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 #148

Closed
sideninja opened this issue May 11, 2022 · 1 comment
Closed

Borrowing Capability from non existent address crashes emulator #148

sideninja opened this issue May 11, 2022 · 1 comment

Comments

@sideninja
Copy link
Member

@justjoolz commented on Fri Apr 08 2022

🐞 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 commented on Fri Apr 08 2022

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.


@janezpodhostnik commented on Fri Apr 08 2022

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 #143.

Just needs merging and releasing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants