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

Support forked deployments #1283

Draft
wants to merge 6 commits into
base: develop
Choose a base branch
from
Draft

Support forked deployments #1283

wants to merge 6 commits into from

Conversation

area
Copy link
Member

@area area commented Aug 6, 2024

To improve the accuracy and throughput of QA, there's a desire for the ability to have an entire environment that is forked from the QA environment. That includes the database and so-forth, which is out of scope for here, but this PR includes the elements that are required on our side.

There are two main features here:

  • Deploying the latest versions of any contracts that have been updated since the deployment to QA. This is done via the deployToForkedChain script (that's called from outside this repo). This script also downloads the latest reputation state, which the reputation miner will use.
  • Allowing historical querying of reputation; I've added a new forked.js to the miner which is only intended to be used as the miner in this circumstance. It allows mining with an address with an unknown private key (via the getImpersonatedSigner helper, as well as querying the oracle we've forked from in the case of an unknown (and therefore presumed historical) reputation state. This will over-query the oracle (as any reputations queried that don't exist will also be tried upstream), but without having the forked miner sync the whole of history (time-consuming and/or expensive), I think it's the best that we can do.

Leaving in draft for now, as the feature as a whole is still in the testing phase, but we're getting close to this being reviewed and merged.

Copy link
Member

@kronosapiens kronosapiens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine to me, a few comments here and there

@@ -0,0 +1,106 @@
const hre = require("hardhat");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason you don't use globals here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't being run from inside hardhat, so I don't think it exists?

}

async function main() {
signer = await ethers.getImpersonatedSigner("0x56a9212f7f495fadce1f27967bef5158199b36c7");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comment clarifying what this address is. Random?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the address in control of the production network, which has to be the one to update resolvers etc.


await hre.run("deploy");

const DEPLOYED_NETWORK_ADDRESS = "0x777760996135F0791E2e1a74aFAa060711197777";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto this -- where is this coming from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the address ColonyNetwork is deployed to in production.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants