Skip to content

Commit 0f7131f

Browse files
authored
Merge pull request #3465 from bnb-chain/develop
Draft release v1.6.4
2 parents 90d4e8e + e003767 commit 0f7131f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+401
-156
lines changed

.github/workflows/pre-release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ jobs:
5757
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
5858
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
5959
60+
- name: Temporary replace BLS for Windows
61+
if: matrix.os == 'windows-latest'
62+
shell: cmd
63+
run: go mod edit -replace=github.com/herumi/bls-eth-go-binary=github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e && go mod tidy
64+
6065
- name: Build Binary for ${{matrix.os}}
6166
if: matrix.os != 'ubuntu-latest'
6267
run: |

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ jobs:
5656
GIT_COMMIT_DATE=$(git log -n1 --pretty='format:%cd' --date=format:'%Y%m%d')
5757
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
5858
59+
# ==============================
60+
- name: Temporary replace BLS for Windows
61+
if: matrix.os == 'windows-latest'
62+
shell: cmd
63+
run: go mod edit -replace=github.com/herumi/bls-eth-go-binary=github.com/herumi/bls-eth-go-binary@v0.0.0-20210917013441-d37c07cfda4e && go mod tidy
64+
5965
- name: Build Binary for ${{matrix.os}}
6066
if: matrix.os != 'ubuntu-latest'
6167
run: |

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# Changelog
2+
## v1.6.4
3+
### FEATURE
4+
[\#3466](https://github.com/bnb-chain/bsc/pull/3466) config: update BSC Mainnet hardfork time: Fermi
5+
[\#3454](https://github.com/bnb-chain/bsc/pull/3454) eth: support fetch commit id info from extra data
6+
7+
### BUGFIX
8+
[\#3448](https://github.com/bnb-chain/bsc/pull/3448) TxPool: change lifetime back to 3 hours
9+
[\#3457](https://github.com/bnb-chain/bsc/pull/3457) cmd/geth: stop supporting multidatabase flag
10+
[\#3467](https://github.com/bnb-chain/bsc/pull/3467) go.mod: downgrade bls-eth-go-binary to run on windows
11+
12+
### IMPROVEMENT
13+
[\#3445](https://github.com/bnb-chain/bsc/pull/3445) eth: improve prefetch by using cached reader
14+
[\#3459](https://github.com/bnb-chain/bsc/pull/3459) feat: transactionReceipts auto-unsubscribe implementation
15+
[\#3468](https://github.com/bnb-chain/bsc/pull/3468) metric: add metric for vote count
16+
217
## v1.6.3
318
### FEATURE
419
NA

accounts/keystore/watch.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

1717
//go:build (darwin && !ios && cgo) || freebsd || (linux && !arm64) || netbsd || solaris
18-
// +build darwin,!ios,cgo freebsd linux,!arm64 netbsd solaris
1918

2019
package keystore
2120

accounts/keystore/watch_fallback.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
1616

1717
//go:build (darwin && !cgo) || ios || (linux && arm64) || windows || (!darwin && !freebsd && !linux && !netbsd && !solaris)
18-
// +build darwin,!cgo ios linux,arm64 windows !darwin,!freebsd,!linux,!netbsd,!solaris
1918

2019
// This is the fallback implementation of directory watching.
2120
// It is used on unsupported platforms.

cmd/geth/chaincmd.go

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ var (
7171
utils.OverrideLorentz,
7272
utils.OverrideMaxwell,
7373
utils.OverrideFermi,
74+
utils.OverrideOsaka,
75+
utils.OverrideMendel,
7476
utils.OverrideVerkle,
75-
utils.MultiDataBaseFlag,
77+
// utils.MultiDataBaseFlag,
7678
}, utils.DatabaseFlags),
7779
Description: `
7880
The init command initializes a new genesis block and definition for the network.
@@ -344,6 +346,14 @@ func initGenesis(ctx *cli.Context) error {
344346
v := ctx.Uint64(utils.OverrideFermi.Name)
345347
overrides.OverrideFermi = &v
346348
}
349+
if ctx.IsSet(utils.OverrideOsaka.Name) {
350+
v := ctx.Uint64(utils.OverrideOsaka.Name)
351+
overrides.OverrideOsaka = &v
352+
}
353+
if ctx.IsSet(utils.OverrideMendel.Name) {
354+
v := ctx.Uint64(utils.OverrideMendel.Name)
355+
overrides.OverrideMendel = &v
356+
}
347357
if ctx.IsSet(utils.OverrideVerkle.Name) {
348358
v := ctx.Uint64(utils.OverrideVerkle.Name)
349359
overrides.OverrideVerkle = &v
@@ -446,7 +456,7 @@ func createPorts(ipStr string, port int, size int) []int {
446456
}
447457

448458
// Create config for node i in the cluster
449-
func createNodeConfig(baseConfig gethConfig, ip string, port int, enodes []*enode.Node, index int, staticConnect bool) gethConfig {
459+
func createNodeConfig(baseConfig gethConfig, prefix string, ip string, port int, enodes []*enode.Node, index int) gethConfig {
450460
baseConfig.Node.HTTPHost = ip
451461
baseConfig.Node.P2P.ListenAddr = fmt.Sprintf(":%d", port)
452462
connectEnodes := make([]*enode.Node, 0, len(enodes)-1)
@@ -457,9 +467,10 @@ func createNodeConfig(baseConfig gethConfig, ip string, port int, enodes []*enod
457467
connectEnodes = append(connectEnodes, enodes[j])
458468
}
459469
// Set the P2P connections between this node and the other nodes
460-
if staticConnect {
461-
baseConfig.Node.P2P.StaticNodes = connectEnodes
462-
} else {
470+
baseConfig.Node.P2P.StaticNodes = connectEnodes
471+
if prefix == "fullnode" {
472+
// Fullnodes may reside in different regions than the `enodes`.
473+
// StaticNodes cannot connect to them directly, but can still discover them.
463474
baseConfig.Node.P2P.BootstrapNodes = connectEnodes
464475
}
465476
return baseConfig
@@ -534,7 +545,7 @@ func initNetwork(ctx *cli.Context) error {
534545
connectOneExtraEnodes = true
535546
}
536547

537-
configs, enodes, accounts, err := createConfigs(config, initDir, "node", ips, ports, sentryEnodes, connectOneExtraEnodes, true)
548+
configs, enodes, accounts, err := createConfigs(config, initDir, "node", ips, ports, sentryEnodes, connectOneExtraEnodes)
538549
if err != nil {
539550
utils.Fatalf("Failed to create node configs: %v", err)
540551
}
@@ -615,7 +626,7 @@ func createSentryNodeConfigs(ctx *cli.Context, baseConfig gethConfig, initDir st
615626
if err != nil {
616627
utils.Fatalf("Failed to parse ports: %v", err)
617628
}
618-
configs, enodes, _, err := createConfigs(baseConfig, initDir, "sentry", ips, ports, nil, false, true)
629+
configs, enodes, _, err := createConfigs(baseConfig, initDir, "sentry", ips, ports, nil, false)
619630
if err != nil {
620631
utils.Fatalf("Failed to create config: %v", err)
621632
}
@@ -638,7 +649,7 @@ func createAndSaveFullNodeConfigs(ctx *cli.Context, inGenesisFile *os.File, base
638649
utils.Fatalf("Failed to parse ports: %v", err)
639650
}
640651

641-
configs, enodes, _, err := createConfigs(baseConfig, initDir, "fullnode", ips, ports, extraEnodes, false, false)
652+
configs, enodes, _, err := createConfigs(baseConfig, initDir, "fullnode", ips, ports, extraEnodes, false)
642653
if err != nil {
643654
utils.Fatalf("Failed to create config: %v", err)
644655
}
@@ -653,7 +664,7 @@ func createAndSaveFullNodeConfigs(ctx *cli.Context, inGenesisFile *os.File, base
653664
return configs, enodes, nil
654665
}
655666

656-
func createConfigs(base gethConfig, initDir string, prefix string, ips []string, ports []int, extraEnodes []*enode.Node, connectOneExtraEnodes bool, staticConnect bool) ([]gethConfig, []*enode.Node, [][]common.Address, error) {
667+
func createConfigs(base gethConfig, initDir string, prefix string, ips []string, ports []int, extraEnodes []*enode.Node, connectOneExtraEnodes bool) ([]gethConfig, []*enode.Node, [][]common.Address, error) {
657668
if len(ips) != len(ports) {
658669
return nil, nil, nil, errors.New("mismatch of size and length of ports")
659670
}
@@ -684,7 +695,7 @@ func createConfigs(base gethConfig, initDir string, prefix string, ips []string,
684695
allEnodes = []*enode.Node{enodes[i], extraEnodes[i]}
685696
index = 0
686697
}
687-
configs[i] = createNodeConfig(base, ips[i], ports[i], allEnodes, index, staticConnect)
698+
configs[i] = createNodeConfig(base, prefix, ips[i], ports[i], allEnodes, index)
688699
}
689700
return configs, enodes, accounts, nil
690701
}

cmd/geth/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,14 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
270270
v := ctx.Uint64(utils.OverrideFermi.Name)
271271
cfg.Eth.OverrideFermi = &v
272272
}
273+
if ctx.IsSet(utils.OverrideOsaka.Name) {
274+
v := ctx.Uint64(utils.OverrideOsaka.Name)
275+
cfg.Eth.OverrideOsaka = &v
276+
}
277+
if ctx.IsSet(utils.OverrideMendel.Name) {
278+
v := ctx.Uint64(utils.OverrideMendel.Name)
279+
cfg.Eth.OverrideMendel = &v
280+
}
273281
if ctx.IsSet(utils.OverrideVerkle.Name) {
274282
v := ctx.Uint64(utils.OverrideVerkle.Name)
275283
cfg.Eth.OverrideVerkle = &v

cmd/geth/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ var (
7676
utils.OverrideLorentz,
7777
utils.OverrideMaxwell,
7878
utils.OverrideFermi,
79+
utils.OverrideOsaka,
80+
utils.OverrideMendel,
7981
utils.OverrideVerkle,
8082
utils.OverrideFullImmutabilityThreshold,
8183
utils.OverrideMinBlocksForBlobRequests,
@@ -128,7 +130,7 @@ var (
128130
utils.CacheSnapshotFlag,
129131
// utils.CacheNoPrefetchFlag,
130132
utils.CachePreimagesFlag,
131-
utils.MultiDataBaseFlag,
133+
// utils.MultiDataBaseFlag,
132134
utils.PruneAncientDataFlag, // deprecated
133135
utils.CacheLogSizeFlag,
134136
utils.FDLimitFlag,

cmd/jsutils/getchainstatus.js

Lines changed: 50 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,9 @@ const builderMap = new Map([
266266

267267
// Chapel
268268
["0x627fE6AFA2E84e461CB7AE7C2c46e8adf9a954a2", "txboost"],
269-
["0x5EC60f73f938e36400ec3CC3Ff4d7a7703F7c005", "nodereal ap"],
269+
["0xa5559F1761e6dCa79Ac0c7A301CCDcC71D378fee", "nodereal ap"],
270270
["0x6C98EB21139F6E12db5b78a4AeD4d8eBA147FB7b", "nodereal eu"],
271-
["0x5b67a234592331e85fC57Bb148769c1d2fF62520", "nodereal us"],
271+
["0x4E8cbf5912717B212db5b450ae7737455A5cc0aF", "nodereal us"],
272272
["0x4827b423D03a349b7519Dda537e9A28d31ecBB48", "club48 ap"],
273273
["0x48B2665E5E9a343409199D70F7495c8aB660BB48", "club48 eu"],
274274
["0x48B4bBEbF0655557A461e91B8905b85864B8BB48", "club48 us"],
@@ -315,10 +315,53 @@ async function getBinaryVersion() {
315315
let turnLength = program.turnLength;
316316
for (let i = 0; i < program.num; i++) {
317317
let blockData = await provider.getBlock(blockNum - i * turnLength);
318-
// 1.get Geth client version
319-
let major = ethers.toNumber(ethers.dataSlice(blockData.extraData, 2, 3));
320-
let minor = ethers.toNumber(ethers.dataSlice(blockData.extraData, 3, 4));
321-
let patch = ethers.toNumber(ethers.dataSlice(blockData.extraData, 4, 5));
318+
319+
let major = 0, minor = 0, patch = 0;
320+
let commitID = "";
321+
322+
try {
323+
major = ethers.toNumber(ethers.dataSlice(blockData.extraData, 2, 3));
324+
minor = ethers.toNumber(ethers.dataSlice(blockData.extraData, 3, 4));
325+
patch = ethers.toNumber(ethers.dataSlice(blockData.extraData, 4, 5));
326+
327+
// Check version: >= 1.6.4 uses new format with commitID
328+
const isNewFormat = major > 1 || (major === 1 && minor > 6) || (major === 1 && minor === 6 && patch >= 4);
329+
330+
if (isNewFormat) {
331+
const extraVanity = 28;
332+
let vanityBytes = ethers.getBytes(ethers.dataSlice(blockData.extraData, 0, extraVanity));
333+
334+
let rlpLength = vanityBytes.length;
335+
if (vanityBytes[0] >= 0xC0 && vanityBytes[0] <= 0xF7) {
336+
rlpLength = (vanityBytes[0] - 0xC0) + 1;
337+
}
338+
339+
const rlpData = ethers.dataSlice(blockData.extraData, 0, rlpLength);
340+
const decoded = ethers.decodeRlp(rlpData);
341+
342+
if (Array.isArray(decoded) && decoded.length >= 2) {
343+
const secondElemHex = decoded[1];
344+
let secondElemStr = "";
345+
try {
346+
secondElemStr = ethers.toUtf8String(secondElemHex);
347+
} catch (e) {
348+
secondElemStr = secondElemHex;
349+
}
350+
351+
if (secondElemStr.length > 0 && secondElemStr !== "geth") {
352+
commitID = secondElemStr.startsWith("0x") ? secondElemStr.substring(2) : secondElemStr;
353+
}
354+
}
355+
}
356+
} catch (e) {
357+
console.log("Parsing failed:", e.message);
358+
}
359+
360+
// Format version string
361+
let versionStr = major + "." + minor + "." + patch;
362+
if (commitID && commitID.length > 0) {
363+
versionStr = versionStr + "-" + commitID;
364+
}
322365

323366
// 2.get minimum txGasPrice based on the last non-zero-gasprice transaction
324367
let lastGasPrice = 0;
@@ -332,7 +375,7 @@ async function getBinaryVersion() {
332375
break;
333376
}
334377
var moniker = await getValidatorMoniker(blockData.miner, blockNum);
335-
console.log(blockNum - i * turnLength, blockData.miner, "version =", major + "." + minor + "." + patch, " MinGasPrice = " + lastGasPrice, moniker);
378+
console.log(blockNum - i * turnLength, blockData.miner, "version =", versionStr, " MinGasPrice = " + lastGasPrice, moniker);
336379
}
337380
}
338381

cmd/utils/diskusage.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
// along with go-ethereum. If not, see <http://www.gnu.org/licenses/>.
1616

1717
//go:build !windows && !openbsd && !wasip1
18-
// +build !windows,!openbsd,!wasip1
1918

2019
package utils
2120

0 commit comments

Comments
 (0)