Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft release v1.5.7 #2930

Merged
merged 24 commits into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
58f65c6
trie: copy preimage store pointer in StateTrie.Copy (#31158)
jwasinger Feb 12, 2025
24ed0b5
go.mod: update blst to v0.3.14 (#31165)
MariusVanDerWijden Feb 13, 2025
8ec4a06
core: sanity-check fork configuration in genesis (#31171)
fjl Feb 13, 2025
913fee4
core/rawdb: skip setting flushOffset in read-only mode (#31173)
rjl493456442 Feb 13, 2025
b027a90
version: release go-ethereum v1.15.1 stable
fjl Feb 13, 2025
b1c2ea9
upstream: merge tag 'geth-v1.15.1' into bsc-develop
buddh0 Feb 17, 2025
f9adb83
Merge pull request #2897 from buddh0/merge-tag-geth-v1.15.1
zzzckck Feb 17, 2025
314aed1
params: add LorentzTime
buddh0 Jan 21, 2025
9e24b24
tool: update jsutils tool (#2898)
zzzckck Feb 17, 2025
b5ed41b
consensus/parlia: estimate gas reserved for systemTxs (#2896)
buddh0 Feb 17, 2025
8111dd9
go.mod: downgrade bls-eth-go-binary to make it same as the prysm-v5.0…
zzzckck Feb 24, 2025
94c7a44
consensus/parlia: improve performance of func IsSystemTransaction (#2…
buddh0 Feb 25, 2025
15df0b6
miner: avoid to collect requests when getting pending blocks (#2916)
buddh0 Feb 25, 2025
71e0024
core/vm: add basic test cases for blsSignatureVerify (#2913)
buddh0 Feb 25, 2025
c266001
core/txpool/legacypool/legacypool.go: add gasTip check when reset (#2…
zlacfzy Feb 25, 2025
7000aa1
core/txpool/legacypool: add setCodeTx reorg test (#31206)
MariusVanDerWijden Feb 20, 2025
f890194
signer/core: fix encoding of `bytes` nested within array (#31049)
jwasinger Feb 21, 2025
205786e
core/txpool: move setcode tx validation into legacyPool (#31209)
rjl493456442 Feb 24, 2025
e482db0
eth/gasprice: fix eth_feeHistory blobGasRatio (#31246)
jamesstanleystewart Feb 26, 2025
07615ee
core/txpool: fix error logs flood caused by removeAuthorities (#31249)
buddh0 Feb 27, 2025
6a07fcc
miner: fix commitWork not interrupted properly (#2919)
buddh0 Feb 27, 2025
70d0e66
Merge pull request #2926 from buddh0/pick-geth-bugs-fix
zzzckck Feb 28, 2025
6fce8e1
config: update BSC Mainnet hardfork date: Pascal & Praque (#2928)
zzzckck Feb 28, 2025
552010b
release: prepare for release v1.5.7 (#2929)
zzzckck Feb 28, 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.5.7
v1.5.7 conduct small upstream code merge to follow the latest pectra hard fork and apply some bug fix. There are two PR for the code merge:
* [\#2897](https://github.com/bnb-chain/bsc/pull/2897) upstream: merge tag 'geth-v1.15.1' into bsc-develop
* [\#2926](https://github.com/bnb-chain/bsc/pull/2926) upstream: pick bug fix from latest geth

Besides code merge, there are also several important bugfix/improvements, and setup mainnet Pascal hard fork time:
### FEATURE
* [\#2928](https://github.com/bnb-chain/bsc/pull/2928) config: update BSC Mainnet hardfork date: Pascal & Praque

### BUGFIX
* [\#2907](https://github.com/bnb-chain/bsc/pull/0000) go.mod: downgrade bls-eth-go-binary to make it same as the prysm-v5.0.0

### IMPROVEMENT
* [\#2896](https://github.com/bnb-chain/bsc/pull/2896) consensus/parlia: estimate gas reserved for systemTxs
* [\#2912](https://github.com/bnb-chain/bsc/pull/2912) consensus/parlia: improve performance of func IsSystemTransaction
* [\#2916](https://github.com/bnb-chain/bsc/pull/2916) miner: avoid to collect requests when getting pending blocks
* [\#2913](https://github.com/bnb-chain/bsc/pull/2913) core/vm: add basic test cases for blsSignatureVerify
* [\#2918](https://github.com/bnb-chain/bsc/pull/2918) core/txpool/legacypool/legacypool.go: add gasTip check when reset

## v1.5.6
v1.5.6 performed another small code sync with Geth upstream, mainly sync the 7702 tx type txpool update, refer: https://github.com/bnb-chain/bsc/pull/2888/

Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/testdata/evmrun/3.out.1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
"accounts": {
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
"0x0000000000000000000000007265636569766572": {
"balance": "0",
"nonce": 0,
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
"code": "0x6040",
"address": "0x0000000000000000000000007265636569766572",
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
}
}
Expand Down
3 changes: 2 additions & 1 deletion cmd/evm/testdata/evmrun/4.out.1.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
{
"root": "b444481d1367188172f8c6091e948aaa68bae763fd26d6b9e994306a66bf69f9",
"accounts": {
"pre(0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142)": {
"0x0000000000000000000000007265636569766572": {
"balance": "0",
"nonce": 0,
"root": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
"codeHash": "0x3e48ef54b89079a075f3b8fc253c657a86b110a7aed3568c1517b10edf2c3eb6",
"code": "0x6040",
"address": "0x0000000000000000000000007265636569766572",
"key": "0x30d7a0694cb29af31b982480e11d7ebb003a3fca4026939149071f014689b142"
}
}
Expand Down
5 changes: 5 additions & 0 deletions cmd/geth/chaincmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var (
utils.OverridePassedForkTime,
utils.OverridePascal,
utils.OverridePrague,
utils.OverrideLorentz,
utils.OverrideVerkle,
utils.MultiDataBaseFlag,
}, utils.DatabaseFlags),
Expand Down Expand Up @@ -268,6 +269,10 @@ func initGenesis(ctx *cli.Context) error {
v := ctx.Uint64(utils.OverridePrague.Name)
overrides.OverridePrague = &v
}
if ctx.IsSet(utils.OverrideLorentz.Name) {
v := ctx.Uint64(utils.OverrideLorentz.Name)
overrides.OverrideLorentz = &v
}
if ctx.IsSet(utils.OverrideVerkle.Name) {
v := ctx.Uint64(utils.OverrideVerkle.Name)
overrides.OverrideVerkle = &v
Expand Down
4 changes: 4 additions & 0 deletions cmd/geth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
v := ctx.Uint64(utils.OverridePrague.Name)
cfg.Eth.OverridePrague = &v
}
if ctx.IsSet(utils.OverrideLorentz.Name) {
v := ctx.Uint64(utils.OverrideLorentz.Name)
cfg.Eth.OverrideLorentz = &v
}
if ctx.IsSet(utils.OverrideVerkle.Name) {
v := ctx.Uint64(utils.OverrideVerkle.Name)
cfg.Eth.OverrideVerkle = &v
Expand Down
5 changes: 3 additions & 2 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ var (
utils.OverridePassedForkTime,
utils.OverridePascal,
utils.OverridePrague,
utils.OverrideLorentz,
utils.OverrideVerkle,
utils.OverrideFullImmutabilityThreshold,
utils.OverrideMinBlocksForBlobRequests,
Expand Down Expand Up @@ -466,8 +467,8 @@ func startNode(ctx *cli.Context, stack *node.Node, backend ethapi.Backend, isCon
// Start auxiliary services if enabled
ethBackend, ok := backend.(*eth.EthAPIBackend)
gasCeil := ethBackend.Miner().GasCeil()
if gasCeil > params.SystemTxsGas {
ethBackend.TxPool().SetMaxGas(gasCeil - params.SystemTxsGas)
if gasCeil > params.SystemTxsGasSoftLimit {
ethBackend.TxPool().SetMaxGas(gasCeil - params.SystemTxsGasSoftLimit)
}
if ctx.Bool(utils.MiningEnabledFlag.Name) {
// Mining only makes sense if a full Ethereum node is running
Expand Down
13 changes: 8 additions & 5 deletions cmd/jsutils/getchainstatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ program.option("--startNum <startNum>", "start num")
program.option("--endNum <endNum>", "end num")
program.option("--miner <miner>", "miner", "")
program.option("--num <Num>", "validator num", 21)
program.option("--turnLength <Num>", "the consecutive block length", 4)
program.option("--topNum <Num>", "top num of address to be displayed", 20)
program.option("--blockNum <Num>", "block num", 0)
program.option("-h, --help", "")
Expand Down Expand Up @@ -34,7 +35,7 @@ function printUsage() {
console.log("\nExample:");
// mainnet https://bsc-mainnet.nodereal.io/v1/454e504917db4f82b756bd0cf6317dce
console.log(" node getchainstatus.js GetMaxTxCountInBlockRange --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000005")
console.log(" node getchainstatus.js GetBinaryVersion --rpc https://bsc-testnet-dataseed.bnbchain.org --num 21")
console.log(" node getchainstatus.js GetBinaryVersion --rpc https://bsc-testnet-dataseed.bnbchain.org --num 21 --turnLength 4")
console.log(" node getchainstatus.js GetTopAddr --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000010 --topNum 10")
console.log(" node getchainstatus.js GetSlashCount --rpc https://bsc-testnet-dataseed.bnbchain.org --blockNum 40000001") // default: latest block
console.log(" node getchainstatus.js GetPerformanceData --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000010")
Expand Down Expand Up @@ -193,12 +194,13 @@ async function getMaxTxCountInBlockRange() {
// 2.cmd: "GetBinaryVersion", usage:
// node getchainstatus.js GetBinaryVersion \
// --rpc https://bsc-testnet-dataseed.bnbchain.org \
// --num(optional): defualt 21, the number of blocks that will be checked
// --num(optional): default 21, the number of blocks that will be checked
// --turnLength(optional): default 4, the consecutive block length
async function getBinaryVersion() {
const blockNum = await provider.getBlockNumber();
console.log(blockNum);
let turnLength = program.turnLength
for (let i = 0; i < program.num; i++) {
let blockData = await provider.getBlock(blockNum - i);
let blockData = await provider.getBlock(blockNum - i*turnLength);
// 1.get Geth client version
let major = ethers.toNumber(ethers.dataSlice(blockData.extraData, 2, 3))
let minor = ethers.toNumber(ethers.dataSlice(blockData.extraData, 3, 4))
Expand All @@ -215,7 +217,8 @@ async function getBinaryVersion() {
lastGasPrice = txData.gasPrice
break
}
console.log(blockData.miner, "version =", major + "." + minor + "." + patch, " MinGasPrice = " + lastGasPrice)
var moniker = await getValidatorMoniker(blockData.miner, blockNum)
console.log(blockNum - i*turnLength, blockData.miner, "version =", major + "." + minor + "." + patch, " MinGasPrice = " + lastGasPrice, moniker)
}
};

Expand Down
5 changes: 5 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,11 @@ var (
Usage: "Manually specify the Prague fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideLorentz = &cli.Uint64Flag{
Name: "override.lorentz",
Usage: "Manually specify the Lorentz fork timestamp, overriding the bundled setting",
Category: flags.EthCategory,
}
OverrideVerkle = &cli.Uint64Flag{
Name: "override.verkle",
Usage: "Manually specify the Verkle fork timestamp, overriding the bundled setting",
Expand Down
49 changes: 43 additions & 6 deletions consensus/parlia/parlia.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,18 +321,17 @@ func (p *Parlia) Period() uint64 {
}

func (p *Parlia) IsSystemTransaction(tx *types.Transaction, header *types.Header) (bool, error) {
// deploy a contract
if tx.To() == nil {
if tx.To() == nil || !isToSystemContract(*tx.To()) {
return false, nil
}
if tx.GasPrice().Sign() != 0 {
return false, nil
}
sender, err := types.Sender(p.signer, tx)
if err != nil {
return false, errors.New("UnAuthorized transaction")
}
if sender == header.Coinbase && isToSystemContract(*tx.To()) && tx.GasPrice().Cmp(big.NewInt(0)) == 0 {
return true, nil
}
return false, nil
return sender == header.Coinbase, nil
}

func (p *Parlia) IsSystemContract(to *common.Address) bool {
Expand Down Expand Up @@ -1258,6 +1257,44 @@ func (p *Parlia) distributeFinalityReward(chain consensus.ChainHeaderReader, sta
return p.applyTransaction(msg, state, header, cx, txs, receipts, systemTxs, usedGas, mining, tracer)
}

func (p *Parlia) EstimateGasReservedForSystemTxs(chain consensus.ChainHeaderReader, header *types.Header) uint64 {
parent := chain.GetHeaderByHash(header.ParentHash)
if parent != nil {
// Mainnet and Chapel have both passed Feynman. Now, simplify the logic before and during the Feynman hard fork.
if p.chainConfig.IsFeynman(header.Number, header.Time) &&
!p.chainConfig.IsOnFeynman(header.Number, parent.Time, header.Time) {
// const (
// the following values represent the maximum values found in the most recent blocks on the mainnet
// depositTxGas = uint64(60_000)
// slashTxGas = uint64(140_000)
// finalityRewardTxGas = uint64(350_000)
// updateValidatorTxGas = uint64(12_160_000)
// )
// suggestReservedGas := depositTxGas
// if header.Difficulty.Cmp(diffInTurn) != 0 {
// snap, err := p.snapshot(chain, header.Number.Uint64()-1, header.ParentHash, nil)
// if err != nil || !snap.SignRecently(snap.inturnValidator()) {
// suggestReservedGas += slashTxGas
// }
// }
// if header.Number.Uint64()%p.config.Epoch == 0 {
// suggestReservedGas += finalityRewardTxGas
// }
// if isBreatheBlock(parent.Time, header.Time) {
// suggestReservedGas += updateValidatorTxGas
// }
// return suggestReservedGas * 150 / 100
if !isBreatheBlock(parent.Time, header.Time) {
// params.SystemTxsGasSoftLimit > (depositTxGas+slashTxGas+finalityRewardTxGas)*150/100
return params.SystemTxsGasSoftLimit
}
}
}

// params.SystemTxsGasHardLimit > (depositTxGas+slashTxGas+finalityRewardTxGas+updateValidatorTxGas)*150/100
return params.SystemTxsGasHardLimit
}

// Finalize implements consensus.Engine, ensuring no uncles are set, nor block
// rewards given.
func (p *Parlia) Finalize(chain consensus.ChainHeaderReader, header *types.Header, state vm.StateDB, txs *[]*types.Transaction,
Expand Down
9 changes: 9 additions & 0 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ type ChainOverrides struct {
OverridePassedForkTime *uint64
OverridePascal *uint64
OverridePrague *uint64
OverrideLorentz *uint64
OverrideVerkle *uint64
}

Expand All @@ -290,6 +291,9 @@ func (o *ChainOverrides) apply(cfg *params.ChainConfig) error {
if o.OverridePrague != nil {
cfg.PragueTime = o.OverridePrague
}
if o.OverrideLorentz != nil {
cfg.LorentzTime = o.OverrideLorentz
}
if o.OverrideVerkle != nil {
cfg.VerkleTime = o.OverrideVerkle
}
Expand Down Expand Up @@ -387,6 +391,11 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *triedb.Database, g
}
newCfg := genesis.chainConfigOrDefault(ghash, storedCfg)

// Sanity-check the new configuration.
if err := newCfg.CheckConfigForkOrder(); err != nil {
return nil, common.Hash{}, nil, err
}

// TODO(rjl493456442) better to define the comparator of chain config
// and short circuit if the chain config is not changed.
compatErr := storedCfg.CheckCompatible(newCfg, head.Number.Uint64(), head.Time)
Expand Down
7 changes: 7 additions & 0 deletions core/rawdb/freezer_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,13 @@ func (t *freezerTable) repairIndex() error {
// If legacy metadata is detected, attempt to recover the offset from the
// index file to avoid clearing the entire table.
if t.metadata.version == freezerTableV1 {
// Skip truncation if the legacy metadata is opened in read-only mode.
// Since all items in the legacy index file were forcibly synchronized,
// data integrity is guaranteed. Therefore, it's safe to leave any extra
// items untruncated in this special scenario.
if t.readonly {
return nil
}
t.logger.Info("Recovering freezer flushOffset for legacy table", "offset", size)
return t.metadata.setFlushOffset(size, true)
}
Expand Down
13 changes: 0 additions & 13 deletions core/txpool/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ var (
// making the transaction invalid, rather a DOS protection.
ErrOversizedData = errors.New("oversized data")

// ErrFutureReplacePending is returned if a future transaction replaces a pending
// one. Future transactions should only be able to replace other future transactions.
ErrFutureReplacePending = errors.New("future transaction tries to replace pending")

// ErrAlreadyReserved is returned if the sender address has a pending transaction
// in a different subpool. For example, this error is returned in response to any
// input transaction of non-blob type when a blob transaction from this sender
Expand All @@ -63,13 +59,4 @@ var (

// ErrInBlackList is returned if the transaction send by banned address
ErrInBlackList = errors.New("sender or to in black list")

// ErrAuthorityReserved is returned if a transaction has an authorization
// signed by an address which already has in-flight transactions known to the
// pool.
ErrAuthorityReserved = errors.New("authority already reserved")

// ErrAuthorityNonce is returned if a transaction has an authorization with
// a nonce that is not currently valid for the authority.
ErrAuthorityNonceTooLow = errors.New("authority nonce too low")
)
Loading
Loading