Skip to content

Commit 7b57030

Browse files
maureliangraphite-app[bot]mds1geoknee
authored
Update contracts release documentation (#17719)
* Remove empty code-freezes page * Add release-process.md * Update packages/contracts-bedrock/book/src/policies/release-process.md Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Matt Solomon <[email protected]> * Update packages/contracts-bedrock/book/src/policies/release-process.md * Update packages/contracts-bedrock/book/src/policies/release-process.md * Update packages/contracts-bedrock/book/src/SUMMARY.md Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> * Use real numbers in <ol> * Update release-process.md * Clarify that semver bump on develop applies to modified contracts Co-authored-by: George Knee <[email protected]> --------- Co-authored-by: graphite-app[bot] <96075541+graphite-app[bot]@users.noreply.github.com> Co-authored-by: Matt Solomon <[email protected]> Co-authored-by: George Knee <[email protected]>
1 parent 6fa1e07 commit 7b57030

File tree

4 files changed

+57
-41
lines changed

4 files changed

+57
-41
lines changed

packages/contracts-bedrock/book/src/SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@
1111
# Policies
1212

1313
- [Solidity Upgrades](./policies/solidity-upgrades.md)
14-
- [Code Freezes](./policies/code-freezes.md)
15-
- [Versioning](./policies/versioning.md)
14+
15+
- [Versioning](./policies/versioning.md)
16+
- [Tagging and Release Process](./policies/release-process.md)
17+

packages/contracts-bedrock/book/src/contributing/code-freezes.md

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Tagging and Release Process
2+
3+
## Creating a tagged release
4+
5+
First select a tag string based on the guidance in [Monorepo Contracts Release Versioning](./versioning.md#monorepo-contracts-release-versioning)
6+
7+
1. Checkout the commit
8+
2. Run `git tag <tag-string>`
9+
3. Run `git push origin <tag-string>`
10+
Repo [rules](https://github.com/ethereum-optimism/optimism/rules/8196346?ref=refs%2Ftags%2Fop-contracts) require this is done by someone who is a [release-manager](https://github.com/orgs/ethereum-optimism/teams/release-managers). Once pushed a tag cannot be deleted, so please be sure it is correct.
11+
1. Create release notes in Github:
12+
- Go to the [Releases page](https://github.com/ethereum-optimism/optimism/releases), enter or select `<tag-string>`
13+
from the dropdown.
14+
1. Populate the release notes. If the tag is a release candidate, check the `Set as a pre-release` option, and uncheck the
15+
`Set as the latest release` option.
16+
1. Deploy the OPCM using the `op-deployer bootstrap implementations` [command](https://devdocs.optimism.io/op-deployer/user-guide/bootstrap.html),
17+
this will write the addresses of the deployed contracts to `stdout` (or to disk if you provide an `--outfile` argument).
18+
Do this on both Sepolia and Mainnet.
19+
1. In the superchain-registry edit the following files to add a new `[<tag-string>]` entry, with the addresses from the
20+
previous step:
21+
- [standard-versions-mainnet.toml](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-versions-mainnet.toml)
22+
- [standard-versions-sepolia.toml](https://github.com/ethereum-optimism/superchain-registry/blob/main/validation/standard/standard-versions-sepolia.toml)
23+
1. Once the changes are merged into the superchain-registry, you can follow the [instructions](https://devdocs.optimism.io/op-deployer/reference-guide/releases.html#step-3-update-the-sr-with-the-new-release)
24+
for creating a new release of `op-deployer`.
25+
26+
## Implications for audits
27+
28+
The process above should be followed to create an `-rc.1` release prior to audit. This will be the target commit for
29+
the audit. If any fixes are required by the audit results an Additional Release Candidate will be required.
30+
31+
## Additional Release Candidates
32+
33+
Sometimes fixes or additional changes need to be added to a release candidate version. In that case
34+
we want to ensure fixes are made on both the release and the trunk branch, without stopping development
35+
efforts on the trunk branch.
36+
37+
The process is as follows:
38+
39+
1. Make the fixes on `develop`. Increment the contracts semver as normal.
40+
1. Create a new release branch, named `proposal/op-contracts/vX.Y.Z` off of the rc tag (all subsequent `-rc` tags
41+
will be made from this branch).
42+
1. Cherry pick the fixes from `develop` into the release branch, and increment the semver as normal. If this increment results in any of the modified contracts' semver being equal to or greater than it is on `develop`, then the semver should immediately be increased on `develop` to be greater than on the release branch. This avoids a situation where a given contract has two different implementations with the same version.
43+
1. After merging the changes into the new release branch, tag the resulting commit on the proposal branch as `op-contracts/vX.Y.Z-rc.n`.
44+
Create a new release for this tag per the instructions above.
45+
46+
## Finalizing a release
47+
48+
Once a release has passed governance, a new tag should be created without the `-rc.n` suffix. To do this follow the
49+
instructions in "Creating a tagged release" once again. It should not be necessary to redeploy the contracts with `op-deployer`,
50+
but a new entry will be required in the superchain-registry's toml files regardless.
51+
When creating release notes, _uncheck_ the `Set as a pre-release` option, and _uncheck_ the
52+
`Set as the latest release` option (latest releases are reserved for non-contract packages).
53+

packages/contracts-bedrock/book/src/policies/versioning.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -79,41 +79,3 @@ Versioning for monorepo releases works as follows:
7979
The [OPCM](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OPContractsManager.sol) is the contract that manages the deployment of all contracts on L1.
8080

8181
The `OPCM` is the source of truth for the contracts that belong in a release, available as on-chain addresses by querying [the `getImplementations` function](https://github.com/ethereum-optimism/optimism/blob/4c8764f0453e141555846d8c9dd2af9edbc1d014/packages/contracts-bedrock/src/L1/OPContractsManager.sol#L1061).
82-
83-
## Release Process
84-
85-
When a release is proposed to governance, the proposal includes a commit hash, and often the
86-
contracts from that commit hash are already deployed to mainnet with their addresses included
87-
in the proposal.
88-
For example, the [Fault Proofs governance proposal](https://gov.optimism.io/t/upgrade-proposal-fault-proofs/8161) provides specific addresses that will be used.
89-
90-
To accommodate this, once contract changes are ready for governance approval, the release flow is:
91-
92-
1. Go to https://github.com/ethereum-optimism/optimism/releases/new
93-
2. Enter the release title as `op-contracts/vX.Y.Z-rc.1`
94-
3. In the "choose a tag" dropdown, enter the same `op-contracts/vX.Y.Z-rc.1` and click the "Create new tag" option that shows up
95-
4. Populate the release notes.
96-
5. Check "set as pre-release" since it's not yet governance approved
97-
6. Uncheck "Set as the latest release" and "Create a discussion for this release".
98-
7. Click publish release.
99-
8. After governance vote passes, edit the release to uncheck "set as pre-release", and remove the `-rc.1` tag.
100-
101-
Although the tools exist to apply a [code freeze](./code-freezes.md) to specific contracts, this is
102-
discouraged. If a change is required to a release candidate after it has been tagged, the
103-
[Additional Release Candidates](#additional-release-candidates) for more information on this flow.
104-
105-
### Additional Release Candidates
106-
107-
Sometimes fixes or additional changes need to be added to a release candidate version. In that case
108-
we want to ensure fixes are made on both the release and the trunk branch, without stopping development
109-
efforts on the trunk branch.
110-
111-
The process is as follows:
112-
113-
1. Make the fixes on `develop`. Increment the contracts semver as normal.
114-
2. Create a new release branch, named `proposal/op-contracts/X.Y.Z` off of the rc tag.
115-
3. Cherry pick the fixes from `develop` into that branch. Instead of incrementing the semver as normal,
116-
append `-patch.n` to the end of the version number. The value of `n` should start at 1 and be
117-
incremented for each additional patch.
118-
4. After merging the changes into the new release branch, tag the resulting commit on the proposal branch as `op-contracts/vX.Y.Z-rc.n`.
119-
Create a new release for this tag per the instructions above.

0 commit comments

Comments
 (0)