@@ -66,21 +66,21 @@ type environment struct {
66
66
67
67
// txFits reports whether the transaction fits into the block size limit.
68
68
func (env * environment ) txFitsSize (tx * types.Transaction ) bool {
69
- return env .size + tx .Size () < params .BlockRLPSizeCap - blockRLPSizeCapBuffer
69
+ return env .size + tx .Size () < params .MaxBlockSize - maxBlockSizeBufferZone
70
70
}
71
71
72
72
const (
73
73
commitInterruptNone int32 = iota
74
74
commitInterruptNewHead
75
75
commitInterruptResubmit
76
76
commitInterruptTimeout
77
-
78
- // cap the size of blocks we will produce below the max allowed by
79
- // EIP-7934. This gives us buffer room if the estimated size of the
80
- // block we are building is off from the actual encoded size.
81
- blockRLPSizeCapBuffer = 1_000_000
82
77
)
83
78
79
+ // Block size is capped by the protocol at params.MaxBlockSize. When producing blocks, we
80
+ // try to say below the size including a buffer zone, this is to avoid going over the
81
+ // maximum size with auxilary data added into the block.
82
+ const maxBlockSizeBufferZone = 1_000_000
83
+
84
84
// newPayloadResult is the result of payload generation.
85
85
type newPayloadResult struct {
86
86
err error
@@ -115,7 +115,7 @@ func (miner *Miner) generateWork(genParam *generateParams, witness bool) *newPay
115
115
// Check withdrawals fit max block size.
116
116
// Due to the cap on withdrawal count, this can actually never happen, but we still need to
117
117
// check to ensure the CL notices there's a problem if the withdrawal cap is ever lifted.
118
- maxBlockSize := params .BlockRLPSizeCap - blockRLPSizeCapBuffer
118
+ maxBlockSize := params .MaxBlockSize - maxBlockSizeBufferZone
119
119
if genParam .withdrawals .Size () > maxBlockSize {
120
120
return & newPayloadResult {err : errors .New ("withdrawals exceed max block size" )}
121
121
}
0 commit comments