Skip to content

Commit d26f55f

Browse files
Merge branch 'op-es' into delta_testnet
2 parents ed1675e + 5540b4b commit d26f55f

551 files changed

Lines changed: 21095 additions & 10246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.circleci/config.yml

Lines changed: 335 additions & 91 deletions
Large diffs are not rendered by default.

.cursor/rules/solidity-styles.mdc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,17 @@ description:
33
globs: *.sol
44
alwaysApply: false
55
---
6+
67
# Optimism Solidity Style Guide
78

89
Applies to Solidity files.
910

1011
## Comments
11-
- Use triple-slash solidity natspec comment style
12-
- Always use `@notice` instead of `@dev`
12+
13+
- NatSpec documentation comments must use the triple-slash `///` style
14+
- Use `//` for regular inline comments that are not NatSpec
15+
- Use `@notice` for documenting what a function/contract does (external-facing documentation)
16+
- Use `@dev` for internal developer notes, reminders, or invariants (e.g., "when updating this, also update X")
1317
- Use a line-length of 100 characters
1418
- Custom tags:
1519
- `@custom:proxied`: Add to a contract whenever it's meant to live behind a proxy
@@ -19,10 +23,12 @@ Applies to Solidity files.
1923
- `@custom:network-specific`: Add to state variables which vary between OP Chains
2024

2125
## Errors
26+
2227
- When adding new errors, always use custom Solidity errors
2328
- Custom errors should take the format `ContractName_ErrorDescription`
2429

2530
## Naming Conventions
31+
2632
- Function parameters should be prefixed with an underscore
2733
- Function return arguments should be suffixed with an underscore
2834
- Event parameters should NOT be prefixed with an underscore
@@ -33,6 +39,7 @@ Applies to Solidity files.
3339
- Spacers must be named `spacer_<slot>_<offset>_<length>` and be `private`
3440

3541
## Upgradeability
42+
3643
- Contracts should be built assuming upgradeability by default
3744
- Extend OpenZeppelin's `Initializable` or base contract
3845
- Use the `ReinitializableBase` contract
@@ -43,6 +50,7 @@ Applies to Solidity files.
4350
- Set any immutables (though generally avoid immutables)
4451

4552
## Versioning
53+
4654
- All non-library/non-abstract contracts must inherit `ISemver` and expose `version()`
4755
- Production-ready contracts must have version `1.0.0` or greater
4856
- Version increments:
@@ -53,12 +61,15 @@ Applies to Solidity files.
5361
AI code review tools should NOT comment on the choice of version increment.
5462

5563
## Dependencies
64+
5665
- Prefer OpenZeppelin's Upgradeable contracts for basic functionality
5766

5867
## State Changes
68+
5969
- All state changing functions should emit a corresponding event
6070

6171
## Testing
72+
6273
- Tests should be written using Foundry
6374
- For testing reverts with low-level calls, use the `revertsAsExpected` pattern
6475
- Test function naming: `[method]_[functionName]_[reason]_[status]`

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
/op-devstack @ethereum-optimism/op-stack @ethereum-optimism/go-reviewers
1414

1515
# Expert areas
16+
/op-deployer @ethereum-optimism/platforms-team
17+
/op-validator @ethereum-optimism/platforms-team
18+
1619
/op-node/rollup @ethereum-optimism/consensus @ethereum-optimism/go-reviewers
1720

1821
/op-supervisor @ethereum-optimism/interop @ethereum-optimism/go-reviewers
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: 'Docker Build Prep'
2+
description: 'Prepare environment for docker builds (checkout, kona version, git versions)'
3+
4+
outputs:
5+
versions:
6+
description: 'JSON object mapping image names to their GIT_VERSION'
7+
value: ${{ steps.compute_versions.outputs.versions }}
8+
kona_version:
9+
description: 'KONA_VERSION from kona/version.json'
10+
value: ${{ steps.kona.outputs.version }}
11+
date:
12+
description: 'Current date in YYYYMMDD format'
13+
value: ${{ steps.date.outputs.date }}
14+
15+
runs:
16+
using: 'composite'
17+
steps:
18+
- name: Get date
19+
id: date
20+
shell: bash
21+
run: |
22+
DATE=$(date +%Y%m%d)
23+
echo "date=$DATE" >> $GITHUB_OUTPUT
24+
25+
- name: Read KONA_VERSION from kona/version.json
26+
id: kona
27+
shell: bash
28+
run: |
29+
KONA_VERSION=$(jq -r .version kona/version.json)
30+
echo "version=$KONA_VERSION" >> $GITHUB_OUTPUT
31+
echo "KONA_VERSION: $KONA_VERSION"
32+
33+
- name: Compute GIT_VERSION for all images
34+
id: compute_versions
35+
shell: bash
36+
run: |
37+
VERSIONS=$(GIT_COMMIT="${{ github.sha }}" make compute-git-versions)
38+
echo "versions=$VERSIONS" >> $GITHUB_OUTPUT
39+
echo "Computed versions: $VERSIONS"
40+

