Skip to content

Commit 4748aa3

Browse files
authored
Merge pull request #246 from bnb-chain/develop
prepare for v0.5.1
2 parents 2f232a8 + f278007 commit 4748aa3

File tree

9 files changed

+65
-5
lines changed

9 files changed

+65
-5
lines changed

.github/workflows/docker-release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ jobs:
4242
push: true
4343
tags: ${{ steps.meta.outputs.tags }}
4444
labels: ${{ steps.meta.outputs.labels }}
45+
platforms: linux/amd64,linux/arm64
46+
provenance: false
4547

4648
push-op-batcher:
4749
runs-on: ubuntu-latest
@@ -75,6 +77,8 @@ jobs:
7577
push: true
7678
tags: ${{ steps.meta.outputs.tags }}
7779
labels: ${{ steps.meta.outputs.labels }}
80+
platforms: linux/amd64,linux/arm64
81+
provenance: false
7882

7983
push-op-proposer:
8084
runs-on: ubuntu-latest
@@ -108,6 +112,8 @@ jobs:
108112
push: true
109113
tags: ${{ steps.meta.outputs.tags }}
110114
labels: ${{ steps.meta.outputs.labels }}
115+
platforms: linux/amd64,linux/arm64
116+
provenance: false
111117

112118
push-op-bootnode:
113119
runs-on: ubuntu-latest
@@ -141,3 +147,5 @@ jobs:
141147
push: true
142148
tags: ${{ steps.meta.outputs.tags }}
143149
labels: ${{ steps.meta.outputs.labels }}
150+
platforms: linux/amd64,linux/arm64
151+
provenance: false

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## v0.5.1
4+
5+
This is a minor release and upgrading is optional.
6+
7+
### What's Changed
8+
* fix(ci): support building arm64 architecture by @welkin22 in https://github.com/bnb-chain/opbnb/pull/239
9+
* fix(op-node): l1 client chan stuck when closed in ELSync mode by @welkin22 in https://github.com/bnb-chain/opbnb/pull/241
10+
* fix: add sync status when newpayload API meet the specific error by @krish-nr in https://github.com/bnb-chain/opbnb/pull/240
11+
12+
### Docker Images
13+
14+
- ghcr.io/bnb-chain/op-node:v0.5.1
15+
- ghcr.io/bnb-chain/op-batcher:v0.5.1
16+
- ghcr.io/bnb-chain/op-proposer:v0.5.1
17+
18+
**Full Changelog**: https://github.com/bnb-chain/opbnb/compare/v0.5.0...v0.5.1
19+
320
## v0.5.0
421

522
This release includes code merging from the upstream version v1.7.7 along with several fixs and improvements.

op-batcher/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,13 @@ ifeq ($(shell uname),Darwin)
2525
endif
2626

2727
op-batcher:
28+
ifeq ($(TARGETARCH),arm64)
29+
wget https://musl.cc/aarch64-linux-musl-cross.tgz
30+
tar zxf aarch64-linux-musl-cross.tgz
31+
export PATH=$$PATH:/app/op-batcher/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-batcher ./cmd
32+
else
2833
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-batcher ./cmd
34+
endif
2935

3036
clean:
3137
rm bin/op-batcher

op-bootnode/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
88
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
99

1010
op-bootnode:
11+
ifeq ($(TARGETARCH),arm64)
12+
wget https://musl.cc/aarch64-linux-musl-cross.tgz
13+
tar zxf aarch64-linux-musl-cross.tgz
14+
export PATH=$$PATH:/app/op-bootnode/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-bootnode ./cmd
15+
else
1116
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-bootnode ./cmd
17+
endif
1218

1319
clean:
1420
rm -f bin/op-bootnode

op-node/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM --platform=$BUILDPLATFORM golang:1.21.5-alpine3.18 as builder
22

33
ARG VERSION=v0.0.0
44

5-
RUN apk add --no-cache build-base libc-dev
5+
RUN apk add --no-cache build-base libc-dev wget
66
RUN apk add --no-cache make gcc musl-dev linux-headers git jq bash
77

88
# build op-node with the shared go.mod & go.sum files
@@ -17,10 +17,10 @@ COPY ./go.sum /app/go.sum
1717
COPY ./.git /app/.git
1818

1919
WORKDIR /app/op-node
20-
2120
RUN go mod download
2221

23-
ARG TARGETOS TARGETARCH
22+
ARG TARGETOS
23+
ARG TARGETARCH
2424

2525
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
2626
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"

op-node/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,13 @@ ifeq ($(shell uname),Darwin)
2626
endif
2727

