Please help with: "Error in oracle callback popCapsule: No capsules available"; if constructor is public

If i try deploy contract with public constructor:

i got errors in aztec-sandbox:

maztec-1     | node WARN Simulated tx 06f5f029982338126a67798915cb0d7149882628170b8a608465fa7f12dae883 reverts: Error: Failed to solve brillig function, reason: explicit trap hit in brillig
aztec-1     | simulator:acvm ERROR Error in oracle callback popCapsule: No capsules available
aztec-1     | simulator:acvm ERROR Error in oracle callback callPrivateFunction: Error awaiting `foreign_call_handler`
aztec-1     | simulator:acvm ERROR Error in oracle callback popCapsule: No capsules available
aztec-1     | simulator:acvm ERROR Error in oracle callback callPrivateFunction: Error awaiting `foreign_call_handler`
aztec-1     | simulator:acvm ERROR Error in oracle callback popCapsule: No capsules available
aztec-1     | simulator:acvm ERROR Error in oracle callback callPrivateFunction: Error awaiting `foreign_call_handler`

if i remove SharedImmutable variables and their initialization + sign to constructor as private - contract deployment will work fine

Please tell me what I need to do to initialize these variables?

16 Likes

Hey @n0m44! Apologies for the delay in the response. Could you try commenting out the balances.at(...).add(...) line and trying again? I think the issue may be that EasyPrivateUint storage is meant to be used from private functions, that’s why it’s failing now, and why it works when you switch the constructor to private.

If so, this means we need to do a better job at preventing private-only methods from being called in a public context, and vice-versa!

Edit: Just tried your code locally and got the same error Failed to solve brillig function, reason: explicit trap hit in brillig, which comes from trying to call .add on an EasyPrivateUint. Confirmed that’s the error.

11 Likes

One more thing @n0m44: I wasn’t able to reproduce the capsule errors you got. Could you share the code you were using for deployment and versions, to see if we can figure out why that’s happening?

20 Likes