snapshot

package
v0.0.0-...-bda353b Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory struct {
}

func (*Factory) NewSnapshotEvidenceMgr

func (f *Factory) NewSnapshotEvidenceMgr(blockchainStore protocol.BlockchainStore,
	log protocol.Logger) protocol.SnapshotManager

func (*Factory) NewSnapshotManager

func (f *Factory) NewSnapshotManager(blockchainStore protocol.BlockchainStore,
	log protocol.Logger) protocol.SnapshotManager

type ManagerDelegate

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

type ManagerEvidence

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

func (*ManagerEvidence) ClearSnapshot

func (m *ManagerEvidence) ClearSnapshot(block *commonPb.Block) error

func (*ManagerEvidence) GetSnapshot

func (m *ManagerEvidence) GetSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot

Get a Snapshot from SnapshotManager for read, don't modify any data.

func (*ManagerEvidence) NewSnapshot

func (m *ManagerEvidence) NewSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot

When generating blocks, generate a Snapshot for each block, which is used as read-write set cache

func (*ManagerEvidence) NotifyBlockCommitted

func (m *ManagerEvidence) NotifyBlockCommitted(block *commonPb.Block) error

type ManagerImpl

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

func (*ManagerImpl) ClearSnapshot

func (m *ManagerImpl) ClearSnapshot(block *commonPb.Block) error

func (*ManagerImpl) GetSnapshot

func (m *ManagerImpl) GetSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot

Get a Snapshot from SnapshotManager for read, don't modify any data.

func (*ManagerImpl) NewSnapshot

func (m *ManagerImpl) NewSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot

When generating blocks, generate a Snapshot for each block, which is used as read-write set cache

func (*ManagerImpl) NotifyBlockCommitted

func (m *ManagerImpl) NotifyBlockCommitted(block *commonPb.Block) error

type SnapshotEvidence

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

func (*SnapshotEvidence) ApplyBlock

func (s *SnapshotEvidence) ApplyBlock(block *commonPb.Block, txRWSetMap map[string]*commonPb.TxRWSet)

func (*SnapshotEvidence) ApplyTxSimContext

func (s *SnapshotEvidence) ApplyTxSimContext(txSimContext protocol.TxSimContext, specialTxType protocol.ExecOrderTxType,
	runVmSuccess bool, withSpecialTx bool) (bool, int)

After the read-write set is generated, add TxSimContext to the snapshot return if apply successfully or not, and current applied tx num

func (*SnapshotEvidence) BuildDAG

func (s *SnapshotEvidence) BuildDAG(isSql bool, txRWSetTable []*commonPb.TxRWSet) *commonPb.DAG

According to the read-write table, the read-write dependency is checked from back to front to determine whether the transaction can be executed concurrently. From the process of building the read-write table, we have known that every transaction is based on a known world state, or cache state. As long as the world state or cache state that the tx depends on does not change during the execution, then the execution result of the transaction is determined. We need to ensure that when validating the DAG, there is no possibility that the execution of other transactions will affect the dependence of the current transaction

func (*SnapshotEvidence) GetBlockFingerprint

func (s *SnapshotEvidence) GetBlockFingerprint() string

GetBlockFingerprint returns current block fingerprint

func (*SnapshotEvidence) GetBlockHeight

func (s *SnapshotEvidence) GetBlockHeight() uint64

get block height for current snapshot

func (*SnapshotEvidence) GetBlockProposer

func (s *SnapshotEvidence) GetBlockProposer() *accesscontrol.Participant

Get Block Proposer for current snapshot

func (*SnapshotEvidence) GetBlockTimestamp

func (s *SnapshotEvidence) GetBlockTimestamp() int64

get block height for current snapshot

func (*SnapshotEvidence) GetBlockchainStore

func (s *SnapshotEvidence) GetBlockchainStore() protocol.BlockchainStore

func (*SnapshotEvidence) GetKey

func (s *SnapshotEvidence) GetKey(txExecSeq int, contractName string, key []byte) ([]byte, error)

func (*SnapshotEvidence) GetKeys

func (s *SnapshotEvidence) GetKeys(txExecSeq int, keys []*vmPb.BatchKey) ([]*vmPb.BatchKey, error)

func (*SnapshotEvidence) GetPreSnapshot

func (s *SnapshotEvidence) GetPreSnapshot() protocol.Snapshot

func (*SnapshotEvidence) GetSnapshotSize

func (s *SnapshotEvidence) GetSnapshotSize() int

func (*SnapshotEvidence) GetSpecialTxTable

func (s *SnapshotEvidence) GetSpecialTxTable() []*commonPb.Transaction

func (*SnapshotEvidence) GetTxRWSetTable

func (s *SnapshotEvidence) GetTxRWSetTable() []*commonPb.TxRWSet

func (*SnapshotEvidence) GetTxResultMap

func (s *SnapshotEvidence) GetTxResultMap() map[string]*commonPb.Result