2828
op-node:
29+
ifeq ($(TARGETARCH),arm64)
30+
wget https://musl.cc/aarch64-linux-musl-cross.tgz
31+
tar zxf aarch64-linux-musl-cross.tgz
32+
export PATH=$$PATH:/app/op-node/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-node ./cmd/main.go
33+
else
2934
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-node ./cmd/main.go
35+
endif
3036

3137
clean:
3238
rm bin/op-node

op-proposer/Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ LDFLAGSSTRING +=-X main.Version=$(VERSION)
2020
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
2121

2222
op-proposer:
23+
ifeq ($(TARGETARCH),arm64)
24+
wget https://musl.cc/aarch64-linux-musl-cross.tgz
25+
tar zxf aarch64-linux-musl-cross.tgz
26+
export PATH=$$PATH:/app/op-proposer/aarch64-linux-musl-cross/bin/ && env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) CC=aarch64-linux-musl-gcc CGO_ENABLED=1 go build -v $(LDFLAGS) -o ./bin/op-proposer ./cmd
27+
else
2328
env GO111MODULE=on GOOS=$(TARGETOS) GOARCH=$(TARGETARCH) go build -v $(LDFLAGS) -o ./bin/op-proposer ./cmd
29+
endif
2430

2531
clean:
2632
rm bin/op-proposer

op-service/sources/engine_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ func (s *EngineAPIClient) NewPayload(ctx context.Context, payload *eth.Execution
139139
e.Trace("Received payload execution result", "status", result.Status, "latestValidHash", result.LatestValidHash, "message", result.ValidationError)
140140
if err != nil {
141141
if strings.Contains(err.Error(), derive.ErrELSyncTriggerUnexpected.Error()) {
142+
result.Status = eth.ExecutionSyncing
142143
return &result, err
143144
}
144145
e.Error("Payload execution failed", "err", err)

op-service/sources/l1_client.go

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"fmt"
66
"strings"
77
"sync"
8+
"sync/atomic"
89
"time"
910

1011
"github.com/ethereum/go-ethereum"
@@ -62,9 +63,12 @@ type L1Client struct {
6263
l1BlockRefsCache *caching.LRUCache[common.Hash, eth.L1BlockRef]
6364

6465
//ensure pre-fetch receipts only once
65-
preFetchReceiptsOnce sync.Once
66+
preFetchReceiptsOnce sync.Once
67+
isPreFetchReceiptsRunning atomic.Bool
6668
//start block for pre-fetch receipts
6769
preFetchReceiptsStartBlockChan chan uint64
70+
preFetchReceiptsClosedChan chan struct{}
71+
6872
//max concurrent requests
6973
maxConcurrentRequests int
7074
//done chan
@@ -83,6 +87,7 @@ func NewL1Client(client client.RPC, log log.Logger, metrics caching.Metrics, con
8387
l1BlockRefsCache: caching.NewLRUCache[common.Hash, eth.L1BlockRef](metrics, "blockrefs", config.L1BlockRefsCacheSize),
8488
preFetchReceiptsOnce: sync.Once{},
8589
preFetchReceiptsStartBlockChan: make(chan uint64, 1),
90+
preFetchReceiptsClosedChan: make(chan struct{}),
8691
maxConcurrentRequests: config.MaxConcurrentRequests,
8792
done: make(chan struct{}),
8893
}, nil
@@ -140,13 +145,15 @@ func (s *L1Client) GoOrUpdatePreFetchReceipts(ctx context.Context, l1Start uint6
140145
s.preFetchReceiptsStartBlockChan <- l1Start
141146
s.preFetchReceiptsOnce.Do(func() {
142147
s.log.Info("pre-fetching receipts start", "startBlock", l1Start)
148+
s.isPreFetchReceiptsRunning.Store(true)
143149
go func() {
144150
var currentL1Block uint64
145151
var parentHash common.Hash
146152
for {
147153
select {
148154
case <-s.done:
149155
s.log.Info("pre-fetching receipts done")
156+
s.preFetchReceiptsClosedChan <- struct{}{}
150157
return
151158
case currentL1Block = <-s.preFetchReceiptsStartBlockChan:
152159
s.log.Debug("pre-fetching receipts currentL1Block changed", "block", currentL1Block)
@@ -259,6 +266,9 @@ func (s *L1Client) ClearReceiptsCacheBefore(blockNumber uint64) {
259266
}
260267

261268
func (s *L1Client) Close() {
262-
s.done <- struct{}{}
269+
if s.isPreFetchReceiptsRunning.Load() {
270+
close(s.done)
271+
<-s.preFetchReceiptsClosedChan
272+
}
263273
s.EthClient.Close()
264274
}

0 commit comments

Comments
 (0)