core, eth: for types with accurate size calcs, return uint64, not float (#26046)

* core, eth: for types with accurate size calcs, return uint64, not float

* core/types: proper tx size tests

* core/types: extend tx size test with decoded sizes, fix error

* core/txpool: fix linter

Co-authored-by: Martin Holst Swende <martin@swende.se>
This commit is contained in:
Péter Szilágyi
2022-10-26 15:23:07 +03:00
committed by GitHub
co-authored by Martin Holst Swende
parent 5bed24dd77
commit c4a662176e
10 changed files with 137 additions and 64 deletions
+1 -1
View File
@@ -595,7 +595,7 @@ func (pool *TxPool) validateTx(tx *types.Transaction, local bool) error {
return core.ErrTxTypeNotSupported
}
// Reject transactions over defined size to prevent DOS attacks
if uint64(tx.Size()) > txMaxSize {
if tx.Size() > txMaxSize {
return ErrOversizedData
}
// Transactions can't be negative. This may never happen using RLP decoded