mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-25 06:06:44 +00:00
add comment for size check in body validation
This commit is contained in:
parent
525f5607e8
commit
799a5b1c76
2 changed files with 1 additions and 1 deletions
|
|
@ -49,6 +49,7 @@ func NewBlockValidator(config *params.ChainConfig, blockchain *BlockChain) *Bloc
|
||||||
// header's transaction and uncle roots. The headers are assumed to be already
|
// header's transaction and uncle roots. The headers are assumed to be already
|
||||||
// validated at this point.
|
// validated at this point.
|
||||||
func (v *BlockValidator) ValidateBody(block *types.Block) error {
|
func (v *BlockValidator) ValidateBody(block *types.Block) error {
|
||||||
|
// check EIP 7934 RLP-encoded block size cap
|
||||||
if v.config.IsOsaka(block.Number(), block.Time()) && block.Size() > params.BlockRLPSizeCap {
|
if v.config.IsOsaka(block.Number(), block.Time()) && block.Size() > params.BlockRLPSizeCap {
|
||||||
return ErrBlockOversized
|
return ErrBlockOversized
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -127,7 +127,6 @@ func (miner *Miner) generateWork(genParam *generateParams, witness bool) *newPay
|
||||||
if int(work.size)+params.WithdrawalSize > maxBlockSize {
|
if int(work.size)+params.WithdrawalSize > maxBlockSize {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
includedWithdrawals = append(includedWithdrawals, withdrawal)
|
includedWithdrawals = append(includedWithdrawals, withdrawal)
|
||||||
work.size += params.WithdrawalSize
|
work.size += params.WithdrawalSize
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue