Skip to content

Commit 4f27a36

Browse files
committed
docs: rewrite CONTRIBUTING.md (#1300)
**Motivation:** rewrite CONTRIBUTING.md to include new development workflow **Modifications:** rewrite CONTRIBUTING.md **Result:** rewrite CONTRIBUTING.md
1 parent 6269965 commit 4f27a36

File tree

1 file changed

+95
-47
lines changed

1 file changed

+95
-47
lines changed

CONTRIBUTING.md

+95-47
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,144 @@
11
# Contribution Guide
22

3-
Thank you for considering contributing to EigenLayer! To ensure a smooth and efficient collaboration, please adhere to the following guidelines when submitting a pull request (PR):
3+
Thank you for considering contributing to EigenLayer! This guide will help you set up your development environment and submit high-quality pull requests (PRs).
44

5-
## Requirements
5+
## Setting Up Your Environment
66

7-
- Foundry
8-
- Git
9-
- Node.js
7+
### Requirements
108

11-
## Setup Repo
9+
- Foundry
10+
- Git
11+
- Node.js
12+
13+
### Fork and Clone the Repository
14+
15+
1. Fork the repository following [GitHub's instructions](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
16+
2. Clone your forked repository:
1217

1318
```bash
14-
git clone https://github.com/Layr-Labs/eigenlayer-contracts.git
19+
git clone https://github.com/<your_github_id>/eigenlayer-contracts.git
20+
cd eigenlayer-contracts
1521
```
1622

1723
### Install Dependencies
1824

25+
Set up your local development environment:
26+
1927
```bash
2028
npm install
2129
npx husky install
2230
forge install
2331
```
2432

25-
### Environment Variables
33+
### Run Tests
2634

27-
Some of the tests and features of this repository require environment variables to be set up.
35+
Verify your setup by running the test suite:
2836

29-
Copy the .env.example file to create a .env and populate it with the appropriate environment values that you have control over.
37+
```bash
38+
forge test
39+
```
3040

31-
## Development Workflow
41+
Congratulations! You've successfully set up your repository and run the tests.
3242

33-
- **Testing**: Ensure that your code is well-tested. Write unit and integration tests as appropriate.
34-
- **Branching**: Create a feature branch from the `dev` branch for your work. The `dev` branch contains the most up-to-date code for upcoming releases.
35-
- **Pull Requests**: Once your feature or fix is complete and tested, submit a PR to merge your feature branch into the `dev` branch.
36-
- **Code Review**: After your PR is approved, squash your commits into a single commit before merging to maintain a clean and concise commit history.
43+
## Submitting a Pull Request
3744

38-
## Commit Message Format
45+
### Configure Remote Repositories
3946

40-
When squashing and merging your commits, please follow the commit message convention below:
47+
All PRs should be submitted from your forked repository. Add the official EigenLayer repository as your upstream remote:
4148

49+
```bash
50+
git remote add upstream https://github.com/Layr-Labs/eigenlayer-contracts.git
4251
```
43-
<type>(<scope>): <subject> (#<PR number>)
4452

45-
<motivation>
53+
Verify your configuration:
4654

47-
<modifications>
55+
```bash
56+
git remote -v
57+
```
4858

49-
<result>
59+
You should see:
60+
```
61+
origin https://github.com/<your_github_id>/eigenlayer-contracts.git (fetch)
62+
origin https://github.com/<your_github_id>/eigenlayer-contracts.git (push)
63+
upstream https://github.com/Layr-Labs/eigenlayer-contracts.git (fetch)
64+
upstream https://github.com/Layr-Labs/eigenlayer-contracts.git (push)
5065
```
5166

52-
- **Type**: Indicates the nature of the change.
53-
- **Scope**: Specifies the section or module of the codebase affected (optional).
54-
- **Subject**: A brief description of the change.
55-
- **PR Number**: Reference to the pull request associated with this change.
56-
- **Motivation**: Describe the context and reason for the change.
57-
- **Modifications**: Detail the specific changes made.
58-
- **Result**: Explain the outcome or effects of the change.
67+
### Create Your PR
5968

60-
### Example
69+
1. Create a new branch from your target upstream branch
70+
2. Make your code changes
71+
3. Commit your changes
72+
4. Push to your forked repository
73+
5. Create a PR from your branch to the appropriate branch in the upstream repository
6174

62-
An example of a commit message:
75+
### PR Title Format
6376

77+
Format your PR title as follows:
78+
79+
```
80+
<type>: <subject>
6481
```
65-
feat(StrategyManager): Implement new withdrawal flow (#123)
6682

83+
Where:
84+
- **Type**: Indicates the nature of the change
85+
- **Subject**: A brief description of the change
86+
87+
Use one of these types:
88+
89+
| Type | Description |
90+
|------|-------------|
91+
| **feat** | A new feature |
92+
| **fix** | A bug fix |
93+
| **docs** | Documentation-only changes |
94+
| **style** | Changes that don't affect code meaning (formatting) |
95+
| **refactor** | Code changes that neither fix bugs nor add features |
96+
| **ci** | Changes to continuous integration configuration |
97+
| **perf** | Performance improvements |
98+
| **test** | Adding or correcting tests |
99+
| **chore** | Changes to build process or auxiliary tools |
100+
| **release** | Merging a release-dev branch to `main` |
101+
102+
Remember to set the appropriate PR label as well.
103+
104+
### PR Description Template
105+
106+
Use this template for your PR description:
107+
108+
```markdown
67109
**Motivation:**
110+
- Describe the context and reason for the change
111+
112+
**Modifications:**
113+
- Detail the specific changes made
114+
115+
**Result:**
116+
- Explain the outcome or effects of the change
117+
```
118+
119+
#### Example PR:
68120

121+
```markdown
122+
feat: Implement new withdrawal flow in StrategyManager
123+
124+
**Motivation:**
69125
The current withdrawal process is inefficient and leads to delays for users.
70126

71127
**Modifications:**
72-
73-
- Refactored the `withdraw` function in `StrategyManager.sol`.
74-
- Updated associated unit tests to reflect changes.
75-
- Modified documentation to explain the new withdrawal process.
128+
- Refactored the `withdraw` function in `StrategyManager.sol`
129+
- Updated associated unit tests to reflect changes
130+
- Modified documentation to explain the new withdrawal process
76131

77132
**Result:**
78-
79133
The withdrawal process is now more efficient, reducing wait times for users.
80134
```
81135

82-
### Commit Types
136+
## Testing and Continuous Integration
83137

84-
Use the following types for your commit messages:
138+
- All PRs should include appropriate test coverage
139+
- Write unit and integration tests that verify your changes
140+
- Ensure all existing tests continue to pass
85141

86-
- **feat**: A new feature.
87-
- **fix**: A bug fix.
88-
- **docs**: Documentation-only changes.
89-
- **style**: Changes that do not affect the meaning of the code (e.g., formatting).
90-
- **refactor**: A code change that neither fixes a bug nor adds a feature.
91-
- **perf**: A code change that improves performance.
92-
- **test**: Adding missing or correcting existing tests.
93-
- **chore**: Changes to the build process or auxiliary tools and libraries.
142+
For first-time external contributors: A maintainer will review your PR and manually approve CI to run.
94143

95144
By following these guidelines, you help maintain the quality and readability of the EigenLayer codebase. We appreciate your contributions and look forward to collaborating with you!
96-

0 commit comments

Comments
 (0)