Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
28499887
Unverified
Commit
28499887
authored
Mar 02, 2023
by
mergify[bot]
Committed by
GitHub
Mar 02, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into willc/rename-createKey
parents
3d5f26c4
c591b584
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
152 additions
and
42 deletions
+152
-42
config.yml
.circleci/config.yml
+45
-33
Dockerfile
op-batcher/Dockerfile
+6
-2
Makefile
op-batcher/Makefile
+1
-1
channel_manager_test.go
op-batcher/batcher/channel_manager_test.go
+86
-0
Dockerfile
op-node/Dockerfile
+6
-2
Makefile
op-node/Makefile
+1
-1
Dockerfile
op-proposer/Dockerfile
+6
-2
Makefile
op-proposer/Makefile
+1
-1
No files found.
.circleci/config.yml
View file @
28499887
...
...
@@ -147,6 +147,8 @@ jobs:
-
"
."
docker-publish
:
environment
:
DOCKER_BUILDKIT
:
1
parameters
:
docker_name
:
description
:
Docker image name
...
...
@@ -154,6 +156,13 @@ jobs:
docker_tags
:
description
:
Docker image tags as csv
type
:
string
docker_file
:
description
:
Path to Dockerfile
type
:
string
docker_context
:
description
:
Docker build context
type
:
string
default
:
"
."
registry
:
description
:
Docker registry
type
:
string
...
...
@@ -162,17 +171,14 @@ jobs:
description
:
Docker repo
type
:
string
default
:
"
oplabs-tools-artifacts/images"
platforms
:
description
:
Platforms to build for
type
:
string
default
:
"
linux/amd64"
machine
:
image
:
ubuntu-2204:2022.07.1
resource_class
:
xlarge
steps
:
-
attach_workspace
:
at
:
/tmp/docker_images
-
run
:
name
:
Docker load
command
:
|
DOCKER_LABELS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g")
echo -ne $DOCKER_LABELS | tr ' ' '\n' | xargs -I {} docker load -i /tmp/docker_images/<<parameters.docker_name>>_{}.tar
-
gcp-oidc-authenticate
# Below is CircleCI recommended way of specifying nameservers on an Ubuntu box:
# https://support.circleci.com/hc/en-us/articles/7323511028251-How-to-set-custom-DNS-on-Ubuntu-based-images-using-netplan
...
...
@@ -181,13 +187,19 @@ jobs:
-
run
:
sudo sed -i "s/addresses:/ addresses":" [8.8.8.8, 8.8.4.4] /g" /etc/netplan/50-cloud-init.yaml
-
run
:
cat /etc/netplan/50-cloud-init.yaml
-
run
:
sudo netplan apply
-
checkout
-
run
:
name
:
Publish
name
:
Build &
Publish
command
:
|
gcloud auth configure-docker <<parameters.registry>>
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|${IMAGE_BASE}:|")
echo -ne $DOCKER_TAGS | tr ' ' '\n' | xargs -L1 docker push
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker context create buildx-build
docker buildx create --use buildx-build
docker buildx build --platform=<<parameters.platforms>> --push \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
<<parameters.docker_context>>
docker-release
:
environment
:
...
...
@@ -213,6 +225,10 @@ jobs:
description
:
Docker repo
type
:
string
default
:
"
oplabs-tools-artifacts/images"
platforms
:
description
:
Platforms to build for
type
:
string
default
:
"
linux/amd64"
machine
:
image
:
ubuntu-2204:2022.07.1
resource_class
:
xlarge
...
...
@@ -220,26 +236,21 @@ jobs:
-
gcp-cli/install
-
gcp-oidc-authenticate
-
checkout
-
run
:
name
:
Build
command
:
|
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker build \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
--build-arg VERSION=$CIRCLE_TAG \
<<parameters.docker_context>>
-
run
:
name
:
Configure Docker
command
:
|
gcloud auth configure-docker <<parameters.registry>>
-
run
:
name
:
Publish
name
:
Build &
Publish
command
:
|
IMAGE_BASE="<<parameters.registry>>/<<parameters.repo>>/<<parameters.docker_name>>"
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|${IMAGE_BASE}:|")
echo -ne $DOCKER_TAGS | tr ' ' '\n' | xargs -L1 docker push
DOCKER_TAGS=$(echo -ne <<parameters.docker_tags>> | sed "s/,/\n/g" | sed "s/[^a-zA-Z0-9\n]/-/g" | sed -e "s|^|-t ${IMAGE_BASE}:|")
docker context create buildx-build
docker buildx create --use buildx-build
docker buildx build --platform=<<parameters.platforms>> --push \
$(echo -ne $DOCKER_TAGS | tr '\n' ' ') \
-f <<parameters.docker_file>> \
<<parameters.docker_context>>
-
run
:
name
:
Tag
command
:
|
...
...
@@ -1062,11 +1073,11 @@ workflows:
-
docker-publish
:
name
:
op-node-docker-publish
docker_name
:
op-node
docker_file
:
op-node/Dockerfile
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-node-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-batcher-docker-build
docker_file
:
op-batcher/Dockerfile
...
...
@@ -1075,12 +1086,12 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-batcher-docker-publish
docker_file
:
op-batcher/Dockerfile
docker_name
:
op-batcher
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-batcher-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-proposer-docker-build
docker_file
:
op-proposer/Dockerfile
...
...
@@ -1089,12 +1100,12 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-proposer-docker-publish
docker_file
:
op-proposer/Dockerfile
docker_name
:
op-proposer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-proposer-docker-build
platforms
:
"
linux/amd64,linux/arm64"
-
docker-build
:
name
:
op-heartbeat-docker-build
docker_file
:
op-heartbeat/Dockerfile
...
...
@@ -1103,12 +1114,11 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
op-heartbeat-docker-publish
docker_file
:
op-heartbeat/Dockerfile
docker_name
:
op-heartbeat
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
op-heartbeat-docker-build
-
docker-build
:
name
:
indexer-docker-build
docker_file
:
indexer/Dockerfile
...
...
@@ -1117,12 +1127,11 @@ workflows:
docker_context
:
.
-
docker-publish
:
name
:
indexer-docker-publish
docker_file
:
indexer/Dockerfile
docker_name
:
indexer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
context
:
-
oplabs-gcr
requires
:
-
indexer-docker-build
-
hive-test
:
name
:
hive-test-rpc
version
:
<<pipeline.git.revision>>
...
...
@@ -1167,6 +1176,7 @@ workflows:
docker_name
:
op-node
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
@@ -1182,6 +1192,7 @@ workflows:
docker_name
:
op-batcher
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
@@ -1197,6 +1208,7 @@ workflows:
docker_name
:
op-proposer
docker_tags
:
<<pipeline.git.revision>>,<<pipeline.git.branch>>
docker_context
:
.
platforms
:
"
linux/amd64,linux/arm64"
context
:
-
oplabs-gcr-release
requires
:
...
...
op-batcher/Dockerfile
View file @
28499887
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -17,7 +17,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-batcher
RUN
make op-batcher
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-batcher
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-batcher/Makefile
View file @
28499887
...
...
@@ -8,7 +8,7 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-batcher
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-batcher ./cmd
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-batcher ./cmd
clean
:
rm
bin/op-batcher
...
...
op-batcher/batcher/channel_manager_test.go
0 → 100644
View file @
28499887
package
batcher_test
import
(
"io"
"math/big"
"testing"
"github.com/ethereum-optimism/optimism/op-batcher/batcher"
"github.com/ethereum-optimism/optimism/op-node/eth"
"github.com/ethereum-optimism/optimism/op-node/rollup/derive"
"github.com/ethereum-optimism/optimism/op-node/testlog"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/trie"
"github.com/stretchr/testify/require"
)
// TestChannelManagerReturnsErrReorg ensures that the channel manager
// detects a reorg when it has cached L1 blocks.
func
TestChannelManagerReturnsErrReorg
(
t
*
testing
.
T
)
{
log
:=
testlog
.
Logger
(
t
,
log
.
LvlCrit
)
m
:=
batcher
.
NewChannelManager
(
log
,
batcher
.
ChannelConfig
{})
a
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
0
),
},
nil
,
nil
,
nil
,
nil
)
b
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
1
),
ParentHash
:
a
.
Hash
(),
},
nil
,
nil
,
nil
,
nil
)
c
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
2
),
ParentHash
:
b
.
Hash
(),
},
nil
,
nil
,
nil
,
nil
)
x
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
2
),
ParentHash
:
common
.
Hash
{
0xff
},
},
nil
,
nil
,
nil
,
nil
)
err
:=
m
.
AddL2Block
(
a
)
require
.
NoError
(
t
,
err
)
err
=
m
.
AddL2Block
(
b
)
require
.
NoError
(
t
,
err
)
err
=
m
.
AddL2Block
(
c
)
require
.
NoError
(
t
,
err
)
err
=
m
.
AddL2Block
(
x
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
}
// TestChannelManagerReturnsErrReorgWhenDrained ensures that the channel manager
// detects a reorg even if it does not have any blocks inside it.
func
TestChannelManagerReturnsErrReorgWhenDrained
(
t
*
testing
.
T
)
{
log
:=
testlog
.
Logger
(
t
,
log
.
LvlCrit
)
m
:=
batcher
.
NewChannelManager
(
log
,
batcher
.
ChannelConfig
{
TargetFrameSize
:
0
,
MaxFrameSize
:
100
,
ApproxComprRatio
:
1.0
,
})
lBlock
:=
types
.
NewBlock
(
&
types
.
Header
{
BaseFee
:
big
.
NewInt
(
10
),
Difficulty
:
common
.
Big0
,
Number
:
big
.
NewInt
(
100
),
},
nil
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
l1InfoTx
,
err
:=
derive
.
L1InfoDeposit
(
0
,
lBlock
,
eth
.
SystemConfig
{},
false
)
require
.
NoError
(
t
,
err
)
txs
:=
[]
*
types
.
Transaction
{
types
.
NewTx
(
l1InfoTx
)}
a
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
0
),
},
txs
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
x
:=
types
.
NewBlock
(
&
types
.
Header
{
Number
:
big
.
NewInt
(
1
),
ParentHash
:
common
.
Hash
{
0xff
},
},
txs
,
nil
,
nil
,
trie
.
NewStackTrie
(
nil
))
err
=
m
.
AddL2Block
(
a
)
require
.
NoError
(
t
,
err
)
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
require
.
NoError
(
t
,
err
)
_
,
_
,
err
=
m
.
TxData
(
eth
.
BlockID
{})
require
.
ErrorIs
(
t
,
err
,
io
.
EOF
)
err
=
m
.
AddL2Block
(
x
)
require
.
ErrorIs
(
t
,
err
,
batcher
.
ErrReorg
)
}
op-node/Dockerfile
View file @
28499887
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -15,7 +15,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-node
RUN
make op-node
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-node
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-node/Makefile
View file @
28499887
...
...
@@ -9,7 +9,7 @@ LDFLAGSSTRING +=-X github.com/ethereum-optimism/optimism/op-node/version.Meta=$(
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-node
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-node ./cmd/main.go
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-node ./cmd/main.go
clean
:
rm
bin/op-node
...
...
op-proposer/Dockerfile
View file @
28499887
FROM
golang:1.18.0-alpine3.15 as builder
FROM
--platform=$BUILDPLATFORM
golang:1.18.0-alpine3.15 as builder
ARG
VERSION=v0.0.0
...
...
@@ -16,7 +16,11 @@ COPY ./.git /app/.git
WORKDIR
/app/op-proposer
RUN
make op-proposer
VERSION
=
"
$VERSION
"
RUN
go mod download
ARG
TARGETOS TARGETARCH
RUN
make op-proposer
VERSION
=
"
$VERSION
"
GOOS
=
$TARGETOS
GOARCH
=
$TARGETARCH
FROM
alpine:3.15
...
...
op-proposer/Makefile
View file @
28499887
...
...
@@ -8,7 +8,7 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
LDFLAGS
:=
-ldflags
"
$(LDFLAGSSTRING)
"
op-proposer
:
env
GO111MODULE
=
on go build
-v
$(LDFLAGS)
-o
./bin/op-proposer ./cmd
env
GO111MODULE
=
on
GOOS
=
$(TARGETOS)
GOARCH
=
$(TARGETARCH)
go build
-v
$(LDFLAGS)
-o
./bin/op-proposer ./cmd
clean
:
rm
bin/op-proposer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment