Merge pull request #2033 from bnb-chain/develop_lock_v1.3.4_merge

merge v1.3.4 into develop branch
This commit is contained in:
zzzckck 2023-12-05 12:04:39 +08:00 committed by GitHub
commit 7e6b43a5c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 13 deletions

@ -1,4 +1,9 @@
# Changelog
## v1.3.4
BUGFIX
* fix: remove pipecommit in miner
* add a hard fork: Hertzfix
## v1.3.3
IMPROVEMENT
* [\#2000](https://github.com/bnb-chain/bsc/pull/2000) cmd/utils: exit process if txlookuplimit flag is set
@ -8,7 +13,7 @@ BUGFIX
## v1.3.2
BUGFIX
fix: remove sharedPool
* fix: remove sharedPool
## v1.3.1
FEATURE

@ -1919,7 +1919,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
cfg.EnableTrustProtocol = ctx.IsSet(EnableTrustProtocolFlag.Name)
}
if ctx.IsSet(PipeCommitFlag.Name) {
cfg.PipeCommit = ctx.Bool(PipeCommitFlag.Name)
log.Warn("The --pipecommit flag is deprecated and could be removed in the future!")
}
if ctx.IsSet(RangeLimitFlag.Name) {
cfg.RangeLimit = ctx.Bool(RangeLimitFlag.Name)

@ -19,6 +19,7 @@ func preHertzConfig() *params.ChainConfig {
config.LondonBlock = nil
config.BerlinBlock = nil
config.HertzBlock = nil
config.HertzfixBlock = nil
return &config
}

@ -59,7 +59,7 @@ func (p *statePrefetcher) Prefetch(block *types.Block, statedb *state.StateDB, c
for i := 0; i < prefetchThread; i++ {
go func() {
newStatedb := statedb.CopyDoPrefetch()
if header.Number.Uint64() < 33968300 {
if !p.config.IsHertzfix(header.Number) {
newStatedb.EnableWriteOnSharedStorage()
}
gaspool := new(GasPool).AddGas(block.GasLimit())
@ -108,7 +108,7 @@ func (p *statePrefetcher) PrefetchMining(txs TransactionsByPriceAndNonce, header
go func(startCh <-chan *types.Transaction, stopCh <-chan struct{}) {
idx := 0
newStatedb := statedb.CopyDoPrefetch()
if header.Number.Uint64() < 33968300 {
if !p.config.IsHertzfix(header.Number) {
newStatedb.EnableWriteOnSharedStorage()
}
gaspool := new(GasPool).AddGas(gasLimit)

@ -146,6 +146,7 @@ func newTestBackend(t *testing.T, londonBlock *big.Int, pending bool) *testBacke
config.LubanBlock = nil
config.PlatoBlock = nil
config.HertzBlock = nil
config.HertzfixBlock = nil
config.TerminalTotalDifficulty = common.Big0
engine := ethash.NewFaker()

@ -1163,12 +1163,14 @@ func (w *worker) commit(env *environment, interval func(), update bool, start ti
if interval != nil {
interval()
}
/*
err := env.state.WaitPipeVerification()
if err != nil {
return err
}
env.state.CorrectAccountsRoot(w.chain.CurrentBlock().Root)
err := env.state.WaitPipeVerification()
if err != nil {
return err
}
env.state.CorrectAccountsRoot(w.chain.CurrentBlock().Root)
*/
// Withdrawals are set to nil here, because this is only called in PoW.
finalizeStart := time.Now()

@ -164,6 +164,7 @@ var (
BerlinBlock: big.NewInt(31302048),
LondonBlock: big.NewInt(31302048),
HertzBlock: big.NewInt(31302048),
HertzfixBlock: big.NewInt(34140700),
Parlia: &ParliaConfig{
Period: 3,
@ -196,6 +197,7 @@ var (
BerlinBlock: big.NewInt(31103030),
LondonBlock: big.NewInt(31103030),
HertzBlock: big.NewInt(31103030),
HertzfixBlock: big.NewInt(35682300),
Parlia: &ParliaConfig{
Period: 3,
@ -227,6 +229,7 @@ var (
PlatoBlock: nil,
BerlinBlock: nil,
HertzBlock: nil,
HertzfixBlock: nil,
Parlia: &ParliaConfig{
Period: 3,
@ -259,7 +262,7 @@ var (
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
HertzBlock: big.NewInt(0),
HertzfixBlock: big.NewInt(0),
Parlia: &ParliaConfig{
Period: 3,
Epoch: 200,
@ -474,7 +477,7 @@ type ChainConfig struct {
LubanBlock *big.Int `json:"lubanBlock,omitempty" toml:",omitempty"` // lubanBlock switch block (nil = no fork, 0 = already activated)
PlatoBlock *big.Int `json:"platoBlock,omitempty" toml:",omitempty"` // platoBlock switch block (nil = no fork, 0 = already activated)
HertzBlock *big.Int `json:"hertzBlock,omitempty" toml:",omitempty"` // hertzBlock switch block (nil = no fork, 0 = already activated)
HertzfixBlock *big.Int `json:"hertzfixBlock,omitempty" toml:",omitempty"` // hertzfixBlock switch block (nil = no fork, 0 = already activated)
// Various consensus engines
Ethash *EthashConfig `json:"ethash,omitempty" toml:",omitempty"`
Clique *CliqueConfig `json:"clique,omitempty" toml:",omitempty"`
@ -541,7 +544,7 @@ func (c *ChainConfig) String() string {
KeplerTime = big.NewInt(0).SetUint64(*c.KeplerTime)
}
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, ShanghaiTime: %v, KeplerTime: %v, Engine: %v}",
return fmt.Sprintf("{ChainID: %v Homestead: %v DAO: %v DAOSupport: %v EIP150: %v EIP155: %v EIP158: %v Byzantium: %v Constantinople: %v Petersburg: %v Istanbul: %v, Muir Glacier: %v, Ramanujan: %v, Niels: %v, MirrorSync: %v, Bruno: %v, Berlin: %v, YOLO v3: %v, CatalystBlock: %v, London: %v, ArrowGlacier: %v, MergeFork:%v, Euler: %v, Gibbs: %v, Nano: %v, Moran: %v, Planck: %v,Luban: %v, Plato: %v, Hertz: %v, Hertzfix: %v, ShanghaiTime: %v, KeplerTime: %v, Engine: %v}",
c.ChainID,
c.HomesteadBlock,
c.DAOForkBlock,
@ -572,6 +575,7 @@ func (c *ChainConfig) String() string {
c.LubanBlock,
c.PlatoBlock,
c.HertzBlock,
c.HertzfixBlock,
ShanghaiTime,
KeplerTime,
engine,
@ -693,6 +697,14 @@ func (c *ChainConfig) IsOnHertz(num *big.Int) bool {
return configBlockEqual(c.HertzBlock, num)
}
func (c *ChainConfig) IsHertzfix(num *big.Int) bool {
return isBlockForked(c.HertzfixBlock, num)
}
func (c *ChainConfig) IsOnHertzfix(num *big.Int) bool {
return configBlockEqual(c.HertzfixBlock, num)
}
// IsMuirGlacier returns whether num is either equal to the Muir Glacier (EIP-2384) fork block or greater.
func (c *ChainConfig) IsMuirGlacier(num *big.Int) bool {
return isBlockForked(c.MuirGlacierBlock, num)
@ -854,6 +866,7 @@ func (c *ChainConfig) CheckConfigForkOrder() error {
{name: "lubanBlock", block: c.LubanBlock},
{name: "platoBlock", block: c.PlatoBlock},
{name: "hertzBlock", block: c.HertzBlock},
{name: "hertzfixBlock", block: c.HertzfixBlock},
{name: "shanghaiTime", timestamp: c.ShanghaiTime},
{name: "cancunTime", timestamp: c.CancunTime, optional: true},
{name: "pragueTime", timestamp: c.PragueTime, optional: true},
@ -985,6 +998,9 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkBlockIncompatible(c.HertzBlock, newcfg.HertzBlock, headNumber) {
return newBlockCompatError("hertz fork block", c.HertzBlock, newcfg.HertzBlock)
}
if isForkBlockIncompatible(c.HertzfixBlock, newcfg.HertzfixBlock, headNumber) {
return newBlockCompatError("hertzfix fork block", c.HertzfixBlock, newcfg.HertzfixBlock)
}
if isForkTimestampIncompatible(c.ShanghaiTime, newcfg.ShanghaiTime, headTimestamp) {
return newTimestampCompatError("Shanghai fork timestamp", c.ShanghaiTime, newcfg.ShanghaiTime)
}
@ -1151,6 +1167,7 @@ type Rules struct {
IsLuban bool
IsPlato bool
IsHertz bool
IsHertzfix bool
IsShanghai, IsKepler, IsCancun, IsPrague bool
IsVerkle bool
}
@ -1180,6 +1197,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
IsLuban: c.IsLuban(num),
IsPlato: c.IsPlato(num),
IsHertz: c.IsHertz(num),
IsHertzfix: c.IsHertzfix(num),
IsShanghai: c.IsShanghai(num, timestamp),
IsKepler: c.IsKepler(num, timestamp),
IsCancun: c.IsCancun(num, timestamp),

@ -23,7 +23,7 @@ import (
const (
VersionMajor = 1 // Major version component of the current release
VersionMinor = 3 // Minor version component of the current release
VersionPatch = 3 // Patch version component of the current release
VersionPatch = 4 // Patch version component of the current release
VersionMeta = "" // Version metadata to append to the version string
)