Compare commits

..

3 Commits

Author SHA1 Message Date
Roshan
4ab9babd11 update for test 2024-06-24 17:32:00 +08:00
Roshan
ea5f3ceaba fix: lint issue 2024-06-24 16:20:36 +08:00
Roshan
338cd0508f upgrade: add HaberFix hardfork 2024-06-24 16:10:12 +08:00
8 changed files with 12 additions and 48 deletions

View File

@@ -1,12 +1,4 @@
# Changelog # Changelog
## v1.4.11
### BUGFIX
* [\#2534](https://github.com/bnb-chain/bsc/pull/2534) fix: nil pointer when clear simulating bid
* [\#2535](https://github.com/bnb-chain/bsc/pull/2535) upgrade: add HaberFix hardfork
## v1.4.10 ## v1.4.10
### FEATURE ### FEATURE
NA NA

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -9,11 +9,3 @@ var (
//go:embed chapel/SlashContract //go:embed chapel/SlashContract
ChapelSlashContract string ChapelSlashContract string
) )
// contract codes for Mainnet upgrade
var (
//go:embed mainnet/ValidatorContract
MainnetValidatorContract string
//go:embed mainnet/SlashContract
MainnetSlashContract string
)

View File

@@ -4,7 +4,6 @@ import (
"encoding/hex" "encoding/hex"
"fmt" "fmt"
"math/big" "math/big"
"strings"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/state" "github.com/ethereum/go-ethereum/core/state"
@@ -705,33 +704,17 @@ func init() {
}, },
} }
haberFixUpgrade[mainNet] = &Upgrade{
UpgradeName: "haberFix",
Configs: []*UpgradeConfig{
{
ContractAddr: common.HexToAddress(ValidatorContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/b743ce3f1f1e94c349b175cd6593bc263463b33b",
Code: haberFix.MainnetValidatorContract,
},
{
ContractAddr: common.HexToAddress(SlashContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/b743ce3f1f1e94c349b175cd6593bc263463b33b",
Code: haberFix.MainnetSlashContract,
},
},
}
haberFixUpgrade[chapelNet] = &Upgrade{ haberFixUpgrade[chapelNet] = &Upgrade{
UpgradeName: "haberFix", UpgradeName: "haberFix",
Configs: []*UpgradeConfig{ Configs: []*UpgradeConfig{
{ {
ContractAddr: common.HexToAddress(ValidatorContract), ContractAddr: common.HexToAddress(ValidatorContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/b743ce3f1f1e94c349b175cd6593bc263463b33b", CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/2d6372ddba77902ef01e45887a425938376d5a5c",
Code: haberFix.ChapelValidatorContract, Code: haberFix.ChapelValidatorContract,
}, },
{ {
ContractAddr: common.HexToAddress(SlashContract), ContractAddr: common.HexToAddress(SlashContract),
CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/b743ce3f1f1e94c349b175cd6593bc263463b33b", CommitUrl: "https://github.com/bnb-chain/bsc-genesis-contract/commit/2d6372ddba77902ef01e45887a425938376d5a5c",
Code: haberFix.ChapelSlashContract, Code: haberFix.ChapelSlashContract,
}, },
}, },
@@ -838,7 +821,7 @@ func applySystemContractUpgrade(upgrade *Upgrade, blockNumber *big.Int, statedb
} }
} }
newContractCode, err := hex.DecodeString(strings.TrimSpace(cfg.Code)) newContractCode, err := hex.DecodeString(cfg.Code)
if err != nil { if err != nil {
panic(fmt.Errorf("failed to decode new contract code: %s", err.Error())) panic(fmt.Errorf("failed to decode new contract code: %s", err.Error()))
} }

View File

@@ -419,6 +419,10 @@ func (b *bidSimulator) clearLoop() {
b.bestBidMu.Unlock() b.bestBidMu.Unlock()
b.simBidMu.Lock() b.simBidMu.Lock()
if bid, ok := b.simulatingBid[parentHash]; ok {
bid.env.discard()
}
delete(b.simulatingBid, parentHash)
for k, v := range b.simulatingBid { for k, v := range b.simulatingBid {
if v.bid.BlockNumber <= blockNumber-core.TriesInMemory { if v.bid.BlockNumber <= blockNumber-core.TriesInMemory {
v.env.discard() v.env.discard()

View File

@@ -153,7 +153,6 @@ var (
FeynmanFixTime: newUint64(1713419340), // 2024-04-18 05:49:00 AM UTC FeynmanFixTime: newUint64(1713419340), // 2024-04-18 05:49:00 AM UTC
CancunTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC CancunTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC
HaberTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC HaberTime: newUint64(1718863500), // 2024-06-20 06:05:00 AM UTC
HaberFixTime: nil, // TBD
BohrTime: nil, BohrTime: nil,
Parlia: &ParliaConfig{ Parlia: &ParliaConfig{
@@ -194,7 +193,6 @@ var (
FeynmanFixTime: newUint64(1711342800), // 2024-03-25 5:00:00 AM UTC FeynmanFixTime: newUint64(1711342800), // 2024-03-25 5:00:00 AM UTC
CancunTime: newUint64(1713330442), // 2024-04-17 05:07:22 AM UTC CancunTime: newUint64(1713330442), // 2024-04-17 05:07:22 AM UTC
HaberTime: newUint64(1716962820), // 2024-05-29 06:07:00 AM UTC HaberTime: newUint64(1716962820), // 2024-05-29 06:07:00 AM UTC
HaberFixTime: newUint64(1719986788), // 2024-07-03 06:06:28 AM UTC
BohrTime: nil, BohrTime: nil,
Parlia: &ParliaConfig{ Parlia: &ParliaConfig{
@@ -236,12 +234,12 @@ var (
FeynmanFixTime: newUint64(0), FeynmanFixTime: newUint64(0),
CancunTime: newUint64(0), CancunTime: newUint64(0),
HaberTime: newUint64(0), HaberTime: newUint64(0),
HaberFixTime: newUint64(0), HaberFixTime: _rialto_upgrade_height_,
BohrTime: newUint64(0), BohrTime: _rialto_upgrade_height_,
Parlia: &ParliaConfig{ Parlia: &ParliaConfig{
Period: 3, Period: _rialto_parlia_period_,
Epoch: 200, Epoch: _rialto_parlia_period_,
}, },
} }
@@ -1196,9 +1194,6 @@ func (c *ChainConfig) checkCompatible(newcfg *ChainConfig, headNumber *big.Int,
if isForkTimestampIncompatible(c.HaberFixTime, newcfg.HaberFixTime, headTimestamp) { if isForkTimestampIncompatible(c.HaberFixTime, newcfg.HaberFixTime, headTimestamp) {
return newTimestampCompatError("HaberFix fork timestamp", c.HaberFixTime, newcfg.HaberFixTime) return newTimestampCompatError("HaberFix fork timestamp", c.HaberFixTime, newcfg.HaberFixTime)
} }
if isForkTimestampIncompatible(c.BohrTime, newcfg.BohrTime, headTimestamp) {
return newTimestampCompatError("Bohr fork timestamp", c.BohrTime, newcfg.BohrTime)
}
if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) { if isForkTimestampIncompatible(c.PragueTime, newcfg.PragueTime, headTimestamp) {
return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime) return newTimestampCompatError("Prague fork timestamp", c.PragueTime, newcfg.PragueTime)
} }

View File

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