Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Error contract code couldn't be stored with PackagedApp on Infura mainnet #91

Closed
spalladino opened this issue Sep 13, 2018 · 2 comments
Closed
Labels
kind:bug source:user-feedback Feedback provided by end-users

Comments

@spalladino
Copy link
Contributor

spalladino commented Sep 13, 2018

When running zos push, it occassionally crashes when trying to deploy the PackagedApp contract. However, when inspecting the transactions sent in etherscan, the PackagedApp is successfully deployed.

[AppDeployer] Deploying new UpgradeabilityProxyFactory...
[AppDeployer] Deployed UpgradeabilityProxyFactory REDACTED
[AppDeployer] Deploying new Package...
[AppDeployer] Deployed Package REDACTED
[AppDeployer] Deploying new AppDirectory...
[AppDeployer] Deployed AppDirectory REDACTED
[AppDeployer] Adding new version...
[AppDeployer] Added version 0.1.0
[AppDeployer] Deploying new PackagedApp...
[ZosNetworkFile] Successfully written zos.mainnet.json
[Error] Error: Error: The contract code couldn't be stored, please check your gas amount.
    at deploy (/usr/local/lib/node_modules/zos/node_modules/zos-lib/lib/utils/Transactions.js:55:70)
    at process._tickCallback (internal/process/next_tick.js:68:7)

Note that the PackagedApp requires that the version is registered in the package on the constructor: https://github.com/zeppelinos/zos/blob/936eec451c2919299171265c7ce48ab0077035b2/packages/lib/contracts/application/PackagedApp.sol#L26

This means that it requires that the previous transaction (the one that reports Added version 0.1.0) finishes successfully. It could be the case that the Infura nodes are out of sync, and thus the node that handles the PackagedApp tx has not yet seen the previous tx, and hence fails.

We need to try to reproduce the issue first, which we could do by trying to send a tx that depends on a previous one being run, before the first is actually mined. Once we know how to reproduce it, let's discuss how to fix (maybe retries on getTransactionReceipt, since the tx is actually successful?).

@spalladino spalladino added kind:bug source:user-feedback Feedback provided by end-users labels Sep 13, 2018
@spalladino spalladino added this to the v2.0.0 milestone Sep 13, 2018
@spalladino spalladino self-assigned this Sep 18, 2018
@spalladino
Copy link
Contributor Author

Apparently it's a problem with infura+mainnet+web3. In order to properly fix, we'd need to reimplement web3's contract#new, since the method that waits for a contract to be deployed cannot handle Infura's out-of-order responses.

@spalladino spalladino removed their assignment Sep 19, 2018
@facuspagnuolo facuspagnuolo modified the milestones: v2.0.0, Backlog Oct 15, 2018
@spalladino
Copy link
Contributor Author

Closing as issue was fixed in web3.js

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:bug source:user-feedback Feedback provided by end-users
Projects
None yet
Development

No branches or pull requests

2 participants