Struct fvm::kernel::filecoin::DefaultFilecoinKernel
source · pub struct DefaultFilecoinKernel<C>(pub DefaultKernel<C>);
Tuple Fields§
§0: DefaultKernel<C>
Trait Implementations§
source§impl<C> ActorOps for DefaultFilecoinKernel<C>
impl<C> ActorOps for DefaultFilecoinKernel<C>
source§fn resolve_address(&self, address: &Address) -> Result<ActorID>
fn resolve_address(&self, address: &Address) -> Result<ActorID>
Resolves an address of any protocol to an ID address (via the Init actor’s table).
This allows resolution of externally-provided SECP, BLS, or actor addresses to the canonical form.
If the argument is an ID address it is returned directly.
source§fn lookup_delegated_address(&self, actor_id: ActorID) -> Result<Option<Address>>
fn lookup_delegated_address(&self, actor_id: ActorID) -> Result<Option<Address>>
Looks up the “delegated” (f4) address of the specified actor, if any.
source§fn next_actor_address(&self) -> Result<Address>
fn next_actor_address(&self) -> Result<Address>
Computes an address for a new actor. The returned address is intended to uniquely refer to
the actor even in the event of a chain re-org (whereas an ID-address might refer to a
different actor after messages are re-ordered).
Always an ActorExec address.
source§fn create_actor(
&mut self,
code_cid: Cid,
actor_id: ActorID,
delegated_address: Option<Address>,
) -> Result<()>
fn create_actor( &mut self, code_cid: Cid, actor_id: ActorID, delegated_address: Option<Address>, ) -> Result<()>
Creates an actor with given
code_cid
, actor_id
, delegated_address
(if specified),
and an empty state.fn install_actor(&mut self, code_cid: Cid) -> Result<()>
source§fn get_builtin_actor_type(&self, code_cid: &Cid) -> Result<u32>
fn get_builtin_actor_type(&self, code_cid: &Cid) -> Result<u32>
Returns the actor’s “type” (if builitin) or 0 (if not).
source§fn get_code_cid_for_type(&self, typ: u32) -> Result<Cid>
fn get_code_cid_for_type(&self, typ: u32) -> Result<Cid>
Returns the CodeCID for the supplied built-in actor type.
source§fn balance_of(&self, actor_id: ActorID) -> Result<TokenAmount>
fn balance_of(&self, actor_id: ActorID) -> Result<TokenAmount>
Returns the balance associated with an actor id
source§impl<C> CryptoOps for DefaultFilecoinKernel<C>
impl<C> CryptoOps for DefaultFilecoinKernel<C>
source§fn verify_signature(
&self,
sig_type: SignatureType,
signature: &[u8],
signer: &Address,
plaintext: &[u8],
) -> Result<bool>
fn verify_signature( &self, sig_type: SignatureType, signature: &[u8], signer: &Address, plaintext: &[u8], ) -> Result<bool>
Verifies that a signature is valid for an address and plaintext.
source§fn verify_bls_aggregate(
&self,
aggregate_sig: &[u8; 96],
pub_keys: &[[u8; 48]],
plaintexts_concat: &[u8],
plaintext_lens: &[u32],
) -> Result<bool>
fn verify_bls_aggregate( &self, aggregate_sig: &[u8; 96], pub_keys: &[[u8; 48]], plaintexts_concat: &[u8], plaintext_lens: &[u32], ) -> Result<bool>
Verifies a BLS aggregate signature. In the case where there is one signer/signed plaintext,
this is equivalent to verifying a non-aggregated BLS signature. Read more
source§fn recover_secp_public_key(
&self,
hash: &[u8; 32],
signature: &[u8; 65],
) -> Result<[u8; 65]>
fn recover_secp_public_key( &self, hash: &[u8; 32], signature: &[u8; 65], ) -> Result<[u8; 65]>
Given a message hash and its signature, recovers the public key of the signer.
source§fn hash(&self, code: u64, data: &[u8]) -> Result<Multihash>
fn hash(&self, code: u64, data: &[u8]) -> Result<Multihash>
Hashes input
data_in
using with the specified hash function, writing the output to
digest_out
, returning the size of the digest written to digest_out
. If digest_out
is
to small to fit the entire digest, it will be truncated. If too large, the leftover space
will not be overwritten.source§impl<C> DebugOps for DefaultFilecoinKernel<C>
impl<C> DebugOps for DefaultFilecoinKernel<C>
source§impl<C> EventOps for DefaultFilecoinKernel<C>
impl<C> EventOps for DefaultFilecoinKernel<C>
source§fn emit_event(
&mut self,
event_headers: &[EventEntry],
raw_key: &[u8],
raw_val: &[u8],
) -> Result<()>
fn emit_event( &mut self, event_headers: &[EventEntry], raw_key: &[u8], raw_val: &[u8], ) -> Result<()>
Records an event emitted throughout execution.
source§impl<C> FilecoinKernel for DefaultFilecoinKernel<C>
impl<C> FilecoinKernel for DefaultFilecoinKernel<C>
source§fn verify_post(&self, verify_info: &WindowPoStVerifyInfo) -> Result<bool>
fn verify_post(&self, verify_info: &WindowPoStVerifyInfo) -> Result<bool>
Verifies a window proof of spacetime.
source§fn compute_unsealed_sector_cid(
&self,
proof_type: RegisteredSealProof,
pieces: &[PieceInfo],
) -> Result<Cid>
fn compute_unsealed_sector_cid( &self, proof_type: RegisteredSealProof, pieces: &[PieceInfo], ) -> Result<Cid>
Computes an unsealed sector CID (CommD) from its constituent piece CIDs (CommPs) and sizes.
source§fn verify_consensus_fault(
&self,
h1: &[u8],
h2: &[u8],
extra: &[u8],
) -> Result<Option<ConsensusFault>>
fn verify_consensus_fault( &self, h1: &[u8], h2: &[u8], extra: &[u8], ) -> Result<Option<ConsensusFault>>
Verifies that two block headers provide proof of a consensus fault: Read more
source§fn batch_verify_seals(&self, vis: &[SealVerifyInfo]) -> Result<Vec<bool>>
fn batch_verify_seals(&self, vis: &[SealVerifyInfo]) -> Result<Vec<bool>>
Verifies a batch of seals. This is a privledged syscall, may only be called by the
power actor during cron. Read more
source§fn verify_aggregate_seals(
&self,
aggregate: &AggregateSealVerifyProofAndInfos,
) -> Result<bool>
fn verify_aggregate_seals( &self, aggregate: &AggregateSealVerifyProofAndInfos, ) -> Result<bool>
Verify aggregate seals verifies an aggregated batch of prove-commits.
source§fn verify_replica_update(&self, replica: &ReplicaUpdateInfo) -> Result<bool>
fn verify_replica_update(&self, replica: &ReplicaUpdateInfo) -> Result<bool>
Verify replica update verifies a snap deal: an upgrade from a CC sector to a sector with
deals.
source§fn total_fil_circ_supply(&self) -> Result<TokenAmount>
fn total_fil_circ_supply(&self) -> Result<TokenAmount>
Returns the total token supply in circulation at the beginning of the current epoch.
The circulating supply is the sum of: Read more
source§impl<C> IpldBlockOps for DefaultFilecoinKernel<C>
impl<C> IpldBlockOps for DefaultFilecoinKernel<C>
source§fn block_create(&mut self, codec: u64, data: &[u8]) -> Result<BlockId>
fn block_create(&mut self, codec: u64, data: &[u8]) -> Result<BlockId>
Create a new block. Read more
source§fn block_link(
&mut self,
id: BlockId,
hash_fun: u64,
hash_len: u32,
) -> Result<Cid>
fn block_link( &mut self, id: BlockId, hash_fun: u64, hash_len: u32, ) -> Result<Cid>
Computes a CID for a block. Read more
source§impl<C> Kernel for DefaultFilecoinKernel<C>where
C: CallManager,
impl<C> Kernel for DefaultFilecoinKernel<C>where
C: CallManager,
§type CallManager = C
type CallManager = C
The
Kernel
’s CallManager
issource§fn into_inner(self) -> (Self::CallManager, BlockRegistry)where
Self: Sized,
fn into_inner(self) -> (Self::CallManager, BlockRegistry)where
Self: Sized,
source§fn machine(&self) -> &<Self::CallManager as CallManager>::Machine
fn machine(&self) -> &<Self::CallManager as CallManager>::Machine
The kernel’s underlying “machine”.
source§fn new(
mgr: C,
blocks: BlockRegistry,
caller: ActorID,
actor_id: ActorID,
method: MethodNum,
value_received: TokenAmount,
read_only: bool,
) -> Self
fn new( mgr: C, blocks: BlockRegistry, caller: ActorID, actor_id: ActorID, method: MethodNum, value_received: TokenAmount, read_only: bool, ) -> Self
source§fn limiter_mut(&mut self) -> &mut Self::Limiter
fn limiter_mut(&mut self) -> &mut Self::Limiter
Give access to the limiter of the underlying call manager.
source§fn gas_available(&self) -> Gas
fn gas_available(&self) -> Gas
Returns the remaining gas for the transaction.
source§impl<C> MessageOps for DefaultFilecoinKernel<C>
impl<C> MessageOps for DefaultFilecoinKernel<C>
source§fn msg_context(&self) -> Result<MessageContext>
fn msg_context(&self) -> Result<MessageContext>
Message information.
source§impl<C> NetworkOps for DefaultFilecoinKernel<C>
impl<C> NetworkOps for DefaultFilecoinKernel<C>
source§fn network_context(&self) -> Result<NetworkContext>
fn network_context(&self) -> Result<NetworkContext>
Network information (epoch, version, etc.).
source§fn tipset_cid(&self, epoch: ChainEpoch) -> Result<Cid>
fn tipset_cid(&self, epoch: ChainEpoch) -> Result<Cid>
The CID of the tipset at the specified epoch.
source§impl<C> RandomnessOps for DefaultFilecoinKernel<C>
impl<C> RandomnessOps for DefaultFilecoinKernel<C>
source§fn get_randomness_from_tickets(
&self,
rand_epoch: ChainEpoch,
) -> Result<[u8; 32]>
fn get_randomness_from_tickets( &self, rand_epoch: ChainEpoch, ) -> Result<[u8; 32]>
Randomness returns a (pseudo)random byte array drawing from the latest
ticket chain from a given epoch.
This randomness is fork dependant but also biasable because of this.
source§fn get_randomness_from_beacon(&self, rand_epoch: ChainEpoch) -> Result<[u8; 32]>
fn get_randomness_from_beacon(&self, rand_epoch: ChainEpoch) -> Result<[u8; 32]>
Randomness returns a (pseudo)random byte array drawing from the latest
beacon from a given epoch.
This randomness is not tied to any fork of the chain, and is unbiasable.
source§impl<C> SelfOps for DefaultFilecoinKernel<C>
impl<C> SelfOps for DefaultFilecoinKernel<C>
source§fn current_balance(&self) -> Result<TokenAmount>
fn current_balance(&self) -> Result<TokenAmount>
The balance of the receiver.
source§impl<K, C> SendOps<K> for DefaultFilecoinKernel<C>
impl<K, C> SendOps<K> for DefaultFilecoinKernel<C>
source§fn send(
&mut self,
recipient: &Address,
method: u64,
params: BlockId,
value: &TokenAmount,
gas_limit: Option<Gas>,
flags: SendFlags,
) -> Result<CallResult>
fn send( &mut self, recipient: &Address, method: u64, params: BlockId, value: &TokenAmount, gas_limit: Option<Gas>, flags: SendFlags, ) -> Result<CallResult>
Sends a message to another actor.
The method type parameter K is the type of the kernel to instantiate for
the receiving actor. This is necessary to support wrapping a kernel, so the outer
kernel can specify its Self as the receiver’s kernel type, rather than the wrapped
kernel specifying its Self.
This method is part of the Kernel trait so it can refer to the Self::CallManager
associated type necessary to constrain K.
source§impl<K> SyscallHandler<K> for DefaultFilecoinKernel<K::CallManager>where
K: FilecoinKernel + ActorOps + SendOps + UpgradeOps + IpldBlockOps + CryptoOps + DebugOps + EventOps + MessageOps + NetworkOps + RandomnessOps + SelfOps,
impl<K> SyscallHandler<K> for DefaultFilecoinKernel<K::CallManager>where
K: FilecoinKernel + ActorOps + SendOps + UpgradeOps + IpldBlockOps + CryptoOps + DebugOps + EventOps + MessageOps + NetworkOps + RandomnessOps + SelfOps,
source§impl<K, C> UpgradeOps<K> for DefaultFilecoinKernel<C>
impl<K, C> UpgradeOps<K> for DefaultFilecoinKernel<C>
source§fn upgrade_actor(
&mut self,
new_code_cid: Cid,
params_id: BlockId,
) -> Result<CallResult>
fn upgrade_actor( &mut self, new_code_cid: Cid, params_id: BlockId, ) -> Result<CallResult>
Upgrades the running actor to the specified code CID.
Auto Trait Implementations§
impl<C> Freeze for DefaultFilecoinKernel<C>where
C: Freeze,
impl<C> RefUnwindSafe for DefaultFilecoinKernel<C>where
C: RefUnwindSafe,
impl<C> !Send for DefaultFilecoinKernel<C>
impl<C> !Sync for DefaultFilecoinKernel<C>
impl<C> Unpin for DefaultFilecoinKernel<C>where
C: Unpin,
impl<C> UnwindSafe for DefaultFilecoinKernel<C>where
C: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
Causes
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
Causes
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
Causes
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
Causes
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
Causes
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
Causes
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
Causes
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
Causes
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Pipes by value. This is generally the method you want to use. Read more
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
Borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
Mutably borrows
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
Borrows
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
Mutably borrows
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
Borrows
self
, then passes self.deref()
into the pipe function.source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> References<RawCodec> for T
impl<T> References<RawCodec> for T
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Immutable access to the
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
Mutable access to the
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
Immutable access to the
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
Mutable access to the
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Immutable access to the
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Mutable access to the
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
Calls
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
Calls
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
Calls
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
Calls
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
Calls
.tap_deref()
only in debug builds, and is erased in release
builds.