From c3ad9211a15a21f5f3c076df1e797118cc75a037 Mon Sep 17 00:00:00 2001 From: zzzckck <152148891+zzzckck@users.noreply.github.com> Date: Mon, 29 Apr 2024 10:11:49 +0800 Subject: [PATCH 1/3] metrics: refine the double sign detect code --- consensus/parlia/parlia.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index d015a7970d..69b82d408c 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -50,7 +50,7 @@ import ( const ( inMemorySnapshots = 256 // Number of recent snapshots to keep in memory inMemorySignatures = 4096 // Number of recent block signatures to keep in memory - inMemoryHeaders = 86400 // Number of recent headers to keep in memory for double sign detection + inMemoryHeaders = 86400 // Number of recent headers to keep in memory for double sign detection, checkpointInterval = 1024 // Number of blocks after which to save the snapshot to the database defaultEpochLength = uint64(100) // Default number of blocks of checkpoint to update validatorSet from contract @@ -819,18 +819,19 @@ func (p *Parlia) verifySeal(chain consensus.ChainHeaderReader, header *types.Hea return errCoinBaseMisMatch } - if _, ok := snap.Validators[signer]; !ok { - return errUnauthorizedValidator(signer.String()) - } - // check for double sign & add to cache key := proposalKey(*header) - - value, ok := p.recentHeaders.Get(key) - if ok { + preHash, ok := p.recentHeaders.Get(key) + if ok && preHash != header.Hash() { doubleSignCounter.Inc(1) + log.Warn("DoubleSign detected", " block", header.Number, " miner", header.Coinbase, + "hash1", preHash.(common.Hash), "hash2", header.Hash()) } else { - p.recentHeaders.Add(key, value) + p.recentHeaders.Add(key, header.Hash()) + } + + if _, ok := snap.Validators[signer]; !ok { + return errUnauthorizedValidator(signer.String()) } if snap.SignRecently(signer) { From 46bde63c62bbb1b550e9e248a7587a73aa6b81df Mon Sep 17 00:00:00 2001 From: zzzckck <152148891+zzzckck@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:30:51 +0800 Subject: [PATCH 2/3] Revert "github: add branch protect rule (#2343)" This reverts commit e7c5ce2e94578b480fe6eaa6b35a8dad66341637. --- .github/CODEOWNERS | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b78b3ce988..d1afe2413e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,21 @@ # Lines starting with '#' are comments. # Each line is a file pattern followed by one or more owners. -* @zzzckck @zjubfd +accounts/usbwallet @karalabe +accounts/scwallet @gballet +accounts/abi @gballet @MariusVanDerWijden +cmd/clef @holiman +consensus @karalabe +core/ @karalabe @holiman @rjl493456442 +eth/ @karalabe @holiman @rjl493456442 +eth/catalyst/ @gballet +eth/tracers/ @s1na +graphql/ @s1na +les/ @zsfelfoldi @rjl493456442 +light/ @zsfelfoldi @rjl493456442 +node/ @fjl +p2p/ @fjl @zsfelfoldi +rpc/ @fjl @holiman +p2p/simulations @fjl +p2p/protocols @fjl +p2p/testing @fjl +signer/ @holiman From d1a91871a000cb879c84174a30e9f43da5c7b5eb Mon Sep 17 00:00:00 2001 From: zzzckck <152148891+zzzckck@users.noreply.github.com> Date: Fri, 26 Apr 2024 14:31:45 +0800 Subject: [PATCH 3/3] release: prepare for release v1.4.6 --- CHANGELOG.md | 30 ++++++++++++++++++++++++++++++ params/version.go | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9027e2278..b17a062f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,34 @@ # Changelog +## v1.4.6 +### FEATURE +* [\#2227](https://github.com/bnb-chain/bsc/pull/2227) core: separated databases for block data +* [\#2404](https://github.com/bnb-chain/bsc/pull/2404) cmd, p2p: filter peers by regex on name + +### IMPROVEMENT +* [\#2201](https://github.com/bnb-chain/bsc/pull/2201) chore: render system bytecode by go:embed +* [\#2363](https://github.com/bnb-chain/bsc/pull/2363) feat: greedy merge tx in bid +* [\#2389](https://github.com/bnb-chain/bsc/pull/2389) deps: update prsym to solve warning about quic-go version +* [\#2341](https://github.com/bnb-chain/bsc/pull/2341) core/trie: persist TrieJournal to journal file instead of kv database +* [\#2395](https://github.com/bnb-chain/bsc/pull/2395) fix: trieJournal format compatible old db format +* [\#2406](https://github.com/bnb-chain/bsc/pull/2406) feat: adaptive for loading journal file or journal kv during loadJournal +* [\#2390](https://github.com/bnb-chain/bsc/pull/2390) chore: fix function names in comment +* [\#2399](https://github.com/bnb-chain/bsc/pull/2399) chore: fix some typos in comments +* [\#2408](https://github.com/bnb-chain/bsc/pull/2408) chore: fix some typos in comments +* [\#2416](https://github.com/bnb-chain/bsc/pull/2416) fix: fix function names +* [\#2424](https://github.com/bnb-chain/bsc/pull/2424) feat: recommit bid when newBidCh is empty to maximize mev reward +* [\#2430](https://github.com/bnb-chain/bsc/pull/2430) fix: oom caused by non-discarded mev simulation env +* [\#2428](https://github.com/bnb-chain/bsc/pull/2428) chore: add metric & log for blobTx +* [\#2419](https://github.com/bnb-chain/bsc/pull/2419) metrics: add doublesign counter + +### BUGFIX +* [\#2244](https://github.com/bnb-chain/bsc/pull/2244) cmd/geth: fix importBlock +* [\#2391](https://github.com/bnb-chain/bsc/pull/2391) fix: print value instead of pointer in ConfigCompatError +* [\#2398](https://github.com/bnb-chain/bsc/pull/2398) fix: no import blocks before or equal to the finalized height +* [\#2401](https://github.com/bnb-chain/bsc/pull/2401) fix: allow fast node to rewind after abnormal shutdown +* [\#2403](https://github.com/bnb-chain/bsc/pull/2403) fix: NPE +* [\#2423](https://github.com/bnb-chain/bsc/pull/2423) eth/gasprice: add query limit to defend DDOS attack +* [\#2425](https://github.com/bnb-chain/bsc/pull/2425) fix: adapt journal for cmd + ## v1.4.5 ### FEATURE * [\#2378](https://github.com/bnb-chain/bsc/pull/2378) config: setup Testnet Tycho(Cancun) hardfork date diff --git a/params/version.go b/params/version.go index b2c053da3a..c2a2aedbcd 100644 --- a/params/version.go +++ b/params/version.go @@ -23,7 +23,7 @@ import ( const ( VersionMajor = 1 // Major version component of the current release VersionMinor = 4 // Minor version component of the current release - VersionPatch = 5 // Patch version component of the current release + VersionPatch = 6 // Patch version component of the current release VersionMeta = "" // Version metadata to append to the version string )