Skip to content

Commit

Permalink
Merge pull request #1518 from bnb-chain/develop
Browse files Browse the repository at this point in the history
release: merge several PRs to master for release v1.2.0
  • Loading branch information
brilliant-lx authored Apr 25, 2023
2 parents 0146b07 + 779f4a8 commit 30c298f
Show file tree
Hide file tree
Showing 15 changed files with 168 additions and 203 deletions.
22 changes: 8 additions & 14 deletions .github/generate_change_log.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,20 @@ TESTNET_ZIP_SUM="$(checksum ./testnet.zip)"
LINUX_BIN_SUM="$(checksum ./linux/geth)"
MAC_BIN_SUM="$(checksum ./macos/geth)"
WINDOWS_BIN_SUM="$(checksum ./windows/geth.exe)"
ARM5_BIN_SUM="$(checksum ./arm5/geth-linux-arm-5)"
ARM6_BIN_SUM="$(checksum ./arm6/geth-linux-arm-6)"
ARM7_BIN_SUM="$(checksum ./arm7/geth-linux-arm-7)"
ARM64_BIN_SUM="$(checksum ./arm64/geth-linux-arm64)"
OUTPUT=$(cat <<-END
## Changelog\n
${CHANGE_LOG}\n
## Assets\n
| Assets | Sha256 Checksum |\n
| :-----------: |------------|\n
| mainnet.zip | ${MAINNET_ZIP_SUM} |\n
| testnet.zip | ${TESTNET_ZIP_SUM} |\n
| geth_linux | ${LINUX_BIN_SUM} |\n
| geth_mac | ${MAC_BIN_SUM} |\n
| geth_windows | ${WINDOWS_BIN_SUM} |\n
| geth_linux_arm-5 | ${ARM5_BIN_SUM} |\n
| geth_linux_arm-6 | ${ARM6_BIN_SUM} |\n
| geth_linux_arm-7 | ${ARM7_BIN_SUM} |\n
| Assets | Sha256 Checksum |
| :-----------: |------------|
| mainnet.zip | ${MAINNET_ZIP_SUM} |
| testnet.zip | ${TESTNET_ZIP_SUM} |
| geth_linux | ${LINUX_BIN_SUM} |
| geth_mac | ${MAC_BIN_SUM} |
| geth_windows | ${WINDOWS_BIN_SUM} |
| geth_linux_arm64 | ${ARM64_BIN_SUM} |\n
END
)

echo -e ${OUTPUT}
echo -e "${OUTPUT}"
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.50
version: v1.52.2
working-directory: ./
skip-pkg-cache: true
skip-cache: true
Expand Down
62 changes: 17 additions & 45 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ jobs:
# ==============================

- name: Build Binary for ${{matrix.os}}
env:
CGO_ENABLED: "0"
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
wget https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xvf ./x86_64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth
- name: Build Binary for ${{matrix.os}}
if: matrix.os != 'ubuntu-latest'
run: |
go mod download
make geth
Expand All @@ -58,7 +67,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
make geth-linux-arm
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xvf ./aarch64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth-linux-arm64 -a ./cmd/geth
# ==============================
# Upload artifacts
# ==============================
Expand All @@ -84,27 +98,6 @@ jobs:
name: windows
path: ./build/bin/geth.exe

- name: Upload ARM-5 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm5
path: ./build/bin/geth-linux-arm-5

- name: Upload ARM-6 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm6
path: ./build/bin/geth-linux-arm-6

- name: Upload ARM-7 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm7
path: ./build/bin/geth-linux-arm-7

- name: Upload ARM-64 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -145,24 +138,6 @@ jobs:
name: windows
path: ./windows

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm5
path: ./arm5

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm6
path: ./arm6

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm7
path: ./arm7

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -204,7 +179,4 @@ jobs:
./linux/geth_linux
./macos/geth_macos
./windows/geth_windows.exe
./arm5/geth-linux-arm-5
./arm6/geth-linux-arm-6
./arm7/geth-linux-arm-7
./arm64/geth-linux-arm64
62 changes: 17 additions & 45 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,17 @@ jobs:
# ==============================

