github.com/dominant-strategies/go-quai@v0.28.2/core/error.go (about) 1 // Copyright 2014 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package core 18 19 import ( 20 "errors" 21 22 "github.com/dominant-strategies/go-quai/core/types" 23 ) 24 25 var ( 26 // ErrKnownBlock is returned when a block to import is already known locally. 27 ErrKnownBlock = errors.New("block already known") 28 29 // ErrBannedHash is returned if a block to import is on the banned list. 30 ErrBannedHash = errors.New("banned hash") 31 32 // ErrNoGenesis is returned when there is no Genesis Block. 33 ErrNoGenesis = errors.New("genesis not found in chain") 34 35 // ErrSubNotSyncedToDom is returned when the subordinate cannot find the parent of the block which is being appended by the dom. 36 ErrSubNotSyncedToDom = errors.New("sub not synced to dom") 37 38 // ErrPendingEtxAlreadyKnown is returned received pending etx already in the cache/db 39 ErrPendingEtxAlreadyKnown = errors.New("pending etx already known") 40 41 // ErrBloomAlreadyKnown is returned if received bloom is already in the cache/db 42 ErrBloomAlreadyKnown = errors.New("bloom already known") 43 44 // ErrBodyNotFound is returned when body data for a given header hash cannot be found. 45 ErrBodyNotFound = errors.New("could not find the body data to match the header root hash") 46 47 // ErrDomClientNotUp is returned when block is trying to be appended when domClient is not up. 48 ErrDomClientNotUp = errors.New("dom client is not online") 49 50 // ErrBadSubManifest is returned when a block's subordinate manifest does not match the subordinate manifest hash 51 ErrBadSubManifest = errors.New("subordinate manifest is incorrect") 52 53 //ErrPendingBlock indicates the block couldn't yet be processed. This is likely due to missing information (ancestor, body, pendingEtxs, etc) 54 ErrPendingBlock = errors.New("block cannot be appended yet") 55 56 //ErrPendingEtxNotFound is returned when pendingEtxs cannot be found for a hash given in the submanifest 57 ErrPendingEtxNotFound = errors.New("pending etx not found") 58 59 //ErrBloomNotFound is returned when bloom cannot be found for a hash 60 ErrBloomNotFound = errors.New("bloom not found") 61 62 //ErrPendingEtxRollupNotFound is returned when pendingEtxsRollup cannot be found for a hash given in the submanifest 63 ErrPendingEtxRollupNotFound = errors.New("pending etx rollup not found") 64 65 //ErrPendingEtxNotValid is returned when pendingEtxs is not valid 66 ErrPendingEtxNotValid = errors.New("pending etx not valid") 67 68 //ErrPendingEtxRollupNotValid is returned when pendingEtxsRollup is not valid 69 ErrPendingEtxRollupNotValid = errors.New("pending etx rollup not valid") 70 71 // ErrBadBlockHash is returned when block being appended is in the badBlockHashes list 72 ErrBadBlockHash = errors.New("block hash exists in bad block hashes list") 73 74 // ErrPendingHeaderNotInCache is returned when a coord gives an update but the slice has not yet created the referenced ph 75 ErrPendingHeaderNotInCache = errors.New("no pending header found in cache") 76 ) 77 78 // List of evm-call-message pre-checking errors. All state transition messages will 79 // be pre-checked before execution. If any invalidation detected, the corresponding 80 // error should be returned which is defined here. 81 // 82 // - If the pre-checking happens in the miner, then the transaction won't be packed. 83 // - If the pre-checking happens in the block processing procedure, then a "BAD BLOCk" 84 // error should be emitted. 85 var ( 86 // ErrNonceTooLow is returned if the nonce of a transaction is lower than the 87 // one present in the local chain. 88 ErrNonceTooLow = errors.New("nonce too low") 89 90 // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the 91 // next one expected based on the local chain. 92 ErrNonceTooHigh = errors.New("nonce too high") 93 94 // ErrGasLimitReached is returned by the gas pool if the amount of gas required 95 // by a transaction is higher than what's left in the block. 96 ErrGasLimitReached = errors.New("gas limit reached") 97 98 // ErrEtxLimitReached is returned when the ETXs emitted by a transaction 99 // would violate the block's ETX limits. 100 ErrEtxLimitReached = errors.New("etx limit reached") 101 102 // ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't 103 // have enough funds for transfer(topmost call only). 104 ErrInsufficientFundsForTransfer = errors.New("insufficient funds for transfer") 105 106 // ErrInsufficientFunds is returned if the total cost of executing a transaction 107 // is higher than the balance of the user's account. 108 ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value") 109 110 // ErrGasUintOverflow is returned when calculating gas usage. 111 ErrGasUintOverflow = errors.New("gas uint64 overflow") 112 113 // ErrIntrinsicGas is returned if the transaction is specified to use less gas 114 // than required to start the invocation. 115 ErrIntrinsicGas = errors.New("intrinsic gas too low") 116 117 // ErrTxTypeNotSupported is returned if a transaction is not supported in the 118 // current network configuration. 119 ErrTxTypeNotSupported = types.ErrTxTypeNotSupported 120 121 // ErrTipAboveFeeCap is a sanity error to ensure no one is able to specify a 122 // transaction with a tip higher than the total fee cap. 123 ErrTipAboveFeeCap = errors.New("max priority fee per gas higher than max fee per gas") 124 125 // ErrTipVeryHigh is a sanity error to avoid extremely big numbers specified 126 // in the tip field. 127 ErrTipVeryHigh = errors.New("max priority fee per gas higher than 2^256-1") 128 129 // ErrFeeCapVeryHigh is a sanity error to avoid extremely big numbers specified 130 // in the fee cap field. 131 ErrFeeCapVeryHigh = errors.New("max fee per gas higher than 2^256-1") 132 133 // ErrFeeCapTooLow is returned if the transaction fee cap is less than the 134 // the base fee of the block. 135 ErrFeeCapTooLow = errors.New("max fee per gas less than block base fee") 136 137 // ErrSenderNoEOA is returned if the sender of a transaction is a contract. 138 ErrSenderNoEOA = errors.New("sender not an eoa") 139 140 // ErrSenderInoperable is returned if the sender of a transaction is outside of context. 141 ErrSenderInoperable = errors.New("sender is in inoperable state") 142 )