vmsupport

package
v1.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BatchSealVerifyParallelism = 2 * goruntime.NumCPU()

Functions

This section is empty.

Types

type NilFaultChecker

type NilFaultChecker struct{}

type Syscalls

type Syscalls struct {
	// contains filtered or unexported fields
}

Syscalls contains the concrete implementation of LegacyVM system calls, including connection to proof verification and blockchain inspection. Errors returned by these methods are intended to be returned to the actor code to respond to: they must be entirely deterministic and repeatable by other implementations. Any non-deterministic error will instead trigger a panic. TODO: determine a more robust mechanism for distinguishing transient runtime failures from deterministic errors in LegacyVM and supporting code. https://github.com/filecoin-project/venus/issues/3844

func NewSyscalls

func NewSyscalls(faultChecker faultChecker, verifier ffiwrapper.Verifier) *Syscalls

func (*Syscalls) BatchVerifySeals

func (s *Syscalls) BatchVerifySeals(ctx context.Context, vis map[address.Address][]proof7.SealVerifyInfo) (map[address.Address][]bool, error)

BatchVerifySeals batch verify windows post

func (*Syscalls) ComputeUnsealedSectorCID

func (s *Syscalls) ComputeUnsealedSectorCID(_ context.Context, proof abi.RegisteredSealProof, pieces []abi.PieceInfo) (cid.Cid, error)

ComputeUnsealedSectorCID Computes an unsealed sector CID (CommD) from its constituent piece CIDs (CommPs) and sizes.

func (*Syscalls) HashBlake2b

func (s *Syscalls) HashBlake2b(data []byte) [32]byte

HashBlake2b Hashes input data using blake2b with 256 bit output.

func (*Syscalls) VerifyAggregateSeals added in v0.9.7

func (s *Syscalls) VerifyAggregateSeals(aggregate proof7.AggregateSealVerifyProofAndInfos) error

func (*Syscalls) VerifyConsensusFault

func (s *Syscalls) VerifyConsensusFault(ctx context.Context, h1, h2, extra []byte, curEpoch abi.ChainEpoch, msg vm.VmMessage, gasIpld cbornode.IpldStore, view vm.SyscallsStateView, getter vmcontext.LookbackStateGetter) (*vmr.ConsensusFault, error)

Verifies that two block headers provide proof of a consensus fault: - both headers mined by the same actor - headers are different - first header is of the same or lower epoch as the second - at least one of the headers appears in the current chain at or after epoch `earliest` - the headers provide evidence of a fault (see the spec for the different fault types). The parameters are all serialized block headers. The third "extra" parameter is consulted only for the "parent grinding fault", in which case it must be the sibling of h1 (same parent tipset) and one of the blocks in the parent of h2 (i.e. h2's grandparent). Returns nil and an error if the headers don't prove a fault.

func (*Syscalls) VerifyPoSt

func (s *Syscalls) VerifyPoSt(ctx context.Context, info proof7.WindowPoStVerifyInfo) error

VerifyPoSt verify windows post

func (*Syscalls) VerifyReplicaUpdate added in v1.2.0

func (s *Syscalls) VerifyReplicaUpdate(update proof7.ReplicaUpdateInfo) error

func (*Syscalls) VerifySeal

func (s *Syscalls) VerifySeal(_ context.Context, info proof7.SealVerifyInfo) error

VerifySeal returns true if the sealing operation from which its inputs were derived was valid, and false if not.

func (*Syscalls) VerifySignature

func (s *Syscalls) VerifySignature(ctx context.Context, view vm.SyscallsStateView, signature crypto.Signature, signer address.Address, plaintext []byte) error

VerifySignature Verifies that a signature is valid for an address and plaintext.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL