Skip to content

Commit 2ccdf1a

Browse files
authored
Merge pull request bnb-chain#2989 from bnb-chain/develop
Draft release v1.5.9
2 parents 0449349 + 1d98244 commit 2ccdf1a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+993
-303
lines changed

CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,37 @@
11
# Changelog
2+
## v1.5.9
3+
### FEATURE
4+
[\#2932](https://github.com/bnb-chain/bsc/pull/2932) BEP-520: Short Block Interval Phase One: 1.5 seconds
5+
[\#2991](https://github.com/bnb-chain/bsc/pull/2991) config: update BSC Testnet hardfork time: Lorentz
6+
7+
### BUGFIX
8+
[\#2990](https://github.com/bnb-chain/bsc/pull/2990) core/state: fix concurrent map read and write for stateUpdate.accounts
9+
10+
### IMPROVEMENT
11+
[\#2933](https://github.com/bnb-chain/bsc/pull/2933) metrics: add more peer, block/vote metrics
12+
[\#2938](https://github.com/bnb-chain/bsc/pull/2938) cmd/geth: add example for geth bls account generate-proof
13+
[\#2949](https://github.com/bnb-chain/bsc/pull/2949) metrics: add more block/vote stats;
14+
[\#2948](https://github.com/bnb-chain/bsc/pull/2948) go.mod: update crypto to solve CVE-2025-22869
15+
[\#2960](https://github.com/bnb-chain/bsc/pull/2960) pool: debug log instead of warn
16+
[\#2961](https://github.com/bnb-chain/bsc/pull/2961) metric: add more block monitor metrics;
17+
[\#2992](https://github.com/bnb-chain/bsc/pull/2992) core/systemcontracts: update url for lorentz hardfork
18+
[\#2993](https://github.com/bnb-chain/bsc/pull/2993) cmd/jsutils: add tool GetMevStatus
19+
20+
## v1.5.8
21+
### FEATURE
22+
* [\#2955](https://github.com/bnb-chain/bsc/pull/2955) pbs: enable GreedyMergeTx by default
23+
24+
### BUGFIX
25+
* [\#2967](https://github.com/bnb-chain/bsc/pull/2967) fix: gas compare in bid simulator
26+
27+
### IMPROVEMENT
28+
* [\#2951](https://github.com/bnb-chain/bsc/pull/2951) bump golang.org/x/net from 0.34.0 to 0.36.0
29+
* [\#0000](https://github.com/bnb-chain/bsc/pull/0000) golang: upgrade toolchain to v1.23.0 (commit:3be156eec)
30+
* [\#2957](https://github.com/bnb-chain/bsc/pull/2957) miner: stop GreedyMergeTx before worker picking bids
31+
* [\#2959](https://github.com/bnb-chain/bsc/pull/2959) pbs: fix a inaccurate bid result log
32+
* [\#2971](https://github.com/bnb-chain/bsc/pull/2971) mev: no interrupt if it is too later
33+
* [\#2974](https://github.com/bnb-chain/bsc/pull/2974) miner: add metrics for bid simulation
34+
235
## v1.5.7
336
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:
437
* [\#2897](https://github.com/bnb-chain/bsc/pull/2897) upstream: merge tag 'geth-v1.15.1' into bsc-develop

cmd/geth/config.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ func makeFullNode(ctx *cli.Context) (*node.Node, ethapi.Backend) {
227227
}
228228
if ctx.IsSet(utils.OverrideMinBlocksForBlobRequests.Name) {
229229
params.MinBlocksForBlobRequests = ctx.Uint64(utils.OverrideMinBlocksForBlobRequests.Name)
230+
params.MinTimeDurationForBlobRequests = uint64(float64(params.MinBlocksForBlobRequests) * 1.5 /*lorentzBlockInterval*/)
230231
}
231232
if ctx.IsSet(utils.OverrideDefaultExtraReserveForBlobRequests.Name) {
232233
params.DefaultExtraReserveForBlobRequests = ctx.Uint64(utils.OverrideDefaultExtraReserveForBlobRequests.Name)

cmd/geth/testdata/bls-account-usage-demo.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,13 @@ ${workspace}/build/bin/geth bls account list --blspassword ./bls-password.txt -
2323

2424
echo "4. import a bls account by passing a keystore file------------------------------------------"
2525
keystoreFile=`ls bls1/bls/keystore`
26-
${workspace}/build/bin/geth bls account import --importedaccountpassword ./bls-password1.txt --blspassword ./bls-password.txt --datadir ./bls ./bls1/bls/keystore/${keystoreFile}
27-
${workspace}/build/bin/geth bls account list --blspassword ./bls-password.txt --datadir ./bls
26+
${workspace}/build/bin/geth bls account import --importedaccountpassword ./bls-password1.txt --blspassword ./bls-password.txt --datadir ./bls ./bls1/bls/keystore/${keystoreFile}
27+
publicKey=`${workspace}/build/bin/geth bls account list --blspassword ./bls-password.txt --datadir ./bls |grep public | tail -1 | awk '{print $NF}'`
28+
29+
echo "5. generate ownership proof for the selected BLS account from the BLS wallet----------------"
30+
${workspace}/build/bin/geth bls account generate-proof --blspassword ./bls-password.txt --datadir ./bls --chain-id 56 0x04d63aBCd2b9b1baa327f2Dda0f873F197ccd186 ${publicKey}
2831

29-
echo "5. clearup----------------------------------------------------------------------------------"
32+
echo "6. clearup----------------------------------------------------------------------------------"
3033
rm -rf bls
3134
rm -rf bls1
3235
rm -rf bls-password.txt

cmd/jsutils/getchainstatus.js

Lines changed: 105 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ function printUsage() {
2424
console.log(" GetBlobTxs: get BlobTxs of a block range");
2525
console.log(" GetFaucetStatus: get faucet status of BSC testnet");
2626
console.log(" GetKeyParameters: dump some key governance parameter");
27+
console.log(" GetMevStatus: get mev blocks of a block range");
2728
console.log("\nOptions:");
2829
console.log(" --rpc specify the url of RPC endpoint");
2930
console.log(" --startNum the start block number");
@@ -43,6 +44,7 @@ function printUsage() {
4344
console.log(" node getchainstatus.js GetFaucetStatus --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000010")
4445
console.log(" node getchainstatus.js GetKeyParameters --rpc https://bsc-testnet-dataseed.bnbchain.org") // default: latest block
4546
console.log(" node getchainstatus.js GetEip7623 --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000010")
47+
console.log(" node getchainstatus.js GetMevStatus --rpc https://bsc-testnet-dataseed.bnbchain.org --startNum 40000001 --endNum 40000010")
4648
}
4749

4850
program.usage = printUsage;
@@ -162,7 +164,38 @@ const validatorMap = new Map([
162164
["0xfA4d592F9B152f7a10B5DE9bE24C27a74BCE431A","MyTWFMM"]
163165
]);
164166

165-
167+
const builderMap = new Map([
168+
// BSC mainnet
169+
// blockrazor
170+
["0x5532CdB3c0c4278f9848fc4560b495b70bA67455", "blockrazor dublin"],
171+
["0xBA4233f6e478DB76698b0A5000972Af0196b7bE1", "blockrazor frankfurt"],
172+
["0x539E24781f616F0d912B60813aB75B7b80b75C53", "blockrazor nyc"],
173+
["0x49D91b1Ab0CC6A1591c2e5863E602d7159d36149", "blockrazor relay"],
174+
["0x50061047B9c7150f0Dc105f79588D1B07D2be250", "blockrazor tokyo"],
175+
["0x0557E8CB169F90F6eF421a54e29d7dd0629Ca597", "blockrazor virginia"],
176+
["0x488e37fcB2024A5B2F4342c7dE636f0825dE6448", "blockrazor x"],
177+
// puissant
178+
["0x48a5Ed9abC1a8FBe86ceC4900483f43a7f2dBB48", "puissant ap"],
179+
["0x487e5Dfe70119C1b320B8219B190a6fa95a5BB48", "puissant eu"],
180+
["0x48FeE1BB3823D72fdF80671ebaD5646Ae397BB48", "puissant us"],
181+
["0x48B4bBEbF0655557A461e91B8905b85864B8BB48", "puissant x"],
182+
["0x4827b423D03a349b7519Dda537e9A28d31ecBB48", "puissant y"],
183+
["0x48B2665E5E9a343409199D70F7495c8aB660BB48", "puissant:z"],
184+
// blockroute
185+
["0xD4376FdC9b49d90e6526dAa929f2766a33BFFD52", "blockroute dublin"],
186+
["0x2873fc7aD9122933BECB384f5856f0E87918388d", "blockroute frankfurt"],
187+
["0x432101856a330aafdeB049dD5fA03a756B3f1c66", "blockroute japan"],
188+
["0x2B217a4158933AAdE6D6494e3791D454B4D13AE7", "blockroute nyc"],
189+
["0x0da52E9673529b6E06F444FbBED2904A37f66415", "blockroute relay"],
190+
["0xE1ec1AeCE7953ecB4539749B9AA2eEF63354860a", "blockroute singapore"],
191+
["0x89434FC3a09e583F2cb4e47A8B8fe58De8BE6a15", "blockroute virginia"],
192+
["0x10353562E662E333C0c2007400284e0e21cF74fF", "blockroute x"],
193+
// txboost
194+
["0x6Dddf681C908705472D09B1D7036B2241B50e5c7", "puissant ap"],
195+
["0x76736159984AE865a9b9Cc0Df61484A49dA68191", "puissant eu"],
196+
["0x5054b21D8baea3d602dca8761B235ee10bc0231E", "puissant us"],
197+
// Chapel
198+
]);
166199

167200
// 1.cmd: "GetMaxTxCountInBlockRange", usage:
168201
// node getchainstatus.js GetMaxTxCountInBlockRange --rpc https://bsc-testnet-dataseed.bnbchain.org \
@@ -347,7 +380,7 @@ async function getPerformanceData() {
347380
if (difficulty == 2) {
348381
inturnBlocks += 1
349382
}
350-
let timestamp = eval(eval(header.timestamp).toString(10))
383+
let timestamp = eval(eval(header.milliTimestamp).toString(10))
351384
if (parliaEnabled) {
352385
let justifiedNumber = await provider.send("parlia_getJustifiedNumber", [ethers.toQuantity(i)]);
353386
if (justifiedNumber + 1 == i) {
@@ -363,11 +396,11 @@ async function getPerformanceData() {
363396

364397
let startHeader = await provider.send("eth_getHeaderByNumber", [
365398
ethers.toQuantity(program.startNum)]);
366-
let startTime = eval(eval(startHeader.timestamp).toString(10))
399+
let startTime = eval(eval(startHeader.milliTimestamp).toString(10))
367400
let endHeader = await provider.send("eth_getHeaderByNumber", [
368401
ethers.toQuantity(program.endNum)]);
369-
let endTime = eval(eval(endHeader.timestamp).toString(10))
370-
let timeCost = endTime - startTime
402+
let endTime = eval(eval(endHeader.milliTimestamp).toString(10))
403+
let timeCost = (endTime - startTime)/1000
371404
let avgBlockTime = timeCost/blockCount
372405
let inturnBlocksRatio = inturnBlocks/blockCount
373406
let justifiedBlocksRatio = justifiedBlocks/blockCount
@@ -550,6 +583,71 @@ async function getEip7623() {
550583
console.log(`Script executed in: ${duration} seconds`);
551584
}
552585

586+
// 10.cmd: "getMevStatus", usage:
587+
// node getchainstatus.js GetMeVStatus \
588+
// --rpc https://bsc-testnet-dataseed.bnbchain.org \
589+
// --startNum 40000001 --endNum 40000005
590+
async function getMevStatus() {
591+
let localCount = 0
592+
let blockrazorCount = 0
593+
let puissantCount = 0
594+
let blockrouteCount = 0
595+
let txboostCount = 0
596+
var startBlock = parseInt(program.startNum)
597+
var endBlock = parseInt(program.endNum)
598+
if (isNaN(endBlock) || isNaN(startBlock) || startBlock == 0) {
599+
console.error("invalid input, --startNum", program.startNum, "--end", program.endNum)
600+
return
601+
}
602+
// if --endNum is not specified, set it to the latest block number.
603+
if (endBlock == 0) {
604+
endBlock = await provider.getBlockNumber();
605+
}
606+
if (startBlock > endBlock) {
607+
console.error("invalid input, startBlock:", startBlock, " endBlock:", endBlock);
608+
return
609+
}
610+
611+
for (let i = startBlock; i <= endBlock; i++) {
612+
let blockData = await provider.getBlock(i);
613+
let miner = validatorMap.get(blockData.miner)
614+
const payBidTxReverseIdxMax = 3
615+
let mevBlock = false
616+
for (let idx = 0; idx <= payBidTxReverseIdxMax && blockData.transactions.length - 1 - idx >= 0; idx++) {
617+
var txIndex = blockData.transactions.length - 1 - idx
618+
let txHash = blockData.transactions[txIndex]
619+
let txData = await provider.getTransaction(txHash);
620+
if (builderMap.has(txData.to)) {
621+
let builder = builderMap.get(txData.to)
622+
if (builder.search("blockrazor") != -1) {
623+
blockrazorCount++
624+
} else if (builder.search("puissant") != -1) {
625+
puissantCount++
626+
} else if (builder.search("blockroute") != -1) {
627+
blockrouteCount++
628+
} else if (builder.search("txboost") != -1) {
629+
txboostCount++
630+
}
631+
mevBlock = true
632+
console.log("blockNum:", i, " miner:", miner, " builder:("+builderMap.get(txData.to)+")", txData.to);
633+
break
634+
}
635+
}
636+
if (!mevBlock) {
637+
localCount++
638+
console.log("blockNum:", i, " miner:", miner, " builder:local");
639+
}
640+
}
641+
console.log("Get Mev Status between [", program.startNum, ",", program.endNum, "]");
642+
let total = program.endNum - program.startNum + 1
643+
console.log("total =", total)
644+
console.log("local =", localCount, " ratio =", (localCount / total).toFixed(2))
645+
console.log("blockrazor =", blockrazorCount, " ratio =", (blockrazorCount / total).toFixed(2))
646+
console.log("puissant =", puissantCount, " ratio =", (puissantCount / total).toFixed(2))
647+
console.log("blockroute =", blockrouteCount, " ratio =", (blockrouteCount / total).toFixed(2))
648+
console.log("txboost =", txboostCount, " ratio =", (txboostCount / total).toFixed(2))
649+
};
650+
553651
const main = async () => {
554652
if (process.argv.length <= 2) {
555653
console.error('invalid process.argv.length', process.argv.length);
@@ -579,6 +677,8 @@ const main = async () => {
579677
await getKeyParameters()
580678
} else if (cmd === "GetEip7623"){
581679
await getEip7623()
680+
} else if (cmd === "GetMevStatus"){
681+
await getMevStatus()
582682
} else {
583683
console.log("unsupported cmd", cmd);
584684
printUsage()

common/bidutil/bidutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func BidBetterBefore(parentHeader *types.Header, blockPeriod uint64, delayLeftOv
1717
// BidMustBefore returns the time when the next bid must be received,
1818
// only considering the consensus delay but not bid simulation duration.
1919
func BidMustBefore(parentHeader *types.Header, blockPeriod uint64, delayLeftOver time.Duration) time.Time {
20-
nextHeaderTime := time.Unix(int64(parentHeader.Time+blockPeriod), 0)
20+
nextHeaderTime := time.UnixMilli(int64(parentHeader.MilliTimestamp() + blockPeriod))
2121
nextHeaderTime = nextHeaderTime.Add(-delayLeftOver)
2222
return nextHeaderTime
2323
}

common/format.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,13 @@ func (t PrettyAge) String() string {
8080
}
8181
return result
8282
}
83+
84+
func FormatMilliTime(n int64) string {
85+
if n < 0 {
86+
return "invalid"
87+
}
88+
if n == 0 {
89+
return ""
90+
}
91+
return time.UnixMilli(n).Format("2006-01-02 15:04:05.000")
92+
}

consensus/consensus.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,5 @@ type PoSA interface {
162162
GetFinalizedHeader(chain ChainHeaderReader, header *types.Header) *types.Header
163163
VerifyVote(chain ChainHeaderReader, vote *types.VoteEnvelope) error
164164
IsActiveValidatorAt(chain ChainHeaderReader, header *types.Header, checkVoteKeyFn func(bLSPublicKey *types.BLSPublicKey) bool) bool
165-
BlockInterval() uint64
166165
NextProposalBlock(chain ChainHeaderReader, header *types.Header, proposer common.Address) (uint64, uint64, error)
167166
}

consensus/misc/eip1559/eip1559_test.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ func copyConfig(original *params.ChainConfig) *params.ChainConfig {
5252
func config() *params.ChainConfig {
5353
config := copyConfig(params.TestChainConfig)
5454
config.Ethash = nil
55-
config.Parlia = &params.ParliaConfig{
56-
Period: 3,
57-
Epoch: 200,
58-
}
55+
config.Parlia = &params.ParliaConfig{}
5956
config.LondonBlock = big.NewInt(5)
6057
return config
6158
}

consensus/misc/eip4844/eip4844.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func CalcExcessBlobGas(config *params.ChainConfig, parent *types.Header, headTim
8383
func CalcBlobFee(config *params.ChainConfig, header *types.Header) *big.Int {
8484
var frac uint64
8585
switch config.LatestFork(header.Time) {
86-
case forks.Prague:
86+
case forks.Lorentz, forks.Prague:
8787
frac = config.BlobScheduleConfig.Prague.UpdateFraction
8888
case forks.Cancun:
8989
frac = config.BlobScheduleConfig.Cancun.UpdateFraction

consensus/parlia/abi.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,19 +1501,6 @@ const validatorSetABI = `
15011501
],
15021502
"stateMutability": "view"
15031503
},
1504-
{
1505-
"type": "function",
1506-
"name": "EPOCH",
1507-
"inputs": [],
1508-
"outputs": [
1509-
{
1510-
"name": "",
1511-
"type": "uint256",
1512-
"internalType": "uint256"
1513-
}
1514-
],
1515-
"stateMutability": "view"
1516-
},
15171504
{
15181505
"type": "function",
15191506
"name": "ERROR_FAIL_CHECK_VALIDATORS",

0 commit comments

Comments
 (0)