Documentation
¶
Index ¶
- Constants
- Variables
- func IsInsufficientBalanceError(err error) bool
- type Blocks
- type DuplicatedSignatureError
- type ExpiredTransactionError
- type IncompleteTransactionError
- type IndexedHeightFarBehindError
- type InsufficientBalanceError
- type InvalidAddressError
- type InvalidGasLimitError
- type InvalidScriptError
- type InvalidSignatureError
- type InvalidTxByteSizeError
- type InvalidTxRateLimitedError
- type PayerBalanceMode
- type ProtocolStateBlocks
- type TransactionValidationOptions
- type TransactionValidator
- type ValidationStep
Constants ¶
const DefaultSealedIndexedHeightThreshold = 30
DefaultSealedIndexedHeightThreshold is the default number of blocks between sealed and indexed height this sets a limit on how far into the past the payer validator will allow for checking the payer's balance.
Variables ¶
var ErrUnknownReferenceBlock = errors.New("unknown reference block")
ErrUnknownReferenceBlock indicates that a transaction references an unknown block.
var IndexReporterNotInitialized = errors.New("index reported not initialized")
IndexReporterNotInitialized is returned when indexReporter is nil because execution data syncing and indexing is disabled
Functions ¶
Types ¶
type DuplicatedSignatureError ¶
DuplicatedSignatureError indicates that two signatures havs been provided for a key (combination of account and key index)
func (DuplicatedSignatureError) Error ¶
func (e DuplicatedSignatureError) Error() string
type ExpiredTransactionError ¶
type ExpiredTransactionError struct {
RefHeight, FinalHeight uint64
}
ExpiredTransactionError indicates that a transaction has expired.
func (ExpiredTransactionError) Error ¶
func (e ExpiredTransactionError) Error() string
type IncompleteTransactionError ¶
type IncompleteTransactionError struct {
MissingFields []string
}
IncompleteTransactionError indicates that a transaction is missing one or more required fields.
func (IncompleteTransactionError) Error ¶
func (e IncompleteTransactionError) Error() string
type IndexedHeightFarBehindError ¶
IndexedHeightFarBehindError indicates that a node is far behind on indexing.
func (IndexedHeightFarBehindError) Error ¶
func (e IndexedHeightFarBehindError) Error() string
type InsufficientBalanceError ¶
func (InsufficientBalanceError) Error ¶
func (e InsufficientBalanceError) Error() string
type InvalidAddressError ¶
InvalidAddressError indicates that a transaction references an invalid flow Address in either the Authorizers or Payer field.
func (InvalidAddressError) Error ¶
func (e InvalidAddressError) Error() string
type InvalidGasLimitError ¶
InvalidGasLimitError indicates that a transaction specifies a gas limit that exceeds the maximum.
func (InvalidGasLimitError) Error ¶
func (e InvalidGasLimitError) Error() string
type InvalidScriptError ¶
type InvalidScriptError struct {
ParserErr error
}
InvalidScriptError indicates that a transaction contains an invalid Cadence script.
func (InvalidScriptError) Error ¶
func (e InvalidScriptError) Error() string
func (InvalidScriptError) Unwrap ¶
func (e InvalidScriptError) Unwrap() error
type InvalidSignatureError ¶
type InvalidSignatureError struct {
Signature flow.TransactionSignature
}
InvalidSignatureError indicates that a transaction contains a signature with a wrong format.
func (InvalidSignatureError) Error ¶
func (e InvalidSignatureError) Error() string
type InvalidTxByteSizeError ¶
InvalidTxByteSizeError indicates that a transaction byte size exceeds the maximum.
func (InvalidTxByteSizeError) Error ¶
func (e InvalidTxByteSizeError) Error() string
type InvalidTxRateLimitedError ¶
func (InvalidTxRateLimitedError) Error ¶
func (e InvalidTxRateLimitedError) Error() string
type PayerBalanceMode ¶
type PayerBalanceMode int
PayerBalanceMode represents the mode for checking the payer's balance when validating transactions. It controls whether and how the balance check is performed during transaction validation.
There are few modes available:
- `Disabled` - Balance checking is completely disabled. No checks are performed to verify if the payer has sufficient balance to cover the transaction fees.
- `WarnCheck` - Balance is checked, and a warning is logged if the payer does not have enough balance. The transaction is still accepted and processed regardless of the check result.
- `EnforceCheck` - Balance is checked, and the transaction is rejected if the payer does not have sufficient balance to cover the transaction fees.
const ( // Disabled indicates that payer balance checking is turned off. Disabled PayerBalanceMode = iota // WarnCheck logs a warning if the payer's balance is insufficient, but does not prevent the transaction from being accepted. WarnCheck // EnforceCheck prevents the transaction from being accepted if the payer's balance is insufficient to cover transaction fees. EnforceCheck )
func ParsePayerBalanceMode ¶
func ParsePayerBalanceMode(s string) (PayerBalanceMode, error)
func (PayerBalanceMode) String ¶
func (m PayerBalanceMode) String() string
type ProtocolStateBlocks ¶
type ProtocolStateBlocks struct {
// contains filtered or unexported fields
}
func NewProtocolStateBlocks ¶
func NewProtocolStateBlocks(state protocol.State, indexReporter state_synchronization.IndexReporter) *ProtocolStateBlocks
func (*ProtocolStateBlocks) FinalizedHeader ¶
func (b *ProtocolStateBlocks) FinalizedHeader() (*flow.Header, error)
func (*ProtocolStateBlocks) HeaderByID ¶
func (b *ProtocolStateBlocks) HeaderByID(id flow.Identifier) (*flow.Header, error)
func (*ProtocolStateBlocks) IndexedHeight ¶
func (b *ProtocolStateBlocks) IndexedHeight() (uint64, error)
IndexedHeight returns the highest indexed height by calling corresponding function of indexReporter. Expected errors during normal operation: - access.IndexReporterNotInitialized - indexed reporter was not initialized.
func (*ProtocolStateBlocks) SealedHeader ¶
func (b *ProtocolStateBlocks) SealedHeader() (*flow.Header, error)
type TransactionValidator ¶
type TransactionValidator struct {
// contains filtered or unexported fields
}
func NewTransactionValidator ¶
func NewTransactionValidator( blocks Blocks, chain flow.Chain, transactionValidationMetrics module.TransactionValidationMetrics, options TransactionValidationOptions, executor execution.ScriptExecutor, ) (*TransactionValidator, error)
func NewTransactionValidatorWithLimiter ¶
func NewTransactionValidatorWithLimiter( blocks Blocks, chain flow.Chain, options TransactionValidationOptions, transactionValidationMetrics module.TransactionValidationMetrics, rateLimiter ratelimit.RateLimiter, ) *TransactionValidator
func (*TransactionValidator) Validate ¶
func (v *TransactionValidator) Validate(ctx context.Context, tx *flow.TransactionBody) (err error)
type ValidationStep ¶
type ValidationStep struct {
// contains filtered or unexported fields
}