- name: Build Binary for ${{matrix.os}}
env:
CGO_ENABLED: "0"
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
wget https://musl.cc/x86_64-linux-musl-cross.tgz
tar -xvf ./x86_64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=amd64 CGO_ENABLED=1 CC=$(pwd)/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth -a ./cmd/geth
- name: Build Binary for ${{matrix.os}}
if: matrix.os != 'ubuntu-latest'
run: |
go mod download
make geth
Expand All @@ -58,7 +67,12 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
go mod download
make geth-linux-arm
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xvf ./aarch64-linux-musl-cross.tgz
GIT_COMMIT=$(git rev-parse HEAD)
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
GOOS=linux GOARCH=arm64 CGO_ENABLED=1 CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc go build -ldflags "-X main.gitCommit=$GIT_COMMIT -X main.gitDate=$GIT_COMMIT_DATE -extldflags=-static" -o ./build/bin/geth-linux-arm64 -a ./cmd/geth
# ==============================
# Upload artifacts
# ==============================
Expand All @@ -84,27 +98,6 @@ jobs:
name: windows
path: ./build/bin/geth.exe

- name: Upload ARM-5 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm5
path: ./build/bin/geth-linux-arm-5

- name: Upload ARM-6 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm6
path: ./build/bin/geth-linux-arm-6

- name: Upload ARM-7 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: arm7
path: ./build/bin/geth-linux-arm-7

- name: Upload ARM-64 Build
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -145,24 +138,6 @@ jobs:
name: windows
path: ./windows

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm5
path: ./arm5

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm6
path: ./arm6

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
name: arm7
path: ./arm7

- name: Download Artifacts
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -211,7 +186,4 @@ jobs:
./linux/geth_linux
./macos/geth_macos
./windows/geth_windows.exe
./arm5/geth-linux-arm-5
./arm6/geth-linux-arm-6
./arm7/geth-linux-arm-7
./arm64/geth-linux-arm64
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum

# For blst
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
RUN cd /go-ethereum && go run build/ci.go install ./cmd/geth
Expand All @@ -28,10 +30,9 @@ ENV BSC_HOME=/bsc
ENV HOME=${BSC_HOME}
ENV DATA_DIR=/data

ARG VERSION_GCC=11.2.1_git20220219-r2
ENV PACKAGES ca-certificates jq \
bash bind-tools tini \
grep curl sed gcc==${VERSION_GCC}
grep curl sed gcc

RUN apk add --no-cache $PACKAGES \
&& rm -rf /var/cache/apk/* \
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile.alltools
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ COPY go.sum /go-ethereum/
RUN cd /go-ethereum && go mod download

ADD . /go-ethereum
# For blst
ENV CGO_CFLAGS="-O -D__BLST_PORTABLE__"
ENV CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
RUN cd /go-ethereum && go run build/ci.go install

# Pull all binaries into a second stage deploy alpine container
Expand Down
18 changes: 0 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

.PHONY: geth android ios evm all test truffle-test clean
.PHONY: docker
.PHONY: geth-linux-arm geth-linux-arm64 geth-linux-arm5 geth-linux-arm6 geth-linux-arm7

GOBIN = ./build/bin
GO ?= latest
Expand All @@ -17,23 +16,6 @@ geth:
@echo "Done building."
@echo "Run \"$(GOBIN)/geth\" to launch geth."

ldflags = -X main.gitCommit=$(GIT_COMMIT) \
-X main.gitDate=$(GIT_COMMIT_DATE)

geth-linux-arm: geth-linux-arm5 geth-linux-arm6 geth-linux-arm7 geth-linux-arm64

geth-linux-arm5:
env GO111MODULE=on GOARCH=arm GOARM=5 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-5 ./cmd/geth

geth-linux-arm6:
env GO111MODULE=on GOARCH=arm GOARM=6 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-6 ./cmd/geth

geth-linux-arm7:
env GO111MODULE=on GOARCH=arm GOARM=7 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm-7 ./cmd/geth

geth-linux-arm64:
env GO111MODULE=on GOARCH=arm64 GOOS=linux go build -ldflags="$(ldflags)" -o build/bin/geth-linux-arm64 ./cmd/geth

all:
$(GORUN) build/ci.go install

Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Many of the below are the same as or similar to go-ethereum.

For prerequisites and detailed build instructions please read the [Installation Instructions](https://geth.ethereum.org/docs/getting-started/installing-geth).

Building `geth` requires both a Go (version 1.18 or later) and a C compiler. You can install
Building `geth` requires both a Go (version 1.19 or later) and a C compiler. You can install
them using your favourite package manager. Once the dependencies are installed, run

```shell
Expand All @@ -74,6 +74,16 @@ or, to build the full suite of utilities:
make all
```

If you get such error when running the node with self built binary:
```shell
Caught SIGILL in blst_cgo_init, consult <blst>/bindinds/go/README.md.
```
please try to add the following environment variables and build again:
```shell
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
export CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
```

## Executables

The bsc project comes with several wrappers/executables found in the `cmd`
Expand Down
Loading

0 comments on commit 30c298f

Please sign in to comment.