Skip to content

Commit

Permalink
Merge tag 'v1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
Code0x2 committed May 6, 2023
2 parents 61905e9 + 542bb5b commit 3577aed
Show file tree
Hide file tree
Showing 125 changed files with 10,795 additions and 1,026 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: 2 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ jobs:
- name: Unit Test
env:
CGO_CFLAGS: "-O -D__BLST_PORTABLE__"
CGO_CFLAGS_ALLOW: "-O -D__BLST_PORTABLE__"
ANDROID_HOME: "" # Skip android test
run: |
go mod download
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ profile.cov
**/yarn-error.log
cmd/geth/node/
cmd/geth/__debug_bin
cmd/bootnode/bootnode
graphql/__debug_bin
37 changes: 36 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,40 @@
# Changelog
## v1.2.0
FEATURE
* [\#936](https://github.com/bnb-chain/bsc/pull/936) BEP-126: Introduce Fast Finality Mechanism
* [\#1325](https://github.com/bnb-chain/bsc/pull/1325) genesis: add BEP174 changes to relayer contract
* [\#1357](https://github.com/bnb-chain/bsc/pull/1357) Integration API for EIP-4337 bundler with an L2 validator/sequencer
* [\#1463](https://github.com/bnb-chain/bsc/pull/1463) BEP-221: implement cometBFT light block validation
* [\#1493](https://github.com/bnb-chain/bsc/pull/1493) bep: update the bytecode of luban fork after the contract release

IMPROVEMENT
* [\#1486](https://github.com/bnb-chain/bsc/pull/1486) feature: remove diff protocol registration
* [\#1434](https://github.com/bnb-chain/bsc/pull/1434) fix: improvements after testing fast finality

BUGFIX
* [\#1430](https://github.com/bnb-chain/bsc/pull/1430) docker: upgrade alpine version & remove apks version
* [\#1458](https://github.com/bnb-chain/bsc/pull/1458) cmd/faucet: clear reqs list when reorg to lower nonce
* [\#1484](https://github.com/bnb-chain/bsc/pull/1484) fix: a deadlock caused by bsc protocol handeshake timeout

## v1.1.23
BUGFIX
* [\#1464](https://github.com/bnb-chain/bsc/pull/1464) fix: panic on using WaitGroup after it is freed

## v1.1.22
FEATURE
* [\#1361](https://github.com/bnb-chain/bsc/pull/1361) cmd/faucet: merge ipfaucet2 branch to develop

IMPROVEMENT
* [\#1412](https://github.com/bnb-chain/bsc/pull/1412) fix: init-network with config.toml without setting TimeFormat
* [\#1401](https://github.com/bnb-chain/bsc/pull/1401) log: support custom time format configuration
* [\#1382](https://github.com/bnb-chain/bsc/pull/1382) consnesus/parlia: abort sealing when block in the same height has updated
* [\#1383](https://github.com/bnb-chain/bsc/pull/1383) miner: no need to broadcast sidechain header mined by this validator

BUGFIX
* [\#1379](https://github.com/bnb-chain/bsc/pull/1379) UT: fix some flaky tests
* [\#1403](https://github.com/bnb-chain/bsc/pull/1403) Makefile: fix devtools install error
* [\#1381](https://github.com/bnb-chain/bsc/pull/1381) fix: snapshot generation issue after chain reinit from a freezer

## v1.1.21
FEATURE
* [\#1389](https://github.com/bnb-chain/bsc/pull/1389) upgrade: update the fork height of planck upgrade on mainnet
Expand Down Expand Up @@ -55,7 +91,6 @@ BUGFIX

## v1.1.18
IMPROVEMENT

* [\#1209](https://github.com/bnb-chain/bsc/pull/1209) metrics: add build info into metrics server
* [\#1204](https://github.com/bnb-chain/bsc/pull/1204) worker: NewTxsEvent and triePrefetch reuse in mining task
* [\#1195](https://github.com/bnb-chain/bsc/pull/1195) hardfork: update Gibbs fork height and system contract code
Expand Down
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,21 @@ ARG BUILDNUM=""
# Build Geth in a stock Go builder container
FROM golang:1.19-alpine as builder

RUN apk add --no-cache make gcc musl-dev linux-headers git bash
RUN apk add --no-cache make cmake gcc musl-dev linux-headers git bash build-base libc-dev
# Get dependencies - will also be cached if we won't change go.mod/go.sum
COPY go.mod /go-ethereum/
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

# Pull Geth into a second stage deploy alpine container
FROM alpine:3.16.0
FROM alpine:3.17

ARG BSC_USER=bsc
ARG BSC_USER_UID=1000
Expand All @@ -26,9 +30,9 @@ ENV BSC_HOME=/bsc
ENV HOME=${BSC_HOME}
ENV DATA_DIR=/data

ENV PACKAGES ca-certificates~=20220614-r0 jq~=1.6 \
bash~=5.1.16-r2 bind-tools~=9.16.37 tini~=0.19.0 \
grep~=3.7 curl~=7.83.1 sed~=4.8-r0
ENV PACKAGES ca-certificates jq \
bash bind-tools tini \
grep curl sed gcc

RUN apk add --no-cache $PACKAGES \
&& rm -rf /var/cache/apk/* \
Expand Down Expand Up @@ -56,4 +60,4 @@ USER ${BSC_USER_UID}:${BSC_USER_GID}
# rpc ws graphql
EXPOSE 8545 8546 8547 30303 30303/udp

ENTRYPOINT ["/sbin/tini", "--", "./docker-entrypoint.sh"]
ENTRYPOINT ["/sbin/tini", "--", "./docker-entrypoint.sh"]
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
20 changes: 1 addition & 19 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 Expand Up @@ -74,7 +56,7 @@ clean:

devtools:
env GOBIN= go install golang.org/x/tools/cmd/stringer@latest
env GOBIN= go install github.com/kevinburke/go-bindata/go-bindata@latest
env GOBIN= go install github.com/kevinburke/go-bindata@latest
env GOBIN= go install github.com/fjl/gencodec@latest
env GOBIN= go install github.com/golang/protobuf/protoc-gen-go@latest
env GOBIN= go install ./cmd/abigen
Expand Down
4 changes: 4 additions & 0 deletions accounts/abi/bind/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/ethereum/go-ethereum"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/internal/ethapi"
)

var (
Expand Down Expand Up @@ -96,6 +97,9 @@ type ContractTransactor interface {

// SendTransaction injects the transaction into the pending pool for execution.
SendTransaction(ctx context.Context, tx *types.Transaction) error

// SendTransactionConditional injects the conditional transaction into the pending pool for execution after verification.
SendTransactionConditional(ctx context.Context, tx *types.Transaction, opts ethapi.TransactionOpts) error
}

// ContractFilterer defines the methods needed to access log events using one-off
Expand Down
38 changes: 35 additions & 3 deletions accounts/abi/bind/backends/simulated.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import (
"github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/params"
"github.com/ethereum/go-ethereum/rpc"
Expand Down Expand Up @@ -677,6 +678,18 @@ func (b *SimulatedBackend) SendTransaction(ctx context.Context, tx *types.Transa
return nil
}

// SendTransaction updates the pending block to include the given transaction.
func (b *SimulatedBackend) SendTransactionConditional(ctx context.Context, tx *types.Transaction, opts ethapi.TransactionOpts) error {
state, err := b.blockchain.State()
if err != nil {
return err
}
if err := opts.Check(b.pendingBlock.NumberU64(), b.pendingBlock.Time(), state); err != nil {
return err
}
return b.SendTransaction(ctx, tx)
}

// FilterLogs executes a log filter operation, blocking during execution and
// returning all the results in one batch.
//
Expand Down Expand Up @@ -826,11 +839,22 @@ type filterBackend struct {
func (fb *filterBackend) ChainDb() ethdb.Database { return fb.db }
func (fb *filterBackend) EventMux() *event.TypeMux { panic("not supported") }

func (fb *filterBackend) HeaderByNumber(ctx context.Context, block rpc.BlockNumber) (*types.Header, error) {
if block == rpc.LatestBlockNumber {
func (fb *filterBackend) HeaderByNumber(ctx context.Context, number rpc.BlockNumber) (*types.Header, error) {
switch number {
case rpc.PendingBlockNumber:
if block := fb.backend.pendingBlock; block != nil {
return block.Header(), nil
}
return nil, nil
case rpc.LatestBlockNumber:
return fb.bc.CurrentHeader(), nil
case rpc.FinalizedBlockNumber:
return fb.bc.CurrentFinalBlock(), nil
case rpc.SafeBlockNumber:
return fb.bc.CurrentSafeBlock(), nil
default:
return fb.bc.GetHeaderByNumber(uint64(number.Int64())), nil
}
return fb.bc.GetHeaderByNumber(uint64(block.Int64())), nil
}

func (fb *filterBackend) HeaderByHash(ctx context.Context, hash common.Hash) (*types.Header, error) {
Expand Down Expand Up @@ -869,10 +893,18 @@ func (fb *filterBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.
return nullSubscription()
}

func (fb *filterBackend) SubscribeNewVoteEvent(ch chan<- core.NewVoteEvent) event.Subscription {
return nullSubscription()
}

func (fb *filterBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription {
return fb.bc.SubscribeChainEvent(ch)
}

func (fb *filterBackend) SubscribeFinalizedHeaderEvent(ch chan<- core.FinalizedHeaderEvent) event.Subscription {
return fb.bc.SubscribeFinalizedHeaderEvent(ch)
}

func (fb *filterBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription {
return fb.bc.SubscribeRemovedLogsEvent(ch)
}
Expand Down
5 changes: 5 additions & 0 deletions accounts/abi/bind/base_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/internal/ethapi"
"github.com/ethereum/go-ethereum/rlp"
"github.com/stretchr/testify/assert"
)
Expand Down Expand Up @@ -74,6 +75,10 @@ func (mt *mockTransactor) SendTransaction(ctx context.Context, tx *types.Transac
return nil
}

func (mt *mockTransactor) SendTransactionConditional(ctx context.Context, tx *types.Transaction, opts ethapi.TransactionOpts) error {
return nil
}

type mockCaller struct {
codeAtBlockNumber *big.Int
callContractBlockNumber *big.Int
Expand Down
7 changes: 7 additions & 0 deletions accounts/abi/bind/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2114,6 +2114,13 @@ func TestGolangBindings(t *testing.T) {
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace tendermint dependency to bnb-chain source: %v\n%s", err, out)
}

replacer = exec.Command(gocmd, "mod", "edit", "-x", "-require", "github.com/cometbft/[email protected]", "-replace", "github.com/cometbft/cometbft=github.com/bnb-chain/[email protected]") // Repo root
replacer.Dir = pkg
if out, err := replacer.CombinedOutput(); err != nil {
t.Fatalf("failed to replace cometbft dependency to bnb-chain source: %v\n%s", err, out)
}

tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.19")
tidier.Dir = pkg
if out, err := tidier.CombinedOutput(); err != nil {
Expand Down
18 changes: 18 additions & 0 deletions beacon/engine/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright 2022 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// The go-ethereum library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.

// just for prysm compile pass
package engine
Loading

0 comments on commit 3577aed

Please sign in to comment.