fuzz

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OpRead       = 8
	OpCheckProof = 4
	OpWrite      = 1
	OpDelete     = 0
)
View Source
const (
	FirstByteOfCacheableKey = byte(105)
)

==============================

Variables

View Source
var (
	GuardStart = []byte{0, 0, 0, 0, 0, 0, 0, 0}
	GuardEnd   = []byte{255, 255, 255, 255, 255, 255, 255, 255}
)
View Source
var DBG bool

Functions

func CheckTx

func CheckTx(height, epochNum, txNum int, mads *moeingads.MoeingADS, rbt rabbit.RabbitStore, tx *Tx, cfg *FuzzConfig, blkSuc bool)

func ExecuteBlock

func ExecuteBlock(height int, mads *moeingads.MoeingADS, root storetypes.RootStoreI, block *Block, cfg *FuzzConfig, inParallel bool) (retry bool)

func MyGet

func MyGet(rbt rabbit.RabbitStore, key []byte) []byte

Types

type Block

type Block struct {
	EpochList   []Epoch
	Succeed     bool
	PanicNumber int
}

func GenerateRandBlock

func GenerateRandBlock(height int, ref *RefL1, rs randsrc.RandSrc, cfg *FuzzConfig) *Block

type Epoch

type Epoch struct {
	TxList []*Tx
}

func GenerateRandEpoch

func GenerateRandEpoch(height, epochNum int, ref *RefL1, rs randsrc.RandSrc, cfg *FuzzConfig, blkSuc bool) Epoch

type FuzzConfig

type FuzzConfig struct {
	MaxReadCountInTx       uint32
	MaxCheckProofCountInTx uint32
	MaxWriteCountInTx      uint32
	MaxDeleteCountInTx     uint32
	MaxTxCountInEpoch      uint32
	MaxEpochCountInBlock   uint32
	EffectiveBits          uint64
	MaxValueLength         int
	MaxActiveCount         int
	TxSucceedRatio         float32
	BlockSucceedRatio      float32
	BlockPanicRatio        float32
	RootType               string //MockRoot MockDataTree Real
	ConsistencyEveryNBlock int
	PruneEveryNBlock       int
	KeepRecentNBlock       int
	ReloadEveryNBlock      int
}

type Operation

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

type Pair

type Pair struct {
	Key, Value []byte
}

type RefL1 added in v0.3.0

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

func NewRefL1 added in v0.3.0

func NewRefL1() *RefL1

func (*RefL1) ClearCache added in v0.3.0

func (r *RefL1) ClearCache()

func (*RefL1) Delete added in v0.3.0

func (r *RefL1) Delete(key []byte)

func (*RefL1) FlushCache added in v0.3.0

func (r *RefL1) FlushCache()

func (*RefL1) Get added in v0.3.0

func (r *RefL1) Get(key []byte) []byte

func (*RefL1) Set added in v0.3.0

func (r *RefL1) Set(key, value []byte)

func (*RefL1) Size added in v0.3.0

func (r *RefL1) Size() int

type RefL2 added in v0.3.0

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

func NewRefL2 added in v0.3.0

func NewRefL2(r *RefL1) *RefL2

func (*RefL2) Close added in v0.3.0

func (r *RefL2) Close(writeBack bool)

func (*RefL2) Delete added in v0.3.0

func (r *RefL2) Delete(key []byte)

func (*RefL2) Get added in v0.3.0

func (r *RefL2) Get(key []byte) []byte

func (*RefL2) Set added in v0.3.0

func (r *RefL2) Set(key, value []byte)

type Tx

type Tx struct {
	OpList  []Operation
	Succeed bool
}

func GenerateRandTx

func GenerateRandTx(ref *RefL1, rs randsrc.RandSrc, cfg *FuzzConfig, touchedKeys map[uint64]struct{}) *Tx

Jump to

Keyboard shortcuts

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