miner: cap configured MaxBlobsPerBlock to protocol limit (#35295)

## Summary

- Only apply user-configured `MaxBlobsPerBlock` when it is strictly
below the protocol-defined maximum.
- Prevents the miner from building blocks that exceed the consensus blob
limit.

## Test plan

- [x] `go test -short ./miner/`
This commit is contained in:
cui 2026-07-13 18:13:15 +08:00 committed by GitHub
parent df7b89603c
commit 3140668d49
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -51,8 +51,8 @@ var (
// Users can specify the maximum number of blobs per block if necessary.
func (miner *Miner) maxBlobsPerBlock(time uint64) int {
maxBlobs := eip4844.MaxBlobsPerBlock(miner.chainConfig, time)
if miner.config.MaxBlobsPerBlock != 0 {
maxBlobs = miner.config.MaxBlobsPerBlock
if configured := miner.config.MaxBlobsPerBlock; configured != 0 && configured < maxBlobs {
maxBlobs = configured
}
return maxBlobs
}