AztecProtocol / aztec-packages

Apache License 2.0
155 stars 157 forks source link

AVM simulator: Cannot destructure property 'path' of 'files[fileId]' as it is undefined #7188

Open olehmisar opened 1 week ago

olehmisar commented 1 week ago

I sometimes get this error when a transactions fails in aztec sandbox:

(JSON-RPC PROPAGATED) Cannot destructure property 'path' of 'files[fileId]' as it is undefined

One way to reproduce it is to deploy a contract to the same address twice:

await TokenContract.deploy().send({ contractAddressSalt: Fr.zero(), universalDeploy: true }).wait();
await TokenContract.deploy().send({ contractAddressSalt: Fr.zero(), universalDeploy: true }).wait();

I guess it happens here where files[fileId] should be checked for != null: https://github.com/AztecProtocol/aztec-packages/blob/6f1212ff0d6bb7a326e571da2d49cfac75a8e5de/yarn-project/simulator/src/acvm/acvm.ts#L51