error.go 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. )
  29. // List of evm-call-message pre-checking errors. All state transition messages will
  30. // be pre-checked before execution. If any invalidation detected, the corresponding
  31. // error should be returned which is defined here.
  32. //
  33. // - If the pre-checking happens in the miner, then the transaction won't be packed.
  34. // - If the pre-checking happens in the block processing procedure, then a "BAD BLOCk"
  35. // error should be emitted.
  36. var (
  37. // ErrNonceTooLow is returned if the nonce of a transaction is lower than the
  38. // one present in the local chain.
  39. ErrNonceTooLow = errors.New("nonce too low")
  40. // ErrNonceTooHigh is returned if the nonce of a transaction is higher than the
  41. // next one expected based on the local chain.
  42. ErrNonceTooHigh = errors.New("nonce too high")
  43. // ErrGasLimitReached is returned by the gas pool if the amount of gas required
  44. // by a transaction is higher than what's left in the block.
  45. ErrGasLimitReached = errors.New("gas limit reached")
  46. // ErrInsufficientFundsForTransfer is returned if the transaction sender doesn't
  47. // have enough funds for transfer(topmost call only).
  48. ErrInsufficientFundsForTransfer = errors.New("insufficient funds for transfer")
  49. // ErrInsufficientFunds is returned if the total cost of executing a transaction
  50. // is higher than the balance of the user's account.
  51. ErrInsufficientFunds = errors.New("insufficient funds for gas * price + value")
  52. // ErrGasUintOverflow is returned when calculating gas usage.
  53. ErrGasUintOverflow = errors.New("gas uint64 overflow")
  54. // ErrIntrinsicGas is returned if the transaction is specified to use less gas
  55. // than required to start the invocation.
  56. ErrIntrinsicGas = errors.New("intrinsic gas too low")
  57. // ErrTxTypeNotSupported is returned if a transaction is not supported in the
  58. // current network configuration.
  59. ErrTxTypeNotSupported = types.ErrTxTypeNotSupported
  60. // Quorum
  61. // ErrAbortBlocksProcessing is returned if bc.insertChain is interrupted under raft mode
  62. ErrAbortBlocksProcessing = errors.New("abort during blocks processing")
  63. // ErrContractManagedPartiesCheckFailed is returned if managed parties check has failed for contract
  64. ErrContractManagedPartiesCheckFailed = errors.New("managed parties check has failed for contract")
  65. // ErrPrivacyMetadataInvalidMerkleRoot is returned if there is an empty MR during the pmh.prepare(...)
  66. ErrPrivacyMetadataInvalidMerkleRoot = errors.New("privacy metadata has empty MR for stateValidation flag")
  67. // ErrPrivacyEnhancedReceivedWhenDisabled is returned if privacy enhanced transaction received while privacy enhancements are disabled
  68. ErrPrivacyEnhancedReceivedWhenDisabled = errors.New("privacy metadata has empty MR for stateValidation flag")
  69. // ErrPrivateContractInteractionVerificationFailed is returned if the verification of contract interaction differs from the one returned by Tessera (check pmh.verify(...))
  70. ErrPrivateContractInteractionVerificationFailed = errors.New("verification of contract interaction differs from the one returned by Tessera")
  71. // End Quorum
  72. )