Skip to content

Commit 26b236f

Browse files
authored
Merge pull request #2586 from bnb-chain/master_2_develop
Draft release v1.4.12
2 parents 75d1629 + 900cf26 commit 26b236f

Some content is hidden

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

58 files changed

+911
-1022
lines changed

.nancy-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CVE-2024-34478 # "CWE-754: Improper Check for Unusual or Exceptional Conditions." This vulnerability is BTC only, BSC does not have the issue.
2+
CVE-2024-6104 # "CWE-532: Information Exposure Through Log Files" This is caused by the vulnerabilities [email protected], it is only used in cmd devp2p, impact is limited. will upgrade to v0.7.7 later

CHANGELOG.md

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

3+
## v1.4.12
4+
5+
### BUGFIX
6+
* [\#2557](https://github.com/bnb-chain/bsc/pull/2557) fix: fix state inspect error after pruned state
7+
* [\#2562](https://github.com/bnb-chain/bsc/pull/2562) fix: delete unexpected block
8+
* [\#2566](https://github.com/bnb-chain/bsc/pull/2566) core: avoid to cache block before wroten into db
9+
* [\#2567](https://github.com/bnb-chain/bsc/pull/2567) fix: fix statedb copy
10+
* [\#2574](https://github.com/bnb-chain/bsc/pull/2574) core: adapt highestVerifiedHeader to FastFinality
11+
* [\#2542](https://github.com/bnb-chain/bsc/pull/2542) fix: pruneancient freeze from the previous position when the first time
12+
* [\#2564](https://github.com/bnb-chain/bsc/pull/2564) fix: the bug of blobsidecars and downloader with multi-database
13+
* [\#2582](https://github.com/bnb-chain/bsc/pull/2582) fix: remove delete and dangling side chains in prunefreezer
14+
15+
### FEATURE
16+
* [\#2513](https://github.com/bnb-chain/bsc/pull/2513) cmd/jsutils: add a tool to get performance between a range of blocks
17+
* [\#2569](https://github.com/bnb-chain/bsc/pull/2569) cmd/jsutils: add a tool to get slash count
18+
* [\#2583](https://github.com/bnb-chain/bsc/pull/2583) cmd/jsutill: add log about validator name
19+
20+
### IMPROVEMENT
21+
* [\#2546](https://github.com/bnb-chain/bsc/pull/2546) go.mod: update missing dependency
22+
* [\#2559](https://github.com/bnb-chain/bsc/pull/2559) nancy: ignore [email protected] in .nancy-ignore
23+
* [\#2556](https://github.com/bnb-chain/bsc/pull/2556) chore: update greenfield cometbft version
24+
* [\#2561](https://github.com/bnb-chain/bsc/pull/2561) tests: fix unstable test
25+
* [\#2572](https://github.com/bnb-chain/bsc/pull/2572) core: clearup testflag for Cancun and Haber
26+
* [\#2573](https://github.com/bnb-chain/bsc/pull/2573) cmd/utils: support use NetworkId to distinguish chapel when do syncing
27+
* [\#2538](https://github.com/bnb-chain/bsc/pull/2538) feat: enhance bid comparison and reply bidding results && detail logs
28+
* [\#2568](https://github.com/bnb-chain/bsc/pull/2568) core/vote: not vote if too late for next in turn validator
29+
* [\#2576](https://github.com/bnb-chain/bsc/pull/2576) miner/worker: broadcast block immediately once sealed
30+
* [\#2580](https://github.com/bnb-chain/bsc/pull/2580) freezer: Opt freezer env checking
31+
332
## v1.4.11
433

534
### BUGFIX

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ unzip testnet.zip
149149
#### 3. Download snapshot
150150
Download latest chaindata snapshot from [here](https://github.com/bnb-chain/bsc-snapshots). Follow the guide to structure your files.
151151

152-
Note: If you encounter difficulties downloading the chaindata snapshot and prefer to synchronize from the genesis block on the Chapel testnet, remember to include the additional flag `--chapel` when initially launching Geth.
153-
154152
#### 4. Start a full node
155153
```shell
156154
./geth --config ./config.toml --datadir ./node --cache 8000 --rpc.allow-unprotected-txs --history.transactions 0

cmd/faucet/faucet.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ func (f *faucet) loop() {
642642
f.lock.RUnlock()
643643
}
644644
}()
645-
// Wait for various events and assing to the appropriate background threads
645+
// Wait for various events and assign to the appropriate background threads
646646
for {
647647
select {
648648
case head := <-heads:

cmd/geth/chaincmd.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,9 @@ var (
6262
ArgsUsage: "<genesisPath>",
6363
Flags: flags.Merge([]cli.Flag{
6464
utils.CachePreimagesFlag,
65-
utils.OverrideCancun,
66-
utils.OverrideHaber,
6765
utils.OverrideBohr,
6866
utils.OverrideVerkle,
67+
utils.MultiDataBaseFlag,
6968
}, utils.DatabaseFlags),
7069
Description: `
7170
The init command initializes a new genesis block and definition for the network.
@@ -254,14 +253,6 @@ func initGenesis(ctx *cli.Context) error {
254253
defer stack.Close()
255254

256255
var overrides core.ChainOverrides
257-
if ctx.IsSet(utils.OverrideCancun.Name) {
258-
v := ctx.Uint64(utils.OverrideCancun.Name)
259-
overrides.OverrideCancun = &v
260-
}
261-
if ctx.IsSet(utils.OverrideHaber.Name) {
262-
v := ctx.Uint64(utils.OverrideHaber.Name)
263-
overrides.OverrideHaber = &v
264-
}
265256
if ctx.IsSet(utils.OverrideBohr.Name) {
266257
v := ctx.Uint64(utils.OverrideBohr.Name)
267258
overrides.OverrideBohr = &v
@@ -769,7 +760,7 @@ func parseDumpConfig(ctx *cli.Context, stack *node.Node) (*state.DumpConfig, eth
769760
arg := ctx.Args().First()
770761
if hashish(arg) {
771762
hash := common.HexToHash(arg)
772-
if number := rawdb.ReadHeaderNumber(db.BlockStore(), hash); number != nil {
763+
if number := rawdb.ReadHeaderNumber(db, hash); number != nil {
773764
header = rawdb.ReadHeader(db, hash, *number)
774765
} else {
775766
return nil, nil, common.Hash{}, fmt.Errorf("block %x not found", hash)

cmd/geth/config.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -185,14 +185,6 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
185185
params.RialtoGenesisHash = common.HexToHash(v)
186186
}
187187

188-
if ctx.IsSet(utils.OverrideCancun.Name) {
189-
v := ctx.Uint64(utils.OverrideCancun.Name)
190-
cfg.Eth.OverrideCancun = &v
191-
}
192-
if ctx.IsSet(utils.OverrideHaber.Name) {
193-
v := ctx.Uint64(utils.OverrideHaber.Name)
194-
cfg.Eth.OverrideHaber = &v
195-
}
196188
if ctx.IsSet(utils.OverrideBohr.Name) {
197189
v := ctx.Uint64(utils.OverrideBohr.Name)
198190
cfg.Eth.OverrideBohr = &v

cmd/geth/dbcmd.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -397,8 +397,8 @@ func inspectTrie(ctx *cli.Context) error {
397397
var headerBlockHash common.Hash
398398
if ctx.NArg() >= 1 {
399399
if ctx.Args().Get(0) == "latest" {
400-
headerHash := rawdb.ReadHeadHeaderHash(db.BlockStore())
401-
blockNumber = *(rawdb.ReadHeaderNumber(db.BlockStore(), headerHash))
400+
headerHash := rawdb.ReadHeadHeaderHash(db)
401+
blockNumber = *(rawdb.ReadHeaderNumber(db, headerHash))
402402
} else if ctx.Args().Get(0) == "snapshot" {
403403
trieRootHash = rawdb.ReadSnapshotRoot(db)
404404
blockNumber = math.MaxUint64
@@ -1212,7 +1212,7 @@ func showMetaData(ctx *cli.Context) error {
12121212
if err != nil {
12131213
fmt.Fprintf(os.Stderr, "Error accessing ancients: %v", err)
12141214
}
1215-
data := rawdb.ReadChainMetadataFromMultiDatabase(db)
1215+
data := rawdb.ReadChainMetadata(db)
12161216
data = append(data, []string{"frozen", fmt.Sprintf("%d items", ancients)})
12171217
data = append(data, []string{"snapshotGenerator", snapshot.ParseGeneratorStatus(rawdb.ReadSnapshotGenerator(db))})
12181218
if b := rawdb.ReadHeadBlock(db); b != nil {
@@ -1255,7 +1255,7 @@ func hbss2pbss(ctx *cli.Context) error {
12551255
defer stack.Close()
12561256

12571257
db := utils.MakeChainDatabase(ctx, stack, false, false)
1258-
db.Sync()
1258+
db.BlockStore().Sync()
12591259
stateDiskDb := db.StateStore()
12601260
defer db.Close()
12611261

@@ -1273,8 +1273,8 @@ func hbss2pbss(ctx *cli.Context) error {
12731273
log.Info("hbss2pbss triedb", "scheme", triedb.Scheme())
12741274
defer triedb.Close()
12751275

1276-
headerHash := rawdb.ReadHeadHeaderHash(db.BlockStore())
1277-
blockNumber := rawdb.ReadHeaderNumber(db.BlockStore(), headerHash)
1276+
headerHash := rawdb.ReadHeadHeaderHash(db)
1277+
blockNumber := rawdb.ReadHeaderNumber(db, headerHash)
12781278
if blockNumber == nil {
12791279
log.Error("read header number failed.")
12801280
return fmt.Errorf("read header number failed")

cmd/geth/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ var (
7272
utils.USBFlag,
7373
utils.SmartCardDaemonPathFlag,
7474
utils.RialtoHash,
75-
utils.OverrideCancun,
76-
utils.OverrideHaber,
7775
utils.OverrideBohr,
7876
utils.OverrideVerkle,
7977
utils.OverrideFullImmutabilityThreshold,
@@ -127,6 +125,7 @@ var (
127125
utils.CacheSnapshotFlag,
128126
// utils.CacheNoPrefetchFlag,
129127
utils.CachePreimagesFlag,
128+
utils.MultiDataBaseFlag,
130129
utils.PersistDiffFlag,
131130
utils.DiffBlockFlag,
132131
utils.PruneAncientDataFlag,
@@ -336,9 +335,6 @@ func prepare(ctx *cli.Context) {
336335
5. Networking is disabled; there is no listen-address, the maximum number of peers is set
337336
to 0, and discovery is disabled.
338337
`)
339-
340-
case !ctx.IsSet(utils.NetworkIdFlag.Name):
341-
log.Info("Starting Geth on BSC mainnet...")
342338
}
343339
// If we're a full node on mainnet without --cache specified, bump default cache allowance
344340
if !ctx.IsSet(utils.CacheFlag.Name) && !ctx.IsSet(utils.NetworkIdFlag.Name) {

cmd/geth/pruneblock_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ func BlockchainCreator(t *testing.T, chaindbPath, AncientPath string, blockRemai
155155
triedb := triedb.NewDatabase(db, nil)
156156
defer triedb.Close()
157157

158+
if err = db.SetupFreezerEnv(&ethdb.FreezerEnv{
159+
ChainCfg: gspec.Config,
160+
BlobExtraReserve: params.DefaultExtraReserveForBlobRequests,
161+
}); err != nil {
162+
t.Fatalf("Failed to create chain: %v", err)
163+
}
158164
genesis := gspec.MustCommit(db, triedb)
159165
// Initialize a fresh chain with only a genesis block
160166
blockchain, err := core.NewBlockChain(db, config, gspec, nil, engine, vm.Config{}, nil, nil)

cmd/jsutils/README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,24 @@ testnet validators version
2424
### 2.Get Transaction Count
2525
```bash
2626
node gettxcount.js --rpc ${url} --startNum ${start} --endNum ${end} --miner ${miner} (optional)
27-
```
27+
```
28+
29+
### 3. Get Performance
30+
```bash
31+
node get_perf.js --rpc ${url} --startNum ${start} --endNum ${end}
32+
```
33+
output as following
34+
```bash
35+
Get the performance between [ 19470 , 19670 )
36+
txCountPerBlock = 3142.81 txCountTotal = 628562 BlockCount = 200 avgBlockTime = 3.005 inturnBlocksRatio = 0.975
37+
txCountPerSecond = 1045.8602329450914 avgGasUsedPerBlock = 250.02062627 avgGasUsedPerSecond = 83.20153952412646
38+
```
39+
40+
### 4. Get validators slash count
41+
```bash
42+
use the latest block
43+
node getslashcount.js --Rpc ${ArchiveRpc}
44+
use a block number
45+
node getslashcount.js --Rpc ${ArchiveRpc} --Num ${blockNum}
46+
```
47+

0 commit comments

Comments
 (0)