.github/workflows/branches.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: branch build
2+
3+
on:
4+
push:
5+
branches:
6+
- 'develop'
7+
pull_request:
8+
branches:
9+
- 'develop'
10+
paths:
11+
- 'ops/docker/**'
12+
- 'packages/contracts-bedrock/**'
13+
- 'docker-bake.hcl'
14+
- '.github/workflows/branches.yaml'
15+
- 'ops/scripts/compute-git-versions.sh'
16+
17+
jobs:
18+
prep:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
outputs:
23+
versions: ${{ steps.prep.outputs.versions }}
24+
kona_version: ${{ steps.prep.outputs.kona_version }}
25+
date: ${{ steps.prep.outputs.date }}
26+
steps:
27+
- name: Harden the runner
28+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2
29+
with:
30+
egress-policy: audit
31+
- name: Checkout
32+
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v6
33+
with:
34+
fetch-depth: 0
35+
- uses: ./.github/actions/docker-build-prep
36+
id: prep
37+
38+
local:
39+
needs: prep
40+
# only build if push to develop, or PR from a local branch (not a fork)
41+
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
image_name:
46+
- op-node
47+
- op-batcher
48+
- op-deployer
49+
- op-faucet
50+
- op-program
51+
- op-proposer
52+
- op-challenger
53+
- op-dispute-mon
54+
- op-conductor
55+
- da-server
56+
- op-supervisor
57+
- op-supernode
58+
- op-test-sequencer
59+
- cannon
60+
- op-dripper
61+
- op-interop-mon
62+
uses: ethereum-optimism/factory/.github/workflows/docker.yaml@d04222c229c50320f513afe678b3264869ea11a9
63+
with:
64+
mode: bake
65+
image_name: ${{ matrix.image_name }}
66+
bake_file: docker-bake.hcl
67+
target: ${{ matrix.image_name }}
68+
tag: ${{ github.event_name == 'push' && 'develop' || format('pr-{0}', github.event.pull_request.number) }}
69+
gcp_project_id: ${{ vars.GCP_PROJECT_ID_OPLABS_TOOLS_ARTIFACTS }}
70+
registry: us-docker.pkg.dev/oplabs-tools-artifacts/oss
71+
env: |
72+
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[matrix.image_name] }}
73+
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
74+
set: |
75+
*.args.GIT_COMMIT=${{ github.sha }}
76+
*.args.GIT_DATE=${{ needs.prep.outputs.date }}
77+
permissions:
78+
contents: read
79+
id-token: write
80+
attestations: write
81+
82+
fork:
83+
needs: prep
84+
# only build if PR from a fork
85+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository
86+
strategy:
87+
fail-fast: false
88+
matrix:
89+
image_name:
90+
- op-node
91+
- op-batcher
92+
- op-deployer
93+
- op-faucet
94+
- op-program
95+
- op-proposer
96+
- op-challenger
97+
- op-dispute-mon
98+
- op-conductor
99+
- da-server
100+
- op-supervisor
101+
- op-supernode
102+
- op-test-sequencer
103+
- cannon
104+
- op-dripper
105+
- op-interop-mon
106+
uses: ethereum-optimism/factory/.github/workflows/docker.yaml@d04222c229c50320f513afe678b3264869ea11a9
107+
with:
108+
mode: bake
109+
image_name: ${{ matrix.image_name }}
110+
bake_file: docker-bake.hcl
111+
target: ${{ matrix.image_name }}
112+
tag: 24h
113+
registry: ttl.sh/${{ github.sha }}
114+
env: |
115+
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[matrix.image_name] }}
116+
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
117+
set: |
118+
*.args.GIT_COMMIT=${{ github.sha }}
119+
*.args.GIT_DATE=${{ needs.prep.outputs.date }}
120+
permissions:
121+
contents: read
122+

.github/workflows/protected.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/workflows/tags.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: tag build
2+
3+
on:
4+
push:
5+
tags:
6+
- '*/v*' # Match tags like op-node/v1.2.3
7+
8+
jobs:
9+
prep:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
outputs:
14+
image_name: ${{ steps.parse-tag.outputs.image_name }}
15+
version: ${{ steps.parse-tag.outputs.version }}
16+
versions: ${{ steps.prep.outputs.versions }}
17+
kona_version: ${{ steps.prep.outputs.kona_version }}
18+
steps:
19+
- name: Harden the runner
20+
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2
21+
with:
22+
egress-policy: audit
23+
- name: Checkout
24+
uses: actions/checkout@71cf2267d89c5cb81562390fa70a37fa40b1305e # v6
25+
with:
26+
fetch-depth: 0
27+
- uses: ./.github/actions/docker-build-prep
28+
id: prep
29+
- name: Parse tag
30+
uses: ethereum-optimism/factory/actions/parse-tag@240b16167a5f5aa789270fa9c0efbfa9f010b7e7
31+
id: parse-tag
32+
33+
release:
34+
needs: prep
35+
uses: ethereum-optimism/factory/.github/workflows/docker.yaml@d04222c229c50320f513afe678b3264869ea11a9
36+
with:
37+
mode: bake
38+
image_name: ${{ needs.prep.outputs.image_name }}
39+
bake_file: docker-bake.hcl
40+
target: ${{ needs.prep.outputs.image_name }}
41+
tag: ${{ needs.prep.outputs.version }}
42+
gcp_project_id: ${{ vars.GCP_PROJECT_ID_OPLABS_TOOLS_ARTIFACTS }}
43+
registry: us-docker.pkg.dev/oplabs-tools-artifacts/oss
44+
env: |
45+
GIT_VERSION=${{ fromJson(needs.prep.outputs.versions)[needs.prep.outputs.image_name] }}
46+
KONA_VERSION=${{ needs.prep.outputs.kona_version }}
47+
set: |
48+
*.args.GIT_COMMIT=${{ github.sha }}
49+
*.args.GIT_DATE=${{ github.event.head_commit.timestamp }}
50+
permissions:
51+
contents: read
52+
id-token: write
53+
attestations: write

0 commit comments

Comments
 (0)