validationresults

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cache

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

Cache is a cache of validation results segmented by TxFlags. One or more peers will validate a certain subset of transactions within a block. If two peers, say, validate the same set of transactions and come up with the exact same results then both of the results will be added to the same segment under the block.

func NewCache

func NewCache() *Cache

NewCache returns a new validation results cache

func (*Cache) Add

func (c *Cache) Add(result *Results) []*Results

Add adds the given validation result to the cache under the appropriate block/segment and returns all validation results for the segment.

func (*Cache) Remove

func (c *Cache) Remove(blockNum uint64) []*Results

Remove removes validation results for the given block and deletes the results from any previous block TODO: Delete all previous blocks

type Results

type Results struct {
	BlockNumber uint64
	TxFlags     txflags.ValidationFlags
	TxIDs       []string
	Err         string
	Endpoint    string // Endpoint is the endpoint of the peer that provided the results.
	Local       bool   // If true then that means the results were generated locally and policy validation is not required
	MSPID       string
	Signature   []byte
	Identity    []byte
}

Results contains the validation results for the given block number.

func (*Results) String

func (vr *Results) String() string

Results returns a string representation of the validation results (used in logging).

Jump to

Keyboard shortcuts

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