error.go 3.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. package core
  17. import (
  18. "errors"
  19. "github.com/ethereum/go-ethereum/core/types"
  20. )
  21. var (
  22. // ErrKnownBlock is returned when a block to import is already known locally.
  23. ErrKnownBlock = errors.New("block already known")
  24. // ErrBlacklistedHash is returned if a block to import is on the blacklist.
  25. ErrBlacklistedHash = errors.New("blacklisted hash")
  26. // ErrNoGenesis is returned when there is no Genesis Block.
  27. ErrNoGenesis = errors.New("genesis not found in chain")
  28. // ErrDiffLayerNotFound is returned when diff layer not found.
  29. ErrDiffLayerNotFound = errors.New("diff layer not found")
  30. )
  31. // List of evm-call-message pre-checking errors. All state transition messages will
  32. // be pre-checked before execution. If any invalidation detected, the corresponding
  33. // error should be returned which is defined here.
  34. //
  35. // - If the pre-checking happens in the miner, then the transaction won't be packed.
  36. // - If the pre-checking happens in the block processing procedure, then a "BAD BLOCk"
  37. // error should be emitted.
  38. var (
  39. // ErrNonceTooLow is returned if the nonce of a transaction is lower than the
  40. // one present in the local chain.
  41. ErrNonceTooLow = errors.New("nonce too low")
  42. // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the
  43. // next one expected based on the local chain.
  44. ErrNonceTooHigh = errors.New("nonce too high")
  45. // ErrGasLimitReached is returned by the gas pool if the amount of gas required
  46. // by a transaction is higher than what's left in the block.
  47. ErrGasLimitReached = errors.New("gas limit reached")
  48. // ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't
  49. // have enough funds for transfer(topmost call only).
  50. ErrInsufficientFundsForTransfer = errors.New("insufficient funds for transfer")
  51. // ErrInsufficientFunds is returned if the total cost of executing a transaction
  52. // is higher than the balance of the user's account.
  53. ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value")
  54. // ErrGasUintOverflow is returned when calculating gas usage.
  55. ErrGasUintOverflow = errors.New("gas uint64 overflow")
  56. // ErrIntrinsicGas is returned if the transaction is specified to use less gas
  57. // than required to start the invocation.
  58. ErrIntrinsicGas = errors.New("intrinsic gas too low")
  59. // ErrTxTypeNotSupported is returned if a transaction is not supported in the
  60. // current network configuration.
  61. ErrTxTypeNotSupported = types.ErrTxTypeNotSupported
  62. )