Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog
## v1.6.5
### FEATURE
[\#3488](https://github.com/bnb-chain/bsc/pull/3488) miner: optional transaction gas limit cap

### IMPROVEMENT
[\#3483](https://github.com/bnb-chain/bsc/pull/3483) feat: remove the handshake from the bsc protocol
[\#3486](https://github.com/bnb-chain/bsc/pull/3486) feat: update filtermaps checkpoints

## v1.6.4
### FEATURE
[\#3466](https://github.com/bnb-chain/bsc/pull/3466) config: update BSC Mainnet hardfork time: Fermi
Expand Down
13 changes: 12 additions & 1 deletion cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ var (
utils.TxPoolOverflowPoolSlotsFlag,
utils.TxPoolLifetimeFlag,
utils.TxPoolReannounceTimeFlag,
utils.MinerTxGasLimitFlag,
utils.BlobPoolDataDirFlag,
utils.BlobPoolDataCapFlag,
utils.BlobPoolPriceBumpFlag,
Expand Down Expand Up @@ -455,9 +456,19 @@ 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()
maxTxGas := uint64(0)
if gasCeil > params.SystemTxsGasSoftLimit {
ethBackend.TxPool().SetMaxGas(gasCeil - params.SystemTxsGasSoftLimit)
maxTxGas = gasCeil - params.SystemTxsGasSoftLimit
}
if txGasLimit := ethBackend.Miner().TxGasLimit(); txGasLimit > 0 {
if maxTxGas == 0 || txGasLimit < maxTxGas {
maxTxGas = txGasLimit
}
}
if maxTxGas > 0 {
ethBackend.TxPool().SetMaxGas(maxTxGas)
}

if ctx.Bool(utils.MiningEnabledFlag.Name) {
// Mining only makes sense if a full Ethereum node is running
if ctx.String(utils.SyncModeFlag.Name) == "light" {
Expand Down
12 changes: 12 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,11 @@ var (
Value: ethconfig.Defaults.TxPool.ReannounceTime,
Category: flags.TxPoolCategory,
}
MinerTxGasLimitFlag = &cli.Uint64Flag{
Name: "miner.txgaslimit",
Usage: fmt.Sprintf("Maximum gas allowed per transaction (default = 0, disabled; min = %d)", params.MinTxGasLimitCap),
Category: flags.MinerCategory,
}
// Blob transaction pool settings
BlobPoolDataDirFlag = &cli.StringFlag{
Name: "blobpool.datadir",
Expand Down Expand Up @@ -1990,6 +1995,13 @@ func setMiner(ctx *cli.Context, cfg *minerconfig.Config) {
if ctx.Bool(DisableVoteAttestationFlag.Name) {
cfg.DisableVoteAttestation = true
}
if ctx.IsSet(MinerTxGasLimitFlag.Name) {
limit := ctx.Uint64(MinerTxGasLimitFlag.Name)
if limit != 0 && limit < params.MinTxGasLimitCap {
Fatalf("Invalid --miner.txgaslimit: %d (must be >= %d or 0)", limit, params.MinTxGasLimitCap)
}
cfg.TxGasLimit = limit
}
}

func setRequiredBlocks(ctx *cli.Context, cfg *ethconfig.Config) {
Expand Down
3 changes: 3 additions & 0 deletions core/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ var (
// Message validation errors:
ErrEmptyAuthList = errors.New("EIP-7702 transaction with empty auth list")
ErrSetCodeTxCreate = errors.New("EIP-7702 transaction cannot be used to create contract")

// -- EIP-7825 errors --
ErrGasLimitTooHigh = errors.New("transaction gas limit too high")
)

// EIP-7702 state transition errors.
Expand Down
18 changes: 16 additions & 2 deletions core/filtermaps/checkpoints_bsc_chapel.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,19 @@
{"blockNumber": 57267971, "blockId": "0x2984e427405c6849b6c2f90ebceb1ea2893afd3b6ea97b33fad18d8d31d5fc61", "firstIndex": 5234491368},
{"blockNumber": 58425417, "blockId": "0x25002aab6e71628d48c236ae8c08bc9a74da5b6c35e03674edfd3a53daf88bf5", "firstIndex": 5301600198},
{"blockNumber": 60271759, "blockId": "0x00dce6a8452de89e793eaa55bc3bfa02f7fe367db4aad6ef529fb519e0c735d4", "firstIndex": 5368708917},
{"blockNumber": 61537782, "blockId": "0x4ed62896407fbb4fa87460bef0c895995944270e2edc66cec908f13f96f1b921", "firstIndex": 5435812303}
]
{"blockNumber": 61537782, "blockId": "0x4ed62896407fbb4fa87460bef0c895995944270e2edc66cec908f13f96f1b921", "firstIndex": 5435812303},
{"blockNumber": 64360888, "blockId": "0x6a39882e5378d84c7526bf98f46b7303cb50f4f62757204059a40fde3e1dfd8b", "firstIndex": 5502926829},
{"blockNumber": 67016971, "blockId": "0xa7de4647908dd6de2e360a9344d17c7b6aa08e03826c247e558fef059fdb1b77", "firstIndex": 5570035712},
{"blockNumber": 70533695, "blockId": "0x39db812a91440cd85bf8fb9ba41f79d8dbdc36362502a83429e8950f21c7dc36", "firstIndex": 5637144576},
{"blockNumber": 72087231, "blockId": "0xd3e6c3d751894a685d4e3f78ec6ce5d3b1783255ffcd161e9637f35c7f40e2d7", "firstIndex": 5704249850},
{"blockNumber": 72103710, "blockId": "0xe21125b3b4762e8652958c99e0f3b9dbe731a3ab0fd39d5b1be5f2dc73a296ef", "firstIndex": 5771359406},
{"blockNumber": 72472818, "blockId": "0x419cfba495f8b21c5bdb394b3bd363c303245d23522b97d35306cf55f804f498", "firstIndex": 5838463753},
{"blockNumber": 72655153, "blockId": "0x355965957a9c1cbfac6078403aed37049a9207db0646649aef61e1a83f149248", "firstIndex": 5905574773},
{"blockNumber": 73206219, "blockId": "0x83afb3d603ac6f896282bc21eafa680220cb61202f2079c7c33def0c4dc68828", "firstIndex": 5972679707},
{"blockNumber": 73436144, "blockId": "0xd0b2e5b32b74d6cb8cffee1476468a4afd9572b499ccbc60b21ac220b215baf0", "firstIndex": 6039791353},
{"blockNumber": 73604097, "blockId": "0xa3d3904329563523cdf462fad851ad1bda28a587ca034039651ae82b8a4ba5c7", "firstIndex": 6106898188},
{"blockNumber": 73613573, "blockId": "0x49309309873548401b052d8e63130d308a926c23c44b93b66a3a4268bfe1a66b", "firstIndex": 6174013719},
{"blockNumber": 73620987, "blockId": "0x66aa30c386ecb1be45717b8c6e1276ed7582f97a875bc5184fb671ae44960512", "firstIndex": 6241117647},
{"blockNumber": 73628450, "blockId": "0x55ccb502864bf601a4782126708ad4f0c18304282d8c09a45a3536421f11797a", "firstIndex": 6308225769},
{"blockNumber": 74624775, "blockId": "0x32c0e4faf55c4d8f130a8634cbdb329f00410f390952f7fcdd7cdbfd76d76556", "firstIndex": 6375342074}
]
Loading
Loading