[go: up one dir, main page]

pub struct Database { /* private fields */ }

Implementations

Iterates over a KV mapping of [address + block height + tx idx] => transaction id. This allows for efficient lookup of transaction ids associated with an address, sorted by block age and ordering within a block. The cursor tracks the [block height + tx idx] for pagination purposes.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Construct an ephemeral database uses rocksdb when rocksdb features are enabled uses in-memory when rocksdb features are disabled

Returns the “default value” for a type. Read more

Converts to this type from the input type.

Error implementation for reasons unspecified in the protocol.

Provide the current block height in which the transactions should be executed. Read more

Provide the block hash from a given height.

Provide the coinbase address for the VM instructions implementation.

Fetch a previously inserted contract code from the chain state for a given contract. Read more

Append a contract to the chain, provided its identifier. Read more

Check if a provided contract exists in the chain.

Fetch a previously inserted salt+root tuple from the chain state for a given contract. Read more

Append the salt+root of a contract that was appended to the chain.

Fetch the value form a key-value mapping in a contract storage.

Insert a key-value mapping in a contract storage.

Fetch the balance of an asset ID in a contract storage.

Update the balance of an asset ID in a contract storage.

Error implementation of the merkle storage functions

Append P->K->V mapping to the storage. Read more

Remove P->K->V mapping from the storage. Read more

Retrieve Cow<V> such as P->K->V.

Return true if there is a P->K mapping to a value in the storage.

Return the merkle root of the domain of P. Read more

Error implementation of the merkle storage functions

Append P->K->V mapping to the storage. Read more

Remove P->K->V mapping from the storage. Read more

Retrieve Cow<V> such as P->K->V.

Return true if there is a P->K mapping to a value in the storage.

Return the merkle root of the domain of P. Read more

get validator set for current eth height

get stakes difference between fuel blocks. Return vector of changed (some blocks are not going to have any change)

Apply validators diff to validator set and update validators_da_height. This operation needs to be atomic. Read more

current best block number

set finalized da height that represent last block from da layer that got finalized.

Assume it is allways set as initialization of database.

Set data availability block height that corresponds to current_validator_set

Assume it is allways set as initialization of database.

Until blocks gets commited to da layer it is expected for it to still contains consensus votes and be saved in database until commitment is send to da layer and finalization pariod passes. In case that commited_finalized_fuel_height is zero we need to return genesis block. Read more

Set last commited finalized fuel height this means we are safe to remove consensus votes from db as from this moment they are not needed any more Read more

deposit token to database. Token deposits are not revertable

Insert difference make on staking in this particular DA height.

Query delegate index to find list of blocks that delegation changed iterate over list of indexed to find height that is less but closest to da_height Query that block StakeDiff to find actual delegation change. Read more

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Delegate Index maps delegateAddress with list of da block where delegation happened. so that we can access those changes

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Error implementation of the storage functions

Append K->V mapping to the storage. Read more

Remove K->V mapping from the storage. Read more

Retrieve Cow<V> such as K->V.

Return true if there is a K mapping to a value in the storage.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more