Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0xmountaintop committed Nov 28, 2023
1 parent 985fbe6 commit 4b9173b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions core/types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,10 @@ func (b *Block) Size() uint64 {
return uint64(c)
}

// PayloadSize returns the sum of all transactions in a block.
func (b *Block) PayloadSize() common.StorageSize {
// PayloadSize returns the encoded storage size sum of all transactions in a block.
func (b *Block) PayloadSize() uint64 {
// add up all txs sizes
var totalSize common.StorageSize
var totalSize uint64
for _, tx := range b.transactions {
if !tx.IsL1MessageTx() {
totalSize += tx.Size()
Expand Down
4 changes: 2 additions & 2 deletions params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ func (s ScrollConfig) IsValidTxCount(count int) bool {
}

// IsValidBlockSize returns whether the given block's transaction payload size is below the limit.
func (s ScrollConfig) IsValidBlockSize(size common.StorageSize) bool {
return s.MaxTxPayloadBytesPerBlock == nil || size <= common.StorageSize(*s.MaxTxPayloadBytesPerBlock)
func (s ScrollConfig) IsValidBlockSize(size uint64) bool {
return s.MaxTxPayloadBytesPerBlock == nil || size <= uint64(*s.MaxTxPayloadBytesPerBlock)
}

// EthashConfig is the consensus engine configs for proof-of-work based sealing.
Expand Down

0 comments on commit 4b9173b

Please sign in to comment.