Skip to content

Commit

Permalink
Merge tag 'v1.3.4' into release/bsc-1.x-fh2.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	core/state_prefetcher.go
#	params/version.go
  • Loading branch information
maoueh committed Dec 6, 2023
2 parents 2dc3eb9 + 885de2c commit 0114dab
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 25 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -8,7 +13,7 @@ BUGFIX

## v1.3.2
BUGFIX
fix: remove sharedPool
* fix: remove sharedPool

## v1.3.1
FEATURE
Expand Down Expand Up @@ -63,7 +68,7 @@ IMPROVEMENT
* [graphql: implement withdrawals (EIP-4895) (#27072)](https://github.com/bnb-chain/bsc/pull/1840/commits/fbe432fa1584bc976fe0242d999a7dd8903378b2)
#### Client
* [ethclient: add CallContractAtHash (#24355)](https://github.com/bnb-chain/bsc/pull/1700/commits/e98114da4feedf6dfb17b9839fc2c314cf1e5768)
* [ethclient: add PeerCount method (#24849)](https://github.com/bnb-chain/bsc/pull/1840/commits/f5ff022dbca2b14af59974154874537b5ed4cc5e)
* [ethclient: add PeerCount method (#24849)](https://github.com/bnb-chain/bsc/pull/1840/commits/f5ff022dbca2b14af59974154874537b5ed4cc5e)
* [ethereum, ethclient: add FeeHistory support (#25403)](https://github.com/bnb-chain/bsc/pull/1840/commits/9ad508018e4790da0c1c00ac355f206fca12ab7c)
* [eth/filters, ethclient/gethclient: add fullTx option to pending tx fi…](https://github.com/bnb-chain/bsc/pull/1840/commits/5b1a04b9c749d804b51159fe12246c56de8515c1)
* [ethclient: include withdrawals in ethclient block responses (#26778)](https://github.com/bnb-chain/bsc/pull/1840/commits/e1b98f49a5075694c5022f5ec74425e40da415dd)
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions core/eip3529tests/eip3529_parlia_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func preHertzConfig() *params.ChainConfig {
config.LondonBlock = nil
config.BerlinBlock = nil
config.HertzBlock = nil
config.HertzfixBlock = nil
return &config
}

Expand Down
4 changes: 2 additions & 2 deletions core/state_prefetcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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())
Expand Down Expand Up @@ -109,7 +109,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)
Expand Down
1 change: 1 addition & 0 deletions eth/gasprice/gasprice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
12 changes: 7 additions & 5 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1164,12 +1164,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()
Expand Down
45 changes: 31 additions & 14 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ var (
LubanBlock: big.NewInt(29020050),
PlatoBlock: big.NewInt(30720096),
// TODO modify blockNumber, make sure HertzBlock=BerlinBlock=LondonBlock to enable Berlin and London EIPs
BerlinBlock: big.NewInt(31302048),
LondonBlock: big.NewInt(31302048),
HertzBlock: big.NewInt(31302048),

BerlinBlock: big.NewInt(31302048),
LondonBlock: big.NewInt(31302048),
HertzBlock: big.NewInt(31302048),
HertzfixBlock: big.NewInt(34140700),
Parlia: &ParliaConfig{
Period: 3,
Epoch: 200,
Expand Down Expand Up @@ -201,9 +201,10 @@ var (
LubanBlock: big.NewInt(29295050),
PlatoBlock: big.NewInt(29861024),
// TODO modify blockNumber, make sure HertzBlock=BerlinBlock=LondonBlock to enable Berlin and London EIPs
BerlinBlock: big.NewInt(31103030),
LondonBlock: big.NewInt(31103030),
HertzBlock: big.NewInt(31103030),
BerlinBlock: big.NewInt(31103030),
LondonBlock: big.NewInt(31103030),
HertzBlock: big.NewInt(31103030),
HertzfixBlock: big.NewInt(35682300),

Parlia: &ParliaConfig{
Period: 3,
Expand Down Expand Up @@ -233,10 +234,11 @@ var (
PlanckBlock: nil,

// TODO
LubanBlock: nil,
PlatoBlock: nil,
BerlinBlock: nil,
HertzBlock: nil,
LubanBlock: nil,
PlatoBlock: nil,
BerlinBlock: nil,
HertzBlock: nil,
HertzfixBlock: nil,

Parlia: &ParliaConfig{
Period: 3,
Expand Down Expand Up @@ -269,7 +271,7 @@ var (
BerlinBlock: big.NewInt(0),
LondonBlock: big.NewInt(0),
HertzBlock: big.NewInt(0),

HertzfixBlock: big.NewInt(0),
Parlia: &ParliaConfig{
Period: 3,
Epoch: 200,
Expand Down Expand Up @@ -483,7 +485,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"`
Expand Down Expand Up @@ -540,7 +542,7 @@ func (c *ChainConfig) String() string {
engine = "unknown"
}

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, 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, Engine: %v}",
c.ChainID,
c.HomesteadBlock,
c.DAOForkBlock,
Expand Down Expand Up @@ -571,6 +573,7 @@ func (c *ChainConfig) String() string {
c.LubanBlock,
c.PlatoBlock,
c.HertzBlock,
c.HertzfixBlock,
engine,
)
}
Expand Down Expand Up @@ -690,6 +693,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)
Expand Down Expand Up @@ -837,6 +848,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},
Expand Down Expand Up @@ -968,6 +980,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)
}
Expand Down Expand Up @@ -1131,6 +1146,7 @@ type Rules struct {
IsLuban bool
IsPlato bool
IsHertz bool
IsHertzfix bool
IsShanghai, IsCancun, IsPrague bool
IsVerkle bool
}
Expand Down Expand Up @@ -1160,6 +1176,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),
IsCancun: c.IsCancun(num, timestamp),
IsPrague: c.IsPrague(num, timestamp),
Expand Down
2 changes: 1 addition & 1 deletion params/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "fh2.2" // Version metadata to append to the version string

FirehoseVersionMajor = 2
Expand Down

0 comments on commit 0114dab

Please sign in to comment.