Skip to content

Commit 53963e6

Browse files
build: add mock_ccc docker (#437)
* add nccc docker * update mock ccc * update * update * update * format codes --------- Co-authored-by: Péter Garamvölgyi <peter@scroll.io>
1 parent cf42026 commit 53963e6

File tree

4 files changed

+70
-2
lines changed

4 files changed

+70
-2
lines changed

Dockerfile.mockccc

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Support setting various labels on the final image
2+
ARG COMMIT=""
3+
ARG VERSION=""
4+
ARG BUILDNUM=""
5+
6+
# Build Geth in a stock Go builder container
7+
FROM scrolltech/go-rust-builder:go-1.19-rust-nightly-2022-12-10 as builder
8+
9+
ADD . /go-ethereum
10+
RUN cd /go-ethereum && env GO111MODULE=on go run build/ci.go install ./cmd/geth
11+
12+
# Pull Geth into a second stage deploy alpine container
13+
FROM ubuntu:20.04
14+
15+
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
16+
17+
EXPOSE 8545 8546 30303 30303/udp
18+
ENTRYPOINT ["geth"]
19+
20+
# Add some metadata labels to help programatic image consumption
21+
ARG COMMIT=""
22+
ARG VERSION=""
23+
ARG BUILDNUM=""
24+
25+
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"

Dockerfile.mockccc.alpine

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Support setting various labels on the final image
2+
ARG COMMIT=""
3+
ARG VERSION=""
4+
ARG BUILDNUM=""
5+
6+
# Build Geth in a stock Go builder container
7+
FROM golang:1.18-alpine as builder
8+
9+
RUN apk add --no-cache gcc musl-dev linux-headers git
10+
11+
ADD . /go-ethereum
12+
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
13+
14+
# Pull Geth into a second stage deploy alpine container
15+
FROM alpine:latest
16+
17+
RUN apk add --no-cache ca-certificates
18+
COPY --from=builder /go-ethereum/build/bin/geth /usr/local/bin/
19+
20+
EXPOSE 8545 8546 30303 30303/udp
21+
ENTRYPOINT ["geth"]
22+
23+
# Add some metadata labels to help programatic image consumption
24+
ARG COMMIT=""
25+
ARG VERSION=""
26+
ARG BUILDNUM=""
27+
28+
LABEL commit="$COMMIT" version="$VERSION" buildnum="$BUILDNUM"

Makefile

+9
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,12 @@ devtools:
6060
env GOBIN= go install ./cmd/abigen
6161
@type "solc" 2> /dev/null || echo 'Please install solc'
6262
@type "protoc" 2> /dev/null || echo 'Please install protoc'
63+
64+
docker:
65+
docker build --platform linux/x86_64 -t scrolltech/l2geth:latest ./ -f Dockerfile
66+
67+
mockccc_docker:
68+
docker build --platform linux/x86_64 -t scrolltech/l2geth:latest ./ -f Dockerfile.mockccc
69+
70+
mockccc_alpine_docker:
71+
docker build --platform linux/x86_64 -t scrolltech/l2geth:latest ./ -f Dockerfile.mockccc.alpine

rollup/circuitcapacitychecker/mock.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,15 @@ func (ccc *CircuitCapacityChecker) Reset() {
2020
}
2121

2222
func (ccc *CircuitCapacityChecker) ApplyTransaction(traces *types.BlockTrace) (*types.RowConsumption, error) {
23-
return nil, nil
23+
return &types.RowConsumption{types.SubCircuitRowUsage{
24+
Name: "mock",
25+
RowNumber: 1,
26+
}}, nil
2427
}
2528

2629
func (ccc *CircuitCapacityChecker) ApplyBlock(traces *types.BlockTrace) (*types.RowConsumption, error) {
27-
return nil, nil
30+
return &types.RowConsumption{types.SubCircuitRowUsage{
31+
Name: "mock",
32+
RowNumber: 2,
33+
}}, nil
2834
}

0 commit comments

Comments
 (0)