github.com/MetalBlockchain/subnet-evm@v0.4.9/core/error.go (about)

     1  // (c) 2019-2020, Ava Labs, Inc.
     2  //
     3  // This file is a derived work, based on the go-ethereum library whose original
     4  // notices appear below.
     5  //
     6  // It is distributed under a license compatible with the licensing terms of the
     7  // original code from which it is derived.
     8  //
     9  // Much love to the original authors for their work.
    10  // **********
    11  // Copyright 2014 The go-ethereum Authors
    12  // This file is part of the go-ethereum library.
    13  //
    14  // The go-ethereum library is free software: you can redistribute it and/or modify
    15  // it under the terms of the GNU Lesser General Public License as published by
    16  // the Free Software Foundation, either version 3 of the License, or
    17  // (at your option) any later version.
    18  //
    19  // The go-ethereum library is distributed in the hope that it will be useful,
    20  // but WITHOUT ANY WARRANTY; without even the implied warranty of
    21  // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    22  // GNU Lesser General Public License for more details.
    23  //
    24  // You should have received a copy of the GNU Lesser General Public License
    25  // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
    26  
    27  package core
    28  
    29  import (
    30  	"errors"
    31  
    32  	"github.com/MetalBlockchain/subnet-evm/core/types"
    33  )
    34  
    35  var (
    36  	// ErrKnownBlock is returned when a block to import is already known locally.
    37  	ErrKnownBlock = errors.New("block already known")
    38  
    39  	// ErrNoGenesis is returned when there is no Genesis Block.
    40  	ErrNoGenesis = errors.New("genesis not found in chain")
    41  )
    42  
    43  // List of evm-call-message pre-checking errors. All state transition messages will
    44  // be pre-checked before execution. If any invalidation detected, the corresponding
    45  // error should be returned which is defined here.
    46  //
    47  // - If the pre-checking happens in the miner, then the transaction won't be packed.
    48  // - If the pre-checking happens in the block processing procedure, then a "BAD BLOCk"
    49  // error should be emitted.
    50  var (
    51  	// ErrNonceTooLow is returned if the nonce of a transaction is lower than the
    52  	// one present in the local chain.
    53  	ErrNonceTooLow = errors.New("nonce too low")
    54  
    55  	// ErrNonceTooHigh is returned if the nonce of a transaction is higher than the
    56  	// next one expected based on the local chain.
    57  	ErrNonceTooHigh = errors.New("nonce too high")
    58  
    59  	// ErrNonceMax is returned if the nonce of a transaction sender account has
    60  	// maximum allowed value and would become invalid if incremented.
    61  	ErrNonceMax = errors.New("nonce has max value")
    62  
    63  	// ErrGasLimitReached is returned by the gas pool if the amount of gas required
    64  	// by a transaction is higher than what's left in the block.
    65  	ErrGasLimitReached = errors.New("gas limit reached")
    66  
    67  	// ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't
    68  	// have enough funds for transfer(topmost call only).
    69  	ErrInsufficientFundsForTransfer = errors.New("insufficient funds for transfer")
    70  
    71  	// ErrInsufficientFunds is returned if the total cost of executing a transaction
    72  	// is higher than the balance of the user's account.
    73  	ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value")
    74  
    75  	// ErrGasUintOverflow is returned when calculating gas usage.
    76  	ErrGasUintOverflow = errors.New("gas uint64 overflow")
    77  
    78  	// ErrIntrinsicGas is returned if the transaction is specified to use less gas
    79  	// than required to start the invocation.
    80  	ErrIntrinsicGas = errors.New("intrinsic gas too low")
    81  
    82  	// ErrTxTypeNotSupported is returned if a transaction is not supported in the
    83  	// current network configuration.
    84  	ErrTxTypeNotSupported = types.ErrTxTypeNotSupported
    85  
    86  	// ErrTipAboveFeeCap is a sanity error to ensure no one is able to specify a
    87  	// transaction with a tip higher than the total fee cap.
    88  	ErrTipAboveFeeCap = errors.New("max priority fee per gas higher than max fee per gas")
    89  
    90  	// ErrTipVeryHigh is a sanity error to avoid extremely big numbers specified
    91  	// in the tip field.
    92  	ErrTipVeryHigh = errors.New("max priority fee per gas higher than 2^256-1")
    93  
    94  	// ErrFeeCapVeryHigh is a sanity error to avoid extremely big numbers specified
    95  	// in the fee cap field.
    96  	ErrFeeCapVeryHigh = errors.New("max fee per gas higher than 2^256-1")
    97  
    98  	// ErrFeeCapTooLow is returned if the transaction fee cap is less than the
    99  	// the base fee of the block.
   100  	ErrFeeCapTooLow = errors.New("max fee per gas less than block base fee")
   101  
   102  	// ErrSenderNoEOA is returned if the sender of a transaction is a contract.
   103  	ErrSenderNoEOA = errors.New("sender not an eoa")
   104  )