Skip to content

Commit 6b837c0

Browse files
authored
fix(build): image building (#1603)
Co-authored-by: colinlyguo <[email protected]>
1 parent 5b6b145 commit 6b837c0

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Download Go dependencies
2-
FROM golang:1.21-alpine3.19 as base
2+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as base
33

44
WORKDIR /src
55
COPY ./bridge-history-api/go.* ./
@@ -10,10 +10,11 @@ FROM base as builder
1010

1111
RUN --mount=target=. \
1212
--mount=type=cache,target=/root/.cache/go-build \
13-
cd /src/bridge-history-api/cmd/db_cli && go build -v -p 4 -o /bin/db_cli
13+
cd /src/bridge-history-api/cmd/db_cli && CGO_LDFLAGS="-Wl,--no-as-needed -ldl" go build -v -p 4 -o /bin/db_cli
1414

15-
# Pull db_cli into a second stage deploy alpine container
16-
FROM alpine:latest
15+
# Pull db_cli into a second stage deploy ubuntu container
16+
FROM ubuntu:20.04
17+
ENV CGO_LDFLAGS="-ldl"
1718
COPY --from=builder /bin/db_cli /bin/
1819
WORKDIR /app
1920
ENTRYPOINT ["db_cli"]

build/dockerfiles/db_cli.Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Download Go dependencies
2-
FROM scrolltech/go-alpine-builder:1.21 as base
2+
FROM scrolltech/go-rust-builder:go-1.21-rust-nightly-2023-12-03 as base
33

44
WORKDIR /src
55
COPY go.work* ./
@@ -16,10 +16,11 @@ FROM base as builder
1616

1717
RUN --mount=target=. \
1818
--mount=type=cache,target=/root/.cache/go-build \
19-
cd /src/database/cmd && go build -v -p 4 -o /bin/db_cli
19+
cd /src/database/cmd && CGO_LDFLAGS="-Wl,--no-as-needed -ldl" go build -v -p 4 -o /bin/db_cli
2020

21-
# Pull db_cli into a second stage deploy alpine container
22-
FROM alpine:latest
21+
# Pull db_cli into a second stage deploy ubuntu container
22+
FROM ubuntu:20.04
23+
ENV CGO_LDFLAGS="-ldl"
2324
COPY --from=builder /bin/db_cli /bin/
2425
WORKDIR /app
2526
ENTRYPOINT ["db_cli"]

common/version/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"runtime/debug"
66
)
77

8-
var tag = "v4.4.88"
8+
var tag = "v4.4.89"
99

1010
var commit = func() string {
1111
if info, ok := debug.ReadBuildInfo(); ok {

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,7 @@ github.com/dave/jennifer v1.2.0 h1:S15ZkFMRoJ36mGAQgWL1tnr0NQJh9rZ8qatseX/VbBc=
629629
github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg=
630630
github.com/dchest/blake512 v1.0.0 h1:oDFEQFIqFSeuA34xLtXZ/rWxCXdSjirjzPhey5EUvmA=
631631
github.com/dchest/blake512 v1.0.0/go.mod h1:FV1x7xPPLWukZlpDpWQ88rF/SFwZ5qbskrzhLMB92JI=
632+
github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4=
632633
github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo=
633634
github.com/deepmap/oapi-codegen v1.6.0 h1:w/d1ntwh91XI0b/8ja7+u5SvA4IFfM0UNNLmiDR1gg0=
634635
github.com/deepmap/oapi-codegen v1.6.0/go.mod h1:ryDa9AgbELGeB+YEXE1dR53yAjHwFvE9iAUlWl9Al3M=

rollup/internal/controller/sender/sender.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"github.com/holiman/uint256"
1313
"github.com/prometheus/client_golang/prometheus"
1414
"github.com/scroll-tech/go-ethereum/common"
15-
"github.com/scroll-tech/go-ethereum/consensus/misc/eip4844"
15+
"github.com/scroll-tech/go-ethereum/consensus/misc"
1616
gethTypes "github.com/scroll-tech/go-ethereum/core/types"
1717
"github.com/scroll-tech/go-ethereum/crypto/kzg4844"
1818
"github.com/scroll-tech/go-ethereum/ethclient"
@@ -675,7 +675,7 @@ func (s *Sender) getBlockNumberAndBaseFeeAndBlobFee(ctx context.Context) (uint64
675675

676676
var blobBaseFee uint64
677677
if excess := header.ExcessBlobGas; excess != nil {
678-
blobBaseFee = eip4844.CalcBlobFee(*excess).Uint64()
678+
blobBaseFee = misc.CalcBlobFee(*excess).Uint64()
679679
}
680680
// header.Number.Uint64() returns the pendingBlockNumber, so we minus 1 to get the latestBlockNumber.
681681
return header.Number.Uint64() - 1, baseFee, blobBaseFee, nil

rollup/internal/controller/watcher/l1_watcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"math/big"
77

88
"github.com/prometheus/client_golang/prometheus"
9-
"github.com/scroll-tech/go-ethereum/consensus/misc/eip4844"
9+
"github.com/scroll-tech/go-ethereum/consensus/misc"
1010
gethTypes "github.com/scroll-tech/go-ethereum/core/types"
1111
"github.com/scroll-tech/go-ethereum/ethclient"
1212
"github.com/scroll-tech/go-ethereum/log"
@@ -80,7 +80,7 @@ func (w *L1WatcherClient) FetchBlockHeader(blockHeight uint64) error {
8080

8181
var blobBaseFee uint64
8282
if excess := block.ExcessBlobGas; excess != nil {
83-
blobBaseFee = eip4844.CalcBlobFee(*excess).Uint64()
83+
blobBaseFee = misc.CalcBlobFee(*excess).Uint64()
8484
}
8585

8686
l1Block := orm.L1Block{

0 commit comments

Comments
 (0)