|
1 |
| -# Maintenance |
| 1 | +# Maintenance Guide |
2 | 2 |
|
3 |
| -This document outlines basic procedures for maintenance of PRs, and releases that maintainers of the repository should follow. |
| 3 | +This document outlines essential procedures for repository maintenance, including PR management, branching strategies, and release processes that maintainers should follow to ensure code quality and stability. |
4 | 4 |
|
| 5 | +## Code Review Process |
5 | 6 |
|
6 |
| -## Enrivonment Network |
| 7 | +Code reviewers are responsible for ensuring that PRs meet the following criteria before merging: |
7 | 8 |
|
8 |
| -Before getting into maintenance details, let's define environment network first. |
| 9 | +- **Properly labeled** according to our labeling conventions |
| 10 | +- **Well-formatted** code adhering to our style guidelines |
| 11 | +- **Comprehensive test coverage** including unit and integration tests |
| 12 | +- **Documentation updates** where appropriate |
| 13 | +- **Security considerations** addressed and potential vulnerabilities mitigated |
| 14 | + |
| 15 | +For first-time external contributors, a maintainer must: |
| 16 | +1. Review the PR with additional scrutiny |
| 17 | +2. Verify the contributor has signed the CLA (Contributor License Agreement) |
| 18 | +3. Manually approve CI workflows to run |
| 19 | +4. Provide detailed feedback to help onboard the contributor |
| 20 | + |
| 21 | + |
| 22 | +## Branching and Merge Strategy for Development |
| 23 | + |
| 24 | +### Core Branches |
| 25 | + |
| 26 | +- **`main` (default)**: |
| 27 | + - The canonical branch where all approved code changes are merged |
| 28 | + - Must remain stable and suitable for internal/external testing |
| 29 | + - All CI workflows must pass before and after every commit |
| 30 | + - Security audits are performed against specific commits on this branch |
| 31 | + |
| 32 | +- **`release-dev/xxx`**: |
| 33 | + - Used for large features requiring multiple commits that introduce breaking changes |
| 34 | + - Examples: `release-dev/slashing-v1`, `release-dev/rewards-v2` |
| 35 | + - Branch from `main` for isolated development |
| 36 | + - Must be regularly rebased against `main` to reduce merge conflicts |
| 37 | + - Merged back into `main` as a single logical unit when complete |
| 38 | + - No security audits are performed directly on these branches |
| 39 | + |
| 40 | +### Merge Strategies |
| 41 | + |
| 42 | +We employ different merge strategies based on PR type: |
| 43 | + |
| 44 | +#### 1. Regular PRs |
| 45 | +Regular PRs include bug fixes, small features, or incremental updates where each PR represents an atomic change. |
| 46 | + |
| 47 | +**Merge Strategy**: Always use **Squash and Merge** |
| 48 | +- Combines all commits into a single, atomic unit |
| 49 | +- Maintains a clean, linear history on the target branch |
| 50 | +- Preserves PR number in commit message for traceability |
| 51 | +- Example: `PR #123 -> [squash] -> main` |
| 52 | + |
| 53 | +#### 2. Release-Dev Merges |
| 54 | +When merging a complete `release-dev` branch into `main` after a major feature is completed. |
| 55 | + |
| 56 | +**Merge Strategy**: Always use **Merge Commit (no squash)** |
| 57 | +- Preserves the complete commit history of the feature branch |
| 58 | +- Creates a merge commit that serves as a feature completion marker |
| 59 | +- Simplifies cherry-picking specific changes for hotfixes |
| 60 | +- Example: `release-dev/feature -> [merge commit] -> main` |
| 61 | + |
| 62 | + |
| 63 | +### Best Practices |
| 64 | + |
| 65 | +- **Branch Hygiene**: Delete branches after merging to avoid clutter |
| 66 | +- **CI Validation**: Never merge code that fails CI checks |
| 67 | +- **Documentation**: Update documentation alongside code changes |
| 68 | +- **Breaking Changes**: Clearly document any breaking changes in PR descriptions |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +## Release Management |
| 73 | + |
| 74 | + |
| 75 | +### Environment Networks |
| 76 | + |
| 77 | +Before diving into maintenance details, it's important to understand our environment network structure. |
9 | 78 |
|
10 | 79 | | Environment | Environment Network | Definition and Practices |
|
11 | 80 | |-------------|---------------------|--------------------------|
|
12 |
| -| mainnet | mainnet-ethereum | - mainnet production env on Ethereum<br>- only one single mainnet in foreseeable future<br>- external facing | |
13 |
| -| testnet | testnet-holesky<br>testnet-sepolia<br>testnet-hoodi | - testnet envs on Ethereum testnets like holesky or sepolia<br>- can be 1 or more testnet env networks for EigenLayer<br>- external facing, long lived for both internal and external developers to test on | |
14 |
| -| preprod | preprod-holesky<br>preprod-sepolia<br>preprod-hoodi | - preprod envs on Ethereum testnets like holesky or sepolia<br>- can be 1 or more preprod env networks for EigenLayer<br>- long lived for internal development and testing, before moving to testnets | |
| 81 | +| **mainnet** | mainnet-ethereum | - Production environment on Ethereum mainnet<br>- Single canonical mainnet instance in foreseeable future<br>- External facing with highest security requirements | |
| 82 | +| **testnet** | testnet-holesky<br>testnet-sepolia<br>testnet-hoodi | - Test environments on Ethereum testnets (holesky, sepolia, etc.)<br>- Multiple testnet environments may exist simultaneously<br>- External facing, long-lived environments for both internal and external developers<br>- Used for integration testing, AVS onboarding, and community engagement | |
| 83 | +| **preprod** | preprod-holesky<br>preprod-sepolia<br>preprod-hoodi | - Pre-production environments on Ethereum testnets<br>- Multiple preprod environments may exist simultaneously<br>- Internal facing for development team use<br>- Used for feature verification before promoting to testnet<br>- Provides safe environment for testing breaking changes | |
| 84 | + |
| 85 | +For more details on our testing infrastructure strategy, see our blog post: [The Future of EigenLayer Testing: New & Improved Testnets & Tooling Coming Soon](https://www.blog.eigenlayer.xyz/the-future-of-eigenlayer-testing-new-and-improved-testnets-tooling-coming-soon/) |
| 86 | + |
| 87 | + |
| 88 | +### Release Tags and Semver |
| 89 | + |
| 90 | +This section defines release tag semver where `<semver>` = `<major>.<minor>.<patch>` |
| 91 | + |
| 92 | +E.g. |
| 93 | +- v1.1.0 |
| 94 | +- v1.1.1 |
| 95 | + |
| 96 | +`<semver>` should follow [best practices of semver definition](https://semver.org/) |
| 97 | + |
| 98 | + |
| 99 | +In observing semver, we define the following; |
| 100 | + |
| 101 | +1. A **major** upgrade |
| 102 | + 1. An ideologically breaking upgrade, which may require re-learning parts of the system. |
| 103 | + 2. “Upgrade Required” — Major upgrades are **assumed to break** all tooling, integrations, and downstream consumers unless otherwise stated. |
| 104 | + 3. Major upgrades are announced ahead of time via blog posts, the ELIP process, and onchain via the Eigen timelock. |
| 105 | + 4. example: slashing, which changes most of our codebase |
| 106 | +2. A **minor** upgrade |
| 107 | + 1. A conceptually breaking upgrade, which require adapting break changes and APIs, upgrading tools, CLIs, or integrations with EigenLayer. |
| 108 | + 2. “Upgrade carefully” — Minor upgrades are **assumed not to break** any tooling, CLIs, or interactions with EigenLayer unless otherwise stated in release notes. |
| 109 | +3. A **patch** upgrade |
| 110 | + 1. A “silent” upgrade, which addresses a bug or inconsistency in the system, but does not change any interfaces. |
| 111 | + 1. i.e. fixes reveal the need for a rounding fix in a contract. Notably **abi** and **tooling** remains stable across patches. |
| 112 | + 2. “Upgrade suggested” — Patch upgrades may come with upgrades to tooling, CLIs, or other Eigen infrastructure. You are encouraged to read the patch notes and upgrade. |
| 113 | + |
| 114 | + |
| 115 | +### Release Base and Cherry Pick |
| 116 | + |
| 117 | +All releases will be cut from `main` the base branch, to ensure global consistency, clean legibility, and high code quality with no env-network specific code |
| 118 | + |
| 119 | +Each env_network deployment will pick one release above. |
| 120 | + |
| 121 | + |
| 122 | +During release, release manager can cherry pick to exclude certain commits, especially in case of a non-sequential feature deployment |
| 123 | + |
| 124 | + |
| 125 | +#### Non Sequential Feature Release |
| 126 | + |
| 127 | +In smart contracts, there is a common scenario for non sequential feature deployment due to Ethereum hardforks, whose time we cannot control. |
| 128 | + |
| 129 | +E.g. say we have features A, B, and Ethereum hardfork X, where B is an upgrade to adapt to X. The deployment sequence for testnet is A, B, X. While that of mainnet has to be B, X, A, because 1/ we don’t control the time of X, 2/ B must happen before X, and 3/ A is not ready for mainnet yet which can’t be deployed before B |
| 130 | + |
| 131 | +Concrete example just happened is A = slashing V1, B = prooftra, X = pectra |
| 132 | + |
| 133 | +So our release branch and model must be flexible enough to solve it via cherry picking |
| 134 | + |
| 135 | + |
| 136 | +### Release and Deployment Scope |
| 137 | + |
| 138 | +- a release would upgrade versions for all code, even though there's no change to a file from last release |
| 139 | +- a deployment would adopt a release as a whole, so all contracts would upgrade to that release, instead of "some file on release v1.3 and some on release v1.4" |
| 140 | + - there's no phrasing of, for example, "all non-EigenPod contracts be on `v1.3.0` and EigenPods contract on `v1.4.0`" - they would all be on v1.4.0, just the non-eigenpod contract are not changed at all from v1.3.0 |
| 141 | + - as implementation detail, we can skip upgrade the contracts that have not changed, but the codebase and releases are on new release version |
| 142 | +- all changes have to be deployed to testnet first, before mainnet. No skipping from preprod to mainnet directly |
| 143 | + |
15 | 144 |
|
16 |
| -See blog [The Future of EigenLayer Testing: New & Improved Testnets & Tooling Coming Soon](https://www.blog.eigenlayer.xyz/the-future-of-eigenlayer-testing-new-and-improved-testnets-tooling-coming-soon/) for detailed motivation |
| 145 | +### Release Branches |
17 | 146 |
|
| 147 | +Once release are created, corresponding release branches will live forever for future reference and NEVER be deleted. |
18 | 148 |
|
| 149 | +Together with “**Fork-based PR**” defined in CONTRIBUTING.md, it means there are only 3 categories of branches in the repository: |
19 | 150 |
|
20 |
| -## Development |
| 151 | +1. `main`: live forever, never delete |
| 152 | +2. release-dev branches `release-dev/*`e: long living branch for a period of time but will be deleted once their commits are merged back to `main` |
| 153 | +3. release branches `vx.y.z`: live forever, never delete after a release is officially create |
21 | 154 |
|
22 |
| -### Code Review |
23 | 155 |
|
24 |
| -Code reviewers take responsibility of making sure PRs are rigorously labeled, well formatted, well tested before merging them. |
| 156 | +### Changelog, Release Note, Release Announcement Blog |
25 | 157 |
|
26 |
| -For first-time external contributors, a maintainer should review their PR carefully and then manually approve CI to run. |
| 158 | +Each release in testnet and mainnet must have corresponding release note, changelog, and announcement blog |
27 | 159 |
|
| 160 | +- Changelog |
| 161 | + - lives in the repo `/CHANGELOG` dir |
| 162 | + - exact commit history diff from last release |
| 163 | + - See examples in Kubernetes https://github.com/kubernetes/kubernetes/tree/master/CHANGELOG |
| 164 | +- Release note: |
| 165 | + - lives in the repo as part of release description under “[Releases](https://github.com/Layr-Labs/eigenlayer-contracts/releases)” |
| 166 | + - high level summary of key changes users need to be aware of |
| 167 | + - See template below |
| 168 | + - Owner: release manager and PM |
| 169 | +- Release announcement blog |
| 170 | + - published to [blog.eigenlayer.xyz](http://blog.eigenlayer.xyz) |
| 171 | + - an announcement with polished language to introduce the release to users. It will include content in both release notes and changelog |
| 172 | + - See examples in Golang https://tip.golang.org/doc/go1.24 |
| 173 | + - Owner: release manager and PM |
28 | 174 |
|
29 |
| -### Branching Model |
| 175 | +Release Note must follow template: |
30 | 176 |
|
31 |
| -#### Development Branches |
| 177 | +```jsx |
| 178 | +<release-version> |
32 | 179 |
|
33 |
| -- `main (default)`: |
34 |
| - - The primary development and canonical branch where all new code are merged |
35 |
| - - It should remain stable enough for internal and external testing, ensuring continuous integration (CI) runs smoothly on every commit |
36 |
| - - Security audit will always happen on main by a given commit |
37 |
| -- `release-dev/xxx`: |
38 |
| - - For large features with many commits that will be breaking changes and we want to all-or-none in `main`, maintainer should create a `release-dev/xxx` branch to develop on |
39 |
| - - eg. release-dev/slashing-v1, release-dev/rewards-v2 |
40 |
| - - These branches branch off from `main` for development, should be constantly rebased to `main` to be compatible with canonical branch, and will be merged back into `main` when the development is done and ready to deploy |
41 |
| - - release-dev branches should be merged into main for auditing, no auditing will be on release-dev branches |
| 180 | +🚀 New Features – Highlight major new functionality. |
| 181 | + - ... |
| 182 | + - ... |
42 | 183 |
|
| 184 | +⛔ Breaking Changes – Call out backward-incompatible changes. |
| 185 | + - ... |
| 186 | + - ... |
43 | 187 |
|
44 |
| -### Merge PRs |
| 188 | +📌 Deprecations – Mention features that are being phased out. |
| 189 | + - ... |
| 190 | + - ... |
45 | 191 |
|
46 |
| -We classify PRs into two types: |
| 192 | +🛠️ Security Fixes – Specify patched vulnerabilities. |
| 193 | + - ... |
| 194 | + - ... |
47 | 195 |
|
48 |
| -1. **Regular PRs** – Used for bug fixes, small changes, or incremental updates. Each PR is atomic itself. |
49 |
| -2. **Release-dev Merges** – Merging a release-dev branch into `main` after completing a major release. The release-dev branch and such a merge contains many regular PRs |
| 196 | +🔧 Improvements – Enhancements to existing features. |
| 197 | + - ... |
| 198 | + - ... |
50 | 199 |
|
51 |
| -We use different merge rules for each PR type. |
| 200 | +🐛 Bug Fixes – List resolved issues. |
| 201 | + - ... |
| 202 | + - ... |
| 203 | +``` |
52 | 204 |
|
53 |
| -- For regular PRs: |
54 |
| - - Always **rebase, squash, and merge**. Since multiple commits in a PR represent a single unit of work, merging them separately can be unnecessary or even break the code. Squashing ensures atomicity and keeps the commit history clean. |
55 |
| - - demonstration: PR -> squash -> `main` or `release-dev` |
| 205 | +When writing **release notes** and **changelog entries**, follow these best practices to ensure clarity, usefulness, and professionalism. |
56 | 206 |
|
| 207 | +**Required Best Practices** |
57 | 208 |
|
58 |
| -- For release-dev merges: |
59 |
| - - Always **rebase and create a new commit to merge, never squash** |
60 |
| - - All commit history should be preserved - a release-dev branch contains multiple independent units of work, and squashing would create a massive, monolithic commit that erases history, making it difficult to track and understand individual changes. |
61 |
| - - The additional commit will act as a marker in `main` as end of a release-dev merge. With each release-dev merge having its own end marker, it will significantly simplify the cherry-picking process in release creation |
62 |
| - - demonstration: `release-dev` -> merge -> `main` |
| 209 | +1. **Be Clear and Concise** – Use simple, direct language. Avoid jargon unless necessary. |
| 210 | +2. **Categorize Changes** – Use standard sectioned template above. |
| 211 | +3. **Provide Context** – Briefly explain why the change was made, not just what changed. |
| 212 | +4. **Use a Consistent Format** – Follow a structured template for every release. |
| 213 | +5. **Include Relevant Links** – Link to issue trackers, PRs, or documentation for more details. |
| 214 | +6. **Highlight User Impact** – Mention how the update affects users and any required actions. |
| 215 | +7. **Keep It Versioned** – Use semantic versioning (e.g., `v2.3.1`) and list versions in descending order. |
| 216 | +8. **Avoid Internal-Only Details** – Don't include internal project discussions that aren’t relevant to users. |
| 217 | +9. **Maintain a Single Source of Truth** – Store changelogs in a `CHANGELOG.md` file or an equivalent documentation system. |
63 | 218 |
|
64 | 219 |
|
| 220 | +## Release Manager Responsibilities |
65 | 221 |
|
66 |
| -## Releases |
| 222 | +We introduce a new critical role called release manager (RM) |
67 | 223 |
|
| 224 | +Each release should have a primary RM and a secondary RM. RM is on rotating base, not necessarily always be the tech lead of the project, so we can amortize the cost and onboard all developers with same standards |
68 | 225 |
|
| 226 | +Primary Release Manager is responsible for |
69 | 227 |
|
70 |
| -## Release Manager |
| 228 | +- Managing the release-dev branch during development phase |
| 229 | + - create it from `main` and eventually merge back to `main` |
| 230 | + - constantly rebasing to `main` to resolve conflict early, without required efforts from other developers working on the release-dev branch |
| 231 | + - holding high bar for quality: |
| 232 | + - code quality |
| 233 | + - PR templating |
| 234 | + - test quality (e.g. no flaky or failed tests, keep test runtime under control) |
| 235 | +- Manage release branches and deployment |
| 236 | + - create and manage corresponding release branches `Vx.y.z` |
| 237 | + - author and publish release notes and changelog |
| 238 | + - author and publish release blog with PM and marketing team |
| 239 | + - lead communication with marketing and BD team to inform stakerholders for preparation |
| 240 | + - lead deployment to env network |
| 241 | +- Mentoring and knowledge sharing |
| 242 | + - mentor and train secondary release manager, who will be the primary manager for next release |
71 | 243 |
|
72 | 244 |
|
| 245 | +By following these maintenance procedures, we ensure a stable, secure, and well-documented codebase that meets the high standards required for EigenLayer's infrastructure. |
0 commit comments