chunks

package
v0.10.1-consensus-prin... Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: AGPL-3.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

View Source
const DefaultChunkAssignmentAlpha = 5

DefaultChunkAssignmentAlpha is the default number of verifiers that should be assigned to each chunk. DISCLAIMER: alpha down there is not a production-level value

Variables

This section is empty.

Functions

func IsValidVerifer added in v0.9.6

func IsValidVerifer(assignment *chunkmodels.Assignment, chunk *flow.Chunk, approver flow.Identifier) bool

IsValidVerifer ...

Types

type ChunkVerifier

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

ChunkVerifier is a verifier based on the current definitions of the flow network

func NewChunkVerifier

func NewChunkVerifier(vm VirtualMachine, vmCtx fvm.Context) *ChunkVerifier

NewChunkVerifier creates a chunk verifier containing a flow virtual machine

func (*ChunkVerifier) SystemChunkVerify

func (fcv *ChunkVerifier) SystemChunkVerify(vc *verification.VerifiableChunkData) ([]byte, chmodels.ChunkFault, error)

SystemChunkVerify verifies a given VerifiableChunk corresponding to a system chunk. by executing it and checking the final state commitment It returns a Spock Secret as a byte array, verification fault of the chunk, and an error. Note: SystemChunkVerify should only be executed on system chunks. It returns an error if it is invoked on non-system chunks.

func (*ChunkVerifier) Verify

Verify verifies a given VerifiableChunk corresponding to a non-system chunk. by executing it and checking the final state commitment It returns a Spock Secret as a byte array, verification fault of the chunk, and an error. Note: Verify should only be executed on non-system chunks. It returns an error if it is invoked on system chunks.

type PublicAssignment

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

PublicAssignment implements an instance of the Public Chunk Assignment algorithm for assigning chunks to verifier nodes in a deterministic but unpredictable manner. It implements the ChunkAssigner interface.

func NewPublicAssignment

func NewPublicAssignment(alpha int, protocolState protocol.ReadOnlyState) (*PublicAssignment, error)

NewPublicAssignment generates and returns an instance of the Public Chunk Assignment algorithm. Parameter alpha is the number of verifiers that should be assigned to each chunk.

func (*PublicAssignment) Assign

Assign generates the assignment

func (*PublicAssignment) Size

func (p *PublicAssignment) Size() uint

Size returns number of assignments

type VirtualMachine

type VirtualMachine interface {
	Run(fvm.Context, fvm.Procedure, state.Ledger) error
}

Jump to

Keyboard shortcuts

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