Enum grin_chain::Error

source ·
pub enum Error {
Show 45 variants Unfit(String), Orphan, DifficultyTooLow, WrongTotalDifficulty, LowEdgebits, InvalidScaling, InvalidPow, OldBlock, InvalidBlockProof { source: Error, }, InvalidBlockTime, InvalidBlockHeight, InvalidRoot, InvalidMMRSize, Keychain { source: Error, }, Secp { source: Error, }, AlreadySpent(Commitment), DuplicateCommitment(Commitment), ImmatureCoinbase, MerkleProof, OutputNotFound, RangeproofNotFound, TxKernelNotFound, OutputSpent, InvalidBlockVersion(HeaderVersion), InvalidTxHashSet(String), StoreErr(Error, String), FileReadErr(String), SerErr { source: Error, }, TxHashSetErr(String), TxLockHeight, NRDRelativeHeight, GenesisBlockRequired, Transaction { source: Error, }, Block(Error), InvalidHeaderHeight(u64), Other(String), Committed { source: Error, }, Stopped, Bitmap, SyncError(String), SegmentError { source: SegmentError, }, AbortingPIBDError, SegmenterHeaderMismatch, InvalidSegmentHeight, InvalidSegment(String),
}
Expand description

Chain error definitions

Variants§

§

Unfit(String)

The block doesn’t fit anywhere in our chain

§

Orphan

Special case of orphan blocks

§

DifficultyTooLow

Difficulty is too low either compared to ours or the block PoW hash

§

WrongTotalDifficulty

Addition of difficulties on all previous block is wrong

§

LowEdgebits

Block header edge_bits is lower than our min

§

InvalidScaling

Scaling factor between primary and secondary PoW is invalid

§

InvalidPow

The proof of work is invalid

§

OldBlock

Peer abusively sending us an old block we already have

§

InvalidBlockProof

The block doesn’t sum correctly or a tx signature is invalid

Fields

§source: Error

Conversion

§

InvalidBlockTime

Block time is too old

§

InvalidBlockHeight

Block height is invalid (not previous + 1)

§

InvalidRoot

One of the root hashes in the block is invalid

§

InvalidMMRSize

One of the MMR sizes in the block header is invalid

§

Keychain

Error from underlying keychain impl

Fields

§source: Error

Conversion

§

Secp

Error from underlying secp lib

Fields

§source: Error

Conversion

§

AlreadySpent(Commitment)

One of the inputs in the block has already been spent

§

DuplicateCommitment(Commitment)

An output with that commitment already exists (should be unique)

§

ImmatureCoinbase

Attempt to spend a coinbase output before it sufficiently matures.

§

MerkleProof

Error validating a Merkle proof (coinbase output)

§

OutputNotFound

Output not found

§

RangeproofNotFound

Rangeproof not found

§

TxKernelNotFound

Tx kernel not found

§

OutputSpent

output spent

§

InvalidBlockVersion(HeaderVersion)

Invalid block version, either a mistake or outdated software

§

InvalidTxHashSet(String)

We’ve been provided a bad txhashset

§

StoreErr(Error, String)

Internal issue when trying to save or load data from store

§

FileReadErr(String)

Internal issue when trying to save or load data from append only files

§

SerErr

Error serializing or deserializing a type

Fields

§source: Error

Conversion

§

TxHashSetErr(String)

Error with the txhashset

§

TxLockHeight

Tx not valid based on lock_height.

§

NRDRelativeHeight

Tx is not valid due to NRD relative_height restriction.

§

GenesisBlockRequired

No chain exists and genesis block is required

§

Transaction

Error from underlying tx handling

Fields

§source: Error

Conversion

§

Block(Error)

Error from underlying block handling

§

InvalidHeaderHeight(u64)

Attempt to retrieve a header at a height greater than the max allowed by u64 limits

§

Other(String)

Anything else

§

Committed

Error from summing and verifying kernel sums via committed trait.

Fields

§source: Error

Conversion

§

Stopped

We cannot process data once the Grin server has been stopped.

§

Bitmap

Internal Roaring Bitmap error

§

SyncError(String)

Error during chain sync

§

SegmentError

PIBD segment related error

Fields

§source: SegmentError

Conversion

§

AbortingPIBDError

We’ve decided to halt the PIBD process due to lack of supporting peers or otherwise failing to progress for a certain amount of time

§

SegmenterHeaderMismatch

The segmenter is associated to a different block header

§

InvalidSegmentHeight

Segment height not within allowed range

§

InvalidSegment(String)

Other issue with segment

Implementations§

source§

impl Error

source

pub fn is_bad_data(&self) -> bool

Whether the error is due to a block that was intrinsically wrong

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Error

source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Error

source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
1.0.0 · source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl From<Error> for Error

source§

fn from(error: Error) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(source: Error) -> Self

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(e: Error) -> Error

Converts to this type from the input type.
source§

impl From<SegmentError> for Error

source§

fn from(source: SegmentError) -> Self

Converts to this type from the input type.
source§

impl PartialEq for Error

source§

fn eq(&self, other: &Error) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Error

source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Freeze for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneAny for T
where T: Any + Clone,

source§

fn clone_any(&self) -> Box<dyn CloneAny>

source§

fn clone_any_send(&self) -> Box<dyn CloneAny + Send>
where T: Send,

source§

fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync>
where T: Sync,

source§

fn clone_any_send_sync(&self) -> Box<dyn CloneAny + Send + Sync>
where T: Send + Sync,

source§

impl<'a, T> DefaultFeatures<'a> for T
where T: 'a + Send + Sync + Clone,

source§

fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
source§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<'a, T> NonSyncFeatures<'a> for T
where T: 'a + Clone,

source§

fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a>>

Clone this value, and then immediately put it into a Box behind a trait object of this trait.
source§

fn self_address_mut(&mut self) -> *mut ()

Returns the address of self. Read more
source§

impl<T> SafeBorrow<T> for T
where T: ?Sized,

source§

fn borrow_replacement(ptr: &T) -> &T

Given ptr, which was obtained from a prior call to Self::borrow(), return a value with the same nominal lifetime which is guaranteed to survive mutations to Self. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DebugAny for T
where T: Any + Debug,

source§

impl<T> UnsafeAny for T
where T: Any,