@@ -35,9 +35,9 @@ import (
35
35
type ValidationOptions struct {
36
36
Config * params.ChainConfig // Chain configuration to selectively validate based on current fork rules
37
37
38
- Accept map [ uint8 ] struct {} // Transaction types that should be accepted for the calling pool
39
- MaxSize uint64 // Maximum size of a transaction that the caller can meaningfully handle
40
- MinTip * big.Int // Minimum gas tip needed to allow a transaction into the caller pool
38
+ Accept uint8 // Bitmap of transaction types that should be accepted for the calling pool
39
+ MaxSize uint64 // Maximum size of a transaction that the caller can meaningfully handle
40
+ MinTip * big.Int // Minimum gas tip needed to allow a transaction into the caller pool
41
41
}
42
42
43
43
// ValidateTransaction is a helper method to check whether a transaction is valid
@@ -48,7 +48,7 @@ type ValidationOptions struct {
48
48
// rules without duplicating code and running the risk of missed updates.
49
49
func ValidateTransaction (tx * types.Transaction , blobs []kzg4844.Blob , commits []kzg4844.Commitment , proofs []kzg4844.Proof , head * types.Header , signer types.Signer , opts * ValidationOptions ) error {
50
50
// Ensure transactions not implemented by the calling pool are rejected
51
- if _ , ok := opts .Accept [ tx .Type ()]; ! ok {
51
+ if opts .Accept & ( 1 << tx .Type ()) == 0 {
52
52
return fmt .Errorf ("%w: tx type %v not supported by this pool" , core .ErrTxTypeNotSupported , tx .Type ())
53
53
}
54
54
// Before performing any expensive validations, sanity check that the tx is
@@ -129,7 +129,7 @@ func ValidateTransaction(tx *types.Transaction, blobs []kzg4844.Blob, commits []
129
129
return fmt .Errorf ("invalid number of %d blob proofs compared to %d blob hashes" , len (proofs ), len (hashes ))
130
130
}
131
131
// Blob quantities match up, validate that the provers match with the
132
- // transaction hash before getting to the creyptography
132
+ // transaction hash before getting to the cryptography
133
133
hasher := sha256 .New ()
134
134
for i , want := range hashes {
135
135
hasher .Write (commits [i ][:])
0 commit comments