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

Use mycelo for the e2e tests #1384

Closed
oneeman opened this issue Feb 17, 2021 · 1 comment · Fixed by celo-org/celo-monorepo#8086
Closed

Use mycelo for the e2e tests #1384

oneeman opened this issue Feb 17, 2021 · 1 comment · Fixed by celo-org/celo-monorepo#8086
Assignees
Labels
theme: dev-productivity Whatever makes devs more productive (ci/testing/tooling)

Comments

@oneeman
Copy link
Contributor

oneeman commented Feb 17, 2021

Currently, the e2e take a long time (over 10 minutes) just in running the core contract migrations. This could be reduced to be nearly instant by using mycelo to generate a genesis.json which already includes the core contracts.

It isn't clear whether we should use mycelo just to generate genesis.json, or also use it for subsequent steps such as actually running the local testnet. That would depend on the code changes involved and the resulting code. The big gain in terms of test running times would come from the genesis generation making subsequent migrations unnecessary.

@oneeman
Copy link
Contributor Author

oneeman commented Jun 10, 2021

Current status:

mergify bot pushed a commit to celo-org/celo-monorepo that referenced this issue Jul 7, 2021
…racts (#8086)

### Description

This PR updates some of the e2e tests in celotool to use mycelo to generate genesis files with the core contracts already deployed, instead of deploying the core contracts while the network is running (which takes around 10 minutes).

* Converted tests: 
    * Transfer tests
    * Replica tests
    * Validator order tests
    * Slashing tests
    * Governance tests
* Tests which were already using mycelo (and therefore didn't need anything done):
    * Blockchain parameters tests
    * CIP35 tests
    * Sync tests
* Tests which were not converted
    * Attestation tests: these tests are not being run as part of CI and are erroring out as is:
    ```
      1) attestations tests
           Attestations
             requests an attestation:
         Error: Error: invalid arrayify value (argument="value", value="+155555555550000000000000000000000000000000000000000000000000000", code=INVALID_ARGUMENT, version=bytes/5.0.4)
    ```

The governance tests required a minute-long sleep after the network starts up, in order to give time for all the validators to have all the other validators' enodes.  This is due to how the announce messages are sent out on startup, sending enode queries once a minute.  As a result, the first validator (which starts first and sends out its message before the others are up and connected to it) doesn't get its enode known by the others until about a minute after the network starts up, leading to missed signatures which were causing the tests to fail (since they implicitly depend on validator and validator group uptime).  This problem wasn't noticeable before because the migrations meant the network had been running for close to 10 minutes already by the time they are done.  The sleep can be removed once we modify the announce behavior, which we should do in order to allow testnets to not take close to a minute to produce the first block and to not have missed signatures at the beginning.  Still, even with this sleep the test's setup is still a lot faster than when we had to run the migrations against the running network.

### Other changes

* Updated the celotool e2e geth hooks so that the `before()` hook when using mycelo no longer starts up the nodes, but instead only does `geth init`.  The reason the hook was running the nodes before was to run the migrations, but this isn't necessary when using mycelo.
* Made the transfer test use a different address as tx fee recipient, to fix the flakiness we had due to epoch rewards going to the same account as the one we checked for the tx fee receipts.  Also changed the tolerance it uses for its assertions to use be relative (in terms of percent) rather than absolute.

### Tested

* Automated tests

### Related issues

- Fixes celo-org/celo-blockchain#1384

### Backwards compatibility

No incompatibility.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: dev-productivity Whatever makes devs more productive (ci/testing/tooling)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants