github.com/electroneum/electroneum-sc@v0.0.0-20230105223411-3bc1d078281e/consensus/istanbul/common/errors.go (about)

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