Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
9a73806
freezer: add debug log for out of bounds access (#3354)
zzzckck Sep 12, 2025
46e8dc9
core/rawdb: align more code with upstream (#3348)
allformless Sep 12, 2025
e61cfaf
log: lower the spam log level (#3357)
zzzckck Sep 12, 2025
391e8f4
release: prepare for release v1.6.1-beta (#3355)
zzzckck Sep 15, 2025
d4567d1
log: downgrade log level when header fetch failed (#3359)
zzzckck Sep 17, 2025
e414b34
chore: fix SnapSyncWithBlobs UT issues; (#3362)
galaio Sep 22, 2025
b448f7f
cmd/utils: set journalfile default to true (#3361)
allformless Sep 22, 2025
c14f2eb
feature: implement BAL
zzzckck Jul 3, 2025
5dd7dac
bal: add BAL test id
zzzckck Jul 29, 2025
f75738c
bal: add BSC v3 to handle BAL
zzzckck Aug 5, 2025
96a02d7
bal: noPrefetch when BAL is true and log
zzzckck Aug 5, 2025
04c3f04
bal: no bal update during import phase
zzzckck Aug 5, 2025
c85455e
BAL: update after rebase to v1.6.0-alpha
zzzckck Sep 1, 2025
77e89dd
bal: add option EnableBAL
zzzckck Sep 2, 2025
4019cc7
bal: remove BALTestID, replaced by EnableBAL
zzzckck Sep 2, 2025
dfbfcc0
BAL: some non-critical changes
zzzckck Sep 2, 2025
275ea2b
BAL: add WriteBAL
zzzckck Sep 2, 2025
f92be7d
BAL: some update
zzzckck Sep 3, 2025
169da06
bal: remove full node imported test
zzzckck Sep 4, 2025
fca1392
BAL: update
zzzckck Sep 4, 2025
6175cda
BAL: some fix
zzzckck Sep 4, 2025
866810d
BAL: update
zzzckck Sep 8, 2025
c664c92
BAL: update
zzzckck Sep 8, 2025
92f7dd6
BAL: add size and version check
zzzckck Sep 8, 2025
2ac6ab3
BAL: add some UT
zzzckck Sep 8, 2025
825adca
BAL: bal prefetch to 8
zzzckck Sep 11, 2025
634a711
BAL: concurrent trie prefetch
zzzckck Sep 11, 2025
7eab8c8
fix: BAL transfer to avoid map concurrency issue
zzzckck Sep 11, 2025
8bed672
bal: add block number,hash into encode bal
zzzckck Sep 12, 2025
739797d
BAL: fix hash mismatch
zzzckck Sep 15, 2025
e2644dd
version: pump version for BAL feature release
zzzckck Sep 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
# Changelog
## v1.6.1
v1.6.1-alpha is a preview release, which fixes several issues of the v1.6.0-alpha, it is more reliable than v1.6.0-alpha, so mark it as beta stage.

### FEATURE
NA

### BUGFIX
[\#3336](https://github.com/bnb-chain/bsc/pull/3336) miner: avoid to commit a bid twice
[\#3347](https://github.com/bnb-chain/bsc/pull/3347) fix: discovery AyncFilter deadlock on shutdown
[\#3340](https://github.com/bnb-chain/bsc/pull/3340) core: rework fast node

### IMPROVEMENT
[\#3337](https://github.com/bnb-chain/bsc/pull/3337) eth/pebble: use NoSync as write mode
[\#3332](https://github.com/bnb-chain/bsc/pull/3332) FilterMap: update bsc checkpoint file
[\#3324](https://github.com/bnb-chain/bsc/pull/3324) eth/downloader: remove InsertHeaderChain to improve sync speed
[\#3319](https://github.com/bnb-chain/bsc/pull/3319) core/rawdb: remove func AncientOffSet and ItemAmountInAncient
[\#3346](https://github.com/bnb-chain/bsc/pull/3346) cmd/geth: remove subcmd hbss2pbss and insecure-prune-all
[\#3354](https://github.com/bnb-chain/bsc/pull/3354) freezer: add debug log for out of bounds access

## v1.6.0
v1.6.0-alpha is a preview release for upstream code sync, it catches up with [go-ethereum release [v1.16.1]](https://github.com/ethereum/go-ethereum/releases/tag/v1.16.1) and also inlcude several bug fix.

Expand Down
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ var (
utils.MinerRecommitIntervalFlag,
utils.MinerNewPayloadTimeoutFlag, // deprecated
utils.MinerDelayLeftoverFlag,
utils.EnableBALFlag,
// utils.MinerNewPayloadTimeout,
utils.NATFlag,
utils.NoDiscoverFlag,
Expand Down
2 changes: 2 additions & 0 deletions cmd/jsutils/getchainstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ const validatorMap = new Map([
['0x18c44f4FBEde9826C7f257d500A65a3D5A8edebc', [ 'Nozti' , '0x95E105468b3a9E158df258ee385CA873cB566bF2', '0xa76a951b947eda0b4585730049bf08338c0e679071127f0f2f7e7dce542a655d69b24e7af4586ed20efc2764044c0b3c']],
['0xEdB69D7AE8fE7c21a33e0491e76db241C8e09a5F', ['BlkRazor' , '0x5eBAf404d466a1cc2d02684B6A3bB1D43dCB7586', '0xb23e281776590409333b1b36019390f7fadce505f55bfb98969cd3df6660bfe873b73e73d28aeef04bac40e3f4520df1']],
['0xd6Ab358AD430F65EB4Aa5a1598FF2c34489dcfdE', [ 'Saturn' , '0x54A9c15A143dBFf49539dfF4e095ec8D09464A4A', '0x835a7608cb0888fa649aa4120e81b1ab8c54c894e01b3b1d8c458563bec901ba6bb0c5f356dca5b962392872480f3b4c']],
['0xCc767841fbB5b79B91EdF7a19EC5bd2F3D334fD8', [ 'Kraken' , '0x4279baBE4293c0826810b6C59e40F9DA9e5fd45b', '0xaa7a4c76d38b9fe7f872bbc53ac172faa56c7db2ad4b4aea3af41de2c2df7738e82827f501f206ea82ad050b4ffead8a']],
// Testnet: Chapel
['0x08265dA01E1A65d62b903c7B34c08cB389bF3D99', [ 'Ararat' , '0x341e228f22D4ec16297DD05A9d6347C74c125F66', '0x96f763f030b1adcfb369c5a5df4a18e1529baffe7feaec66db3dbd1bc06810f7f6f88b7be6645418a7e2a2a3f40514c2']],
['0x7f5f2cF1aec83bF0c74DF566a41aa7ed65EA84Ea', [ 'Kita' , '0x2716756EAF7F1B4f4DbB282A80efdbf96e90A644', '0x99e3849ef31887c0f880a0feb92f356f58fbd023a82f5311fc87a5883a662e9ebbbefc90bf13aa533c2438a4113804bf']],
Expand Down Expand Up @@ -207,6 +208,7 @@ const validatorMap = new Map([
['0x6a5470a3B7959ab064d6815e349eD4aE2dE5210d', ['Skynet10k' , '0xDD1fD7C74BaCCA08e1b88a24199F19aB1b1b9cE4', '0x81f13afdbd6976d9784a05619405df430314e2707050b32f29ae683b9ef89d285d1a227df3e31ac147016c4c7533be70']],
['0xce6cCa0DE7b3EB3fd0CcE4bc38cceF473166e4f4', ['Infinity' , '0xc8A6Bfe0834FB99340a0Df253d79B7CaE25053b8', '0xa40f553889e9de6b4fe8005a06d7335fa061ae51ef5ba2b0c4ea477fcaa8f6de1650e318cf59824462b1831a725488da']],
['0xa7deE0bCAEb78849Ec4aD4e2f48688D2e9f2315B', ['KrakV' , '0x6563AA29C30d9f80968c2fb7DFFed092a03FBdeD', '0x848ffc9a3fac00d9fbaebcb63f2b7c0a4747d9ffecd4b484073ad03d91584cb51af29870c1c8421b757f4f6fae813288']],
['0x32415e630B9B3489639dEE7de21274Ab64016226', ['Kraken' , '0x70Cd30d9216AF7A5654D245e9F5c649b811aB2eB', '0xa80ebd07bd9d717bd538413e8830f673e63dfad496c901de324be5d16b0496aee39352ecfb84fa58d8d8a67746f8ae6c']],
]);

const builderMap = new Map([
Expand Down
21 changes: 16 additions & 5 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,11 @@ var (
Usage: "Chapel network: pre-configured Proof-of-Stake-Authority BSC test network",
Category: flags.EthCategory,
}
EnableBALFlag = &cli.BoolFlag{
Name: "enablebal",
Usage: "Enable block access list feature, validator will generate BAL for each block",
Category: flags.EthCategory,
}
// Dev mode
DeveloperFlag = &cli.BoolFlag{
Name: "dev",
Expand Down Expand Up @@ -369,8 +374,8 @@ var (
}
JournalFileFlag = &cli.BoolFlag{
Name: "journalfile",
Usage: "Enable using journal file to store the TrieJournal instead of KVDB in pbss (default = false)",
Value: false,
Usage: "Enable using journal file to store the TrieJournal instead of KVDB in pbss (default = true)",
Value: true,
Category: flags.StateCategory,
}
StateHistoryFlag = &cli.Uint64Flag{
Expand Down Expand Up @@ -1743,6 +1748,9 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
if ctx.IsSet(DisableSnapProtocolFlag.Name) {
cfg.DisableSnapProtocol = ctx.Bool(DisableSnapProtocolFlag.Name)
}
if ctx.IsSet(EnableBALFlag.Name) {
cfg.EnableBAL = ctx.Bool(EnableBALFlag.Name)
}
if ctx.IsSet(RangeLimitFlag.Name) {
cfg.RangeLimit = ctx.Bool(RangeLimitFlag.Name)
}
Expand Down Expand Up @@ -2042,6 +2050,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(CacheNoPrefetchFlag.Name) {
cfg.NoPrefetch = ctx.Bool(CacheNoPrefetchFlag.Name)
}
if ctx.IsSet(EnableBALFlag.Name) {
cfg.EnableBAL = ctx.Bool(EnableBALFlag.Name)
}
// Read the value from the flag no matter if it's set or not.
cfg.Preimages = ctx.Bool(CachePreimagesFlag.Name)
if cfg.NoPruning && !cfg.Preimages {
Expand Down Expand Up @@ -2078,9 +2089,8 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if ctx.IsSet(PathDBSyncFlag.Name) {
cfg.PathSyncFlush = true
}
if ctx.IsSet(JournalFileFlag.Name) {
cfg.JournalFileEnabled = true
}

cfg.JournalFileEnabled = ctx.Bool(JournalFileFlag.Name)

if ctx.String(GCModeFlag.Name) == "archive" {
if cfg.TransactionHistory != 0 {
Expand Down Expand Up @@ -2698,6 +2708,7 @@ func MakeChain(ctx *cli.Context, stack *node.Node, readonly bool) (*core.BlockCh
options := &core.BlockChainConfig{
TrieCleanLimit: ethconfig.Defaults.TrieCleanCache,
NoPrefetch: ctx.Bool(CacheNoPrefetchFlag.Name),
EnableBAL: ctx.Bool(EnableBALFlag.Name),
TrieDirtyLimit: ethconfig.Defaults.TrieDirtyCache,
ArchiveMode: ctx.String(GCModeFlag.Name) == "archive",
TrieTimeLimit: ethconfig.Defaults.TrieTimeout,
Expand Down
9 changes: 9 additions & 0 deletions consensus/beacon/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@ func (beacon *Beacon) SealHash(header *types.Header) common.Hash {
return beacon.ethone.SealHash(header)
}

func (beacon *Beacon) SignBAL(blockAccessList *types.BlockAccessListEncode) error {
return nil
}

// VerifyBAL verifies the BAL of the block
func (beacon *Beacon) VerifyBAL(block *types.Block, bal *types.BlockAccessListEncode) error {
return nil
}

// CalcDifficulty is the difficulty adjustment algorithm. It returns
// the difficulty that a new block should have when created at time
// given the parent block's time and difficulty.
Expand Down
8 changes: 8 additions & 0 deletions consensus/clique/clique.go
Original file line number Diff line number Diff line change
Expand Up @@ -787,3 +787,11 @@ func encodeSigHeader(w io.Writer, header *types.Header) {
panic("can't encode: " + err.Error())
}
}

func (c *Clique) SignBAL(bal *types.BlockAccessListEncode) error {
return nil
}

func (c *Clique) VerifyBAL(block *types.Block, bal *types.BlockAccessListEncode) error {
return nil
}
6 changes: 6 additions & 0 deletions consensus/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ type Engine interface {
// SealHash returns the hash of a block prior to it being sealed.
SealHash(header *types.Header) common.Hash

// SignBAL signs the BAL of the block
SignBAL(blockAccessList *types.BlockAccessListEncode) error

// VerifyBAL verifies the BAL of the block
VerifyBAL(block *types.Block, bal *types.BlockAccessListEncode) error

// CalcDifficulty is the difficulty adjustment algorithm. It returns the difficulty
// that a new block should have.
CalcDifficulty(chain ChainHeaderReader, time uint64, parent *types.Header) *big.Int
Expand Down
8 changes: 8 additions & 0 deletions consensus/ethash/ethash.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,11 @@ func (ethash *Ethash) Close() error {
func (ethash *Ethash) Seal(chain consensus.ChainHeaderReader, block *types.Block, results chan<- *types.Block, stop <-chan struct{}) error {
panic("ethash (pow) sealing not supported any more")
}

func (ethash *Ethash) SignBAL(bal *types.BlockAccessListEncode) error {
return nil
}

func (ethash *Ethash) VerifyBAL(block *types.Block, bal *types.BlockAccessListEncode) error {
return nil
}
65 changes: 65 additions & 0 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -1755,6 +1755,71 @@ func (p *Parlia) Seal(chain consensus.ChainHeaderReader, block *types.Block, res
return nil
}

func (p *Parlia) SignBAL(blockAccessList *types.BlockAccessListEncode) error {
p.lock.RLock()
val, signFn := p.val, p.signFn
p.lock.RUnlock()

data, err := rlp.EncodeToBytes([]interface{}{blockAccessList.Version, blockAccessList.Number, blockAccessList.Hash, blockAccessList.Accounts})
if err != nil {
log.Error("Encode to bytes failed when sealing", "err", err)
return errors.New("encode to bytes failed")
}

if len(data) > int(params.MaxBALSize) {
log.Error("data is too large", "dataSize", len(data), "maxSize", params.MaxBALSize)
return errors.New("data is too large")
}

sig, err := signFn(accounts.Account{Address: val}, accounts.MimetypeParlia, data)
if err != nil {
log.Error("Sign for the block header failed when sealing", "err", err)
return errors.New("sign for the block header failed")
}

copy(blockAccessList.SignData, sig)
return nil
}

func (p *Parlia) VerifyBAL(block *types.Block, bal *types.BlockAccessListEncode) error {
if bal.Version != 0 {
log.Error("invalid BAL version", "version", bal.Version)
return errors.New("invalid BAL version")
}

if len(bal.SignData) != 65 {
log.Error("invalid BAL signature", "signatureSize", len(bal.SignData))
return errors.New("invalid BAL signature")
}

// Recover the public key and the Ethereum address
data, err := rlp.EncodeToBytes([]interface{}{bal.Version, block.Number(), block.Hash(), bal.Accounts})
if err != nil {
log.Error("encode to bytes failed", "err", err)
return errors.New("encode to bytes failed")
}

if len(data) > int(params.MaxBALSize) {
log.Error("data is too large", "dataSize", len(data), "maxSize", params.MaxBALSize)
return errors.New("data is too large")
}

pubkey, err := crypto.Ecrecover(crypto.Keccak256(data), bal.SignData)
if err != nil {
return err
}
var pubkeyAddr common.Address
copy(pubkeyAddr[:], crypto.Keccak256(pubkey[1:])[12:])

signer := block.Header().Coinbase
if signer != pubkeyAddr {
log.Error("BAL signer mismatch", "signer", signer, "pubkeyAddr", pubkeyAddr, "bal.Number", bal.Number, "bal.Hash", bal.Hash)
return errors.New("signer mismatch")
}

return nil
}

func (p *Parlia) shouldWaitForCurrentBlockProcess(chain consensus.ChainHeaderReader, header *types.Header, snap *Snapshot) bool {
if header.Difficulty.Cmp(diffInTurn) == 0 {
return false
Expand Down
Loading