Skip to content

Commit 7c5e212

Browse files
committed
Implement frax DA changes
1 parent 2954d9f commit 7c5e212

File tree

24 files changed

+452
-89
lines changed

24 files changed

+452
-89
lines changed

.github/CODEOWNERS

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

.github/dependabot.yml

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

.github/workflows/release.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Release docker image
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
service:
7+
description: Service to release
8+
required: true
9+
type: choice
10+
options:
11+
- op-node
12+
- op-batcher
13+
- op-proposer
14+
- op-bootnode
15+
version:
16+
description: Service version to publish (will be the docker tag)
17+
required: true
18+
19+
jobs:
20+
build-and-push-image:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
packages: write
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
- name: Log in to the Container registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ghcr.io
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Build and push
37+
uses: docker/bake-action@v5
38+
env:
39+
REGISTRY: ghcr.io
40+
REPOSITORY: fraxfinance/fraxtal
41+
PLATFORMS: linux/amd64,linux/arm64
42+
GIT_COMMIT: ${{ github.sha }}
43+
GIT_VERSION: ${{ inputs.version }}
44+
IMAGE_TAGS: ${{ inputs.version }}
45+
with:
46+
push: true
47+
set: |
48+
*.cache-from=type=gha
49+
*.cache-to=type=gha,mode=max
50+
targets: ${{ inputs.service }}

docker-bake.hcl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ target "op-node" {
108108
}
109109
target = "op-node-target"
110110
platforms = split(",", PLATFORMS)
111-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-node:${tag}"]
111+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-node:${tag}"]
112112
}
113113

114114
target "op-batcher" {
@@ -121,7 +121,7 @@ target "op-batcher" {
121121
}
122122
target = "op-batcher-target"
123123
platforms = split(",", PLATFORMS)
124-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-batcher:${tag}"]
124+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-batcher:${tag}"]
125125
}
126126

127127
target "op-proposer" {
@@ -134,7 +134,7 @@ target "op-proposer" {
134134
}
135135
target = "op-proposer-target"
136136
platforms = split(",", PLATFORMS)
137-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-proposer:${tag}"]
137+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-proposer:${tag}"]
138138
}
139139

140140
target "op-challenger" {
@@ -147,7 +147,7 @@ target "op-challenger" {
147147
}
148148
target = "op-challenger-target"
149149
platforms = split(",", PLATFORMS)
150-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-challenger:${tag}"]
150+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-challenger:${tag}"]
151151
}
152152

153153
target "op-dispute-mon" {
@@ -160,7 +160,7 @@ target "op-dispute-mon" {
160160
}
161161
target = "op-dispute-mon-target"
162162
platforms = split(",", PLATFORMS)
163-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-dispute-mon:${tag}"]
163+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-dispute-mon:${tag}"]
164164
}
165165

166166
target "op-conductor" {
@@ -173,7 +173,7 @@ target "op-conductor" {
173173
}
174174
target = "op-conductor-target"
175175
platforms = split(",", PLATFORMS)
176-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-conductor:${tag}"]
176+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-conductor:${tag}"]
177177
}
178178

179179
target "da-server" {
@@ -185,7 +185,7 @@ target "da-server" {
185185
}
186186
target = "da-server-target"
187187
platforms = split(",", PLATFORMS)
188-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/da-server:${tag}"]
188+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-da-server:${tag}"]
189189
}
190190

191191
target "op-program" {
@@ -198,7 +198,7 @@ target "op-program" {
198198
}
199199
target = "op-program-target"
200200
platforms = split(",", PLATFORMS)
201-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-program:${tag}"]
201+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-program:${tag}"]
202202
}
203203

204204
target "op-supervisor" {
@@ -211,7 +211,7 @@ target "op-supervisor" {
211211
}
212212
target = "op-supervisor-target"
213213
platforms = split(",", PLATFORMS)
214-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/op-supervisor:${tag}"]
214+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-op-supervisor:${tag}"]
215215
}
216216

217217
target "op-supernode" {
@@ -263,7 +263,7 @@ target "cannon" {
263263
}
264264
target = "cannon-target"
265265
platforms = split(",", PLATFORMS)
266-
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}/cannon:${tag}"]
266+
tags = [for tag in split(",", IMAGE_TAGS) : "${REGISTRY}/${REPOSITORY}-cannon:${tag}"]
267267
}
268268

269269
target "holocene-deployer" {

frax-da/cli.go

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package fraxda
2+
3+
import (
4+
"fmt"
5+
"net/url"
6+
7+
"github.com/urfave/cli/v2"
8+
9+
opservice "github.com/ethereum-optimism/optimism/op-service"
10+
"github.com/ethereum-optimism/optimism/op-service/cliiface"
11+
)
12+
13+
const (
14+
DaRpcFlagName = "da.rpc"
15+
)
16+
17+
var (
18+
defaultDaRpc = "https://da-rpc.mainnet.frax.com"
19+
)
20+
21+
func CLIFlags(envPrefix string) []cli.Flag {
22+
return []cli.Flag{
23+
&cli.StringFlag{
24+
Name: DaRpcFlagName,
25+
Usage: "DA endpoint",
26+
Value: defaultDaRpc,
27+
EnvVars: opservice.PrefixEnvVar(envPrefix, "DA_RPC"),
28+
},
29+
}
30+
}
31+
32+
type Config struct {
33+
DaRpc string
34+
}
35+
36+
func (c Config) Check() error {
37+
if c.DaRpc == "" {
38+
c.DaRpc = defaultDaRpc
39+
}
40+
41+
if _, err := url.Parse(c.DaRpc); err != nil {
42+
return fmt.Errorf("invalid da rpc url: %w", err)
43+
}
44+
45+
return nil
46+
}
47+
48+
type CLIConfig struct {
49+
DaRpc string
50+
}
51+
52+
func (c CLIConfig) Check() error {
53+
if c.DaRpc == "" {
54+
c.DaRpc = defaultDaRpc
55+
}
56+
57+
if _, err := url.Parse(c.DaRpc); err != nil {
58+
return fmt.Errorf("invalid da rpc url: %w", err)
59+
}
60+
61+
return nil
62+
}
63+
64+
func NewCLIConfig() CLIConfig {
65+
return CLIConfig{
66+
DaRpc: defaultDaRpc,
67+
}
68+
}
69+
70+
func ReadCLIConfig(ctx cliiface.Context) CLIConfig {
71+
return CLIConfig{
72+
DaRpc: ctx.String(DaRpcFlagName),
73+
}
74+
}

0 commit comments

Comments
 (0)