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

feat: Use addresses from mangrove-deployments and context-addresses packages #651

Merged
merged 13 commits into from
Nov 15, 2023

Conversation

espendk
Copy link
Collaborator

@espendk espendk commented Nov 7, 2023

This PR is a first improvement to the deployment process: It moves context and deployment addresses out of this repo to these new repos/npm packages:

This enables better management of deployments, incl. matching deployments to contract versions. Furthermore, it removes the need to publish new versions of this package due to deployments; This in turn allow us to use the package SemVer for contract versioning.

Similar considerations apply to extracting the context addresses.

Later PR's will address other remaining aspects re. the deployment process such as:

  • Separate deployment and governance scripts
  • Update README with the new process.

Brief solution overview

The existing file-based address infrastructure is retained: Addresses are still read from files in the addresses folder using the same code and directory&file structures as before.

The change is that, instead of having the addresses files in git, they are generated in a new build step by copying addresses from

This is handled by two new scripts:

  • copyDeploymentAddresses.js
  • copyContextAddresses.js.

These scripts have a few configuration parameters in config.js. See that file for details and documentation.

Also, the CI file guard that guarded against unintended changes to addresses has been removed, since addresses are no longer in this repo.

Versioning and deployments

When querying mangrove-deployments for deployment addresses, one must specify the contract version and whether the deployment is of a "released" version.

By default, copyDeploymentAddresses.js queries for contract versions matching patches of the current package version, regardless of whether it's released. Both defaults can be changed in config.js; In that case, the user is responsible for specifying a version that is compatible with the current version of the governance scripts.

@espendk espendk force-pushed the feat/move-addresses-to-mangrove-deployments branch 3 times, most recently from 2af89e4 to 53958cd Compare November 9, 2023 07:08
@espendk espendk changed the title Use deployed addresses from mangrove-deployments package Use addresses from mangrove-deployments and context-addresses packages Nov 10, 2023
@espendk espendk force-pushed the feat/move-addresses-to-mangrove-deployments branch 2 times, most recently from 0329fae to e587525 Compare November 11, 2023 08:07
…kage

This is a first version that simply copies the latest primary addresses to the addressses/deployed folder.
By default, query for deployments matching patches of the package version.
This is a first version that simply copies the addresses to the addressses/context folder.
Instead of the ambiguous token symbols use the instance ID's assigned by context-addresses.
This makes all token instances available and enforces clarity on which ERC20 instance on is interacting with.

To ease the transition, the default instances are still available using just the token symbol as identifier.
However, use of this is deprecated.
@espendk espendk force-pushed the feat/move-addresses-to-mangrove-deployments branch from 59c4bcb to f5f64d2 Compare November 15, 2023 09:32
@espendk espendk requested a review from dontrolle November 15, 2023 09:32
@espendk espendk marked this pull request as ready for review November 15, 2023 09:33
copyDeploymentAddresses.js Outdated Show resolved Hide resolved
copyContextAddresses.js Outdated Show resolved Hide resolved
@espendk espendk requested a review from dontrolle November 15, 2023 10:21
Copy link
Contributor

@dontrolle dontrolle left a comment

Choose a reason for hiding this comment

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

🌴

@espendk espendk changed the title Use addresses from mangrove-deployments and context-addresses packages feat: Use addresses from mangrove-deployments and context-addresses packages Nov 15, 2023
@espendk espendk merged commit 2de8027 into develop Nov 15, 2023
2 checks passed
@espendk espendk deleted the feat/move-addresses-to-mangrove-deployments branch November 15, 2023 10:41
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

Successfully merging this pull request may close these issues.

2 participants