mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: check for create blob txes
This commit is contained in:
parent
1010a79c7c
commit
003d175e21
2 changed files with 10 additions and 2 deletions
|
|
@ -104,4 +104,10 @@ var (
|
|||
// ErrBlobFeeCapTooLow is returned if the transaction fee cap is less than the
|
||||
// blob gas fee of the block.
|
||||
ErrBlobFeeCapTooLow = errors.New("max fee per blob gas less than block blob gas fee")
|
||||
|
||||
// ErrBlobTxCreate is returned if a blob transaction has no explicit to field.
|
||||
ErrBlobTxCreate = errors.New("blob transaction of type create")
|
||||
|
||||
// ErrMissingBlobHashes is returned if a blob transaction has no blob hashes.
|
||||
ErrMissingBlobHashes = errors.New("blob transaction missing blob hashes")
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
package core
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"math/big"
|
||||
|
|
@ -315,8 +314,11 @@ func (st *StateTransition) preCheck() error {
|
|||
}
|
||||
// Check the blob version validity
|
||||
if msg.BlobHashes != nil {
|
||||
if msg.To == nil {
|
||||
return ErrBlobTxCreate
|
||||
}
|
||||
if len(msg.BlobHashes) == 0 {
|
||||
return errors.New("blob transaction missing blob hashes")
|
||||
return ErrMissingBlobHashes
|
||||
}
|
||||
for i, hash := range msg.BlobHashes {
|
||||
if hash[0] != params.BlobTxHashVersion {
|
||||
|
|
|
|||
Loading…
Reference in a new issue