errors.go 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. package istanbulcommon
  2. import "errors"
  3. var (
  4. // ErrInvalidProposal is returned when a prposal is malformed.
  5. ErrInvalidProposal = errors.New("invalid proposal")
  6. // ErrInvalidSignature is returned when given signature is not signed by given
  7. // address.
  8. ErrInvalidSignature = errors.New("invalid signature")
  9. // ErrUnknownBlock is returned when the list of validators is requested for a block
  10. // that is not part of the local blockchain.
  11. ErrUnknownBlock = errors.New("unknown block")
  12. // ErrUnauthorized is returned if a header is signed by a non authorized entity.
  13. ErrUnauthorized = errors.New("unauthorized")
  14. // ErrInvalidDifficulty is returned if the difficulty of a block is not 1
  15. ErrInvalidDifficulty = errors.New("invalid difficulty")
  16. // ErrInvalidExtraDataFormat is returned when the extra data format is incorrect
  17. ErrInvalidExtraDataFormat = errors.New("invalid extra data format")
  18. // ErrInvalidMixDigest is returned if a block's mix digest is not Istanbul digest.
  19. ErrInvalidMixDigest = errors.New("invalid Istanbul mix digest")
  20. // ErrInvalidNonce is returned if a block's nonce is invalid
  21. ErrInvalidNonce = errors.New("invalid nonce")
  22. // ErrInvalidUncleHash is returned if a block contains an non-empty uncle list.
  23. ErrInvalidUncleHash = errors.New("non empty uncle hash")
  24. // ErrInconsistentValidatorSet is returned if the validator set is inconsistent
  25. // ErrInconsistentValidatorSet = errors.New("non empty uncle hash")
  26. // ErrInvalidTimestamp is returned if the timestamp of a block is lower than the previous block's timestamp + the minimum block period.
  27. ErrInvalidTimestamp = errors.New("invalid timestamp")
  28. // ErrInvalidVotingChain is returned if an authorization list is attempted to
  29. // be modified via out-of-range or non-contiguous headers.
  30. ErrInvalidVotingChain = errors.New("invalid voting chain")
  31. // ErrInvalidVote is returned if a nonce value is something else that the two
  32. // allowed constants of 0x00..0 or 0xff..f.
  33. ErrInvalidVote = errors.New("vote nonce not 0x00..0 or 0xff..f")
  34. // ErrInvalidCommittedSeals is returned if the committed seal is not signed by any of parent validators.
  35. ErrInvalidCommittedSeals = errors.New("invalid committed seals")
  36. // ErrEmptyCommittedSeals is returned if the field of committed seals is zero.
  37. ErrEmptyCommittedSeals = errors.New("zero committed seals")
  38. // ErrMismatchTxhashes is returned if the TxHash in header is mismatch.
  39. ErrMismatchTxhashes = errors.New("mismatch transactions hashes")
  40. // ErrInconsistentSubject is returned when received subject is different from
  41. // current subject.
  42. ErrInconsistentSubject = errors.New("inconsistent subjects")
  43. // ErrNotFromProposer is returned when received message is supposed to be from
  44. // proposer.
  45. ErrNotFromProposer = errors.New("message does not come from proposer")
  46. // ErrIgnored is returned when a message was ignored.
  47. ErrIgnored = errors.New("message is ignored")
  48. // ErrFutureMessage is returned when current view is earlier than the
  49. // view of the received message.
  50. ErrFutureMessage = errors.New("future message")
  51. // ErrOldMessage is returned when the received message's view is earlier
  52. // than current view.
  53. ErrOldMessage = errors.New("old message")
  54. // ErrInvalidMessage is returned when the message is malformed.
  55. ErrInvalidMessage = errors.New("invalid message")
  56. // ErrFailedDecodePreprepare is returned when the PRE-PREPARE message is malformed.
  57. ErrFailedDecodePreprepare = errors.New("failed to decode PRE-PREPARE message")
  58. // ErrFailedDecodePrepare is returned when the PREPARE message is malformed.
  59. ErrFailedDecodePrepare = errors.New("failed to decode PREPARE message")
  60. // ErrFailedDecodeCommit is returned when the COMMIT message is malformed.
  61. ErrFailedDecodeCommit = errors.New("failed to decode COMMIT message")
  62. // ErrFailedDecodeRoundChange is returned when the COMMIT message is malformed.
  63. ErrFailedDecodeRoundChange = errors.New("failed to decode ROUND-CHANGE message")
  64. // ErrFailedDecodeMessageSet is returned when the message set is malformed.
  65. // ErrFailedDecodeMessageSet = errors.New("failed to decode message set")
  66. // ErrInvalidSigner is returned when the message is signed by a validator different than message sender
  67. ErrInvalidSigner = errors.New("message not signed by the sender")
  68. ErrInvalidGenesis = errors.New("genesis must only specify single validator mode for block zero")
  69. )