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

Improve deployedInstance #38

Open
jubeira opened this issue May 29, 2023 · 0 comments
Open

Improve deployedInstance #38

jubeira opened this issue May 29, 2023 · 0 comments

Comments

@jubeira
Copy link
Contributor

jubeira commented May 29, 2023

From time to time we need to deploy a batch of contracts that depend on each other.
A recent example was the L2GaugeCheckpointer, which needed GaugeAdder V4 and its respective coordinator script contract.

When this happens, it's common to prepare the deployments before the bottom level contracts (i.e. those with less dependencies) are deployed. The fork tests for the top level contracts can still be developed, but only by deploying the dependencies within the test itself, which is not ideal. Those extra setup blocks are then removed when the dependencies are deployed and become available to the fork test.

The workflow usually goes like this:

  1. Prepare tasks and fork tests for all contracts at the same time. Bottom level contracts' tests can be completed, top level contracts' tests require extra setup blocks that deploy the dependencies.
  2. Review, merge and deploy bottom level contracts.
  3. Remove extra setup blocks from top level contracts and rebase PRs.
  4. Review, merge and deploy top level contracts.

The problem is that the fork test's block number also needs to be updated at step (3). If not updated, the test will run since the output addresses for the dependencies will be available, but the forked network will not have the contract code in those addresses at that block height. To make matters worse, the error messages are very misleading, so it's sometimes hard to get to the root cause of the problem.

The proposal would be for Task#deployedInstance to fail early when there's no contract code at the specified address.

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

1 participant