After the scheduling is completed, get the result from the current snapshot

func (*SnapshotEvidence) GetTxTable

func (s *SnapshotEvidence) GetTxTable() []*commonPb.Transaction

func (*SnapshotEvidence) IsSealed

func (s *SnapshotEvidence) IsSealed() bool

check if snapshot is sealed

func (*SnapshotEvidence) Seal

func (s *SnapshotEvidence) Seal()

seal the snapshot

func (*SnapshotEvidence) SetBlockFingerprint

func (s *SnapshotEvidence) SetBlockFingerprint(fp utils.BlockFingerPrint)

SetBlockFingerprint set block fingerprint

func (*SnapshotEvidence) SetPreSnapshot

func (s *SnapshotEvidence) SetPreSnapshot(snapshot protocol.Snapshot)

type SnapshotImpl

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

func NewQuerySnapshot

func NewQuerySnapshot(store protocol.BlockchainStore, log protocol.Logger) (*SnapshotImpl, error)

NewQuerySnapshot create a snapshot for query tx

func (*SnapshotImpl) ApplyBlock

func (s *SnapshotImpl) ApplyBlock(block *commonPb.Block, txRWSetMap map[string]*commonPb.TxRWSet)

func (*SnapshotImpl) ApplyTxSimContext

func (s *SnapshotImpl) ApplyTxSimContext(txSimContext protocol.TxSimContext, specialTxType protocol.ExecOrderTxType,
	runVmSuccess bool, applySpecialTx bool) (bool, int)

ApplyTxSimContext add TxSimContext to the snapshot, return current applied tx num whether success of not

func (*SnapshotImpl) BuildDAG

func (s *SnapshotImpl) BuildDAG(isSql bool, txRWSetTable []*commonPb.TxRWSet) *commonPb.DAG

BuildDAG build the block dag according to the read-write table

func (*SnapshotImpl) GetBlockFingerprint

func (s *SnapshotImpl) GetBlockFingerprint() string

GetBlockFingerprint returns current block fingerprint

func (*SnapshotImpl) GetBlockHeight

func (s *SnapshotImpl) GetBlockHeight() uint64

GetBlockHeight returns current block height

func (*SnapshotImpl) GetBlockProposer

func (s *SnapshotImpl) GetBlockProposer() *accesscontrol.Participant

GetBlockProposer for current snapshot

func (*SnapshotImpl) GetBlockTimestamp

func (s *SnapshotImpl) GetBlockTimestamp() int64

GetBlockTimestamp returns current block timestamp

func (*SnapshotImpl) GetBlockchainStore

func (s *SnapshotImpl) GetBlockchainStore() protocol.BlockchainStore

GetBlockchainStore return the blockchainStore of the snapshot

func (*SnapshotImpl) GetKey

func (s *SnapshotImpl) GetKey(txExecSeq int, contractName string, key []byte) ([]byte, error)

GetKey from snapshot

func (*SnapshotImpl) GetKeys

func (s *SnapshotImpl) GetKeys(txExecSeq int, keys []*vmPb.BatchKey) ([]*vmPb.BatchKey, error)

GetKeys from snapshot

func (*SnapshotImpl) GetPreSnapshot

func (s *SnapshotImpl) GetPreSnapshot() protocol.Snapshot

GetPreSnapshot previous snapshot

func (*SnapshotImpl) GetSnapshotSize

func (s *SnapshotImpl) GetSnapshotSize() int

GetSnapshotSize return the len of the txTable

func (*SnapshotImpl) GetSpecialTxTable

func (s *SnapshotImpl) GetSpecialTxTable() []*commonPb.Transaction

GetSpecialTxTable return the specialTxTable of the snapshot

func (*SnapshotImpl) GetTxRWSetTable

func (s *SnapshotImpl) GetTxRWSetTable() []*commonPb.TxRWSet

GetTxRWSetTable return the snapshot's txRWSetTable

func (*SnapshotImpl) GetTxResultMap

func (s *SnapshotImpl) GetTxResultMap() map[string]*commonPb.Result

GetTxResultMap After the scheduling is completed, get the result from the current snapshot

func (*SnapshotImpl) GetTxTable

func (s *SnapshotImpl) GetTxTable() []*commonPb.Transaction

GetTxTable return the txTable of the snapshot

func (*SnapshotImpl) IsSealed

func (s *SnapshotImpl) IsSealed() bool

IsSealed check if snapshot is sealed

func (*SnapshotImpl) Seal

func (s *SnapshotImpl) Seal()

Seal the snapshot

func (*SnapshotImpl) SetBlockFingerprint

func (s *SnapshotImpl) SetBlockFingerprint(fp utils.BlockFingerPrint)

SetBlockFingerprint set block fingerprint

func (*SnapshotImpl) SetPreSnapshot

func (s *SnapshotImpl) SetPreSnapshot(snapshot protocol.Snapshot)

SetPreSnapshot previous snapshot

Jump to

Keyboard shortcuts

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