Documentation ¶
Index ¶
- type Factory
- type ManagerDelegate
- type ManagerEvidence
- func (m *ManagerEvidence) ClearSnapshot(block *commonPb.Block) error
- func (m *ManagerEvidence) GetSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot
- func (m *ManagerEvidence) NewSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot
- func (m *ManagerEvidence) NotifyBlockCommitted(block *commonPb.Block) error
- type ManagerImpl
- func (m *ManagerImpl) ClearSnapshot(block *commonPb.Block) error
- func (m *ManagerImpl) GetSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot
- func (m *ManagerImpl) NewSnapshot(prevBlock *commonPb.Block, block *commonPb.Block) protocol.Snapshot
- func (m *ManagerImpl) NotifyBlockCommitted(block *commonPb.Block) error
- type SnapshotEvidence
- func (s *SnapshotEvidence) ApplyBlock(block *commonPb.Block, txRWSetMap map[string]*commonPb.TxRWSet)
- func (s *SnapshotEvidence) ApplyTxSimContext(txSimContext protocol.TxSimContext, specialTxType protocol.ExecOrderTxType, ...) (bool, int)
- func (s *SnapshotEvidence) BuildDAG(isSql bool, txRWSetTable []*commonPb.TxRWSet) *commonPb.DAG
- func (s *SnapshotEvidence) GetBlockFingerprint() string
- func (s *SnapshotEvidence) GetBlockHeight() uint64
- func (s *SnapshotEvidence) GetBlockProposer() *accesscontrol.Participant
- func (s *SnapshotEvidence) GetBlockTimestamp() int64
- func (s *SnapshotEvidence) GetBlockchainStore() protocol.BlockchainStore
- func (s *SnapshotEvidence) GetKey(txExecSeq int, contractName string, key []byte) ([]byte, error)
- func (s *SnapshotEvidence) GetKeys(txExecSeq int, keys []*vmPb.BatchKey) ([]*vmPb.BatchKey, error)
- func (s *SnapshotEvidence) GetPreSnapshot() protocol.Snapshot
- func (s *SnapshotEvidence) GetSnapshotSize() int
- func (s *SnapshotEvidence) GetSpecialTxTable() []*commonPb.Transaction
- func (s *SnapshotEvidence) GetTxRWSetTable() []*commonPb.TxRWSet
- func (s *SnapshotEvidence) GetTxResultMap() map[string]*commonPb.Result
- func (s *SnapshotEvidence) GetTxTable() []*commonPb.Transaction
- func (s *SnapshotEvidence) IsSealed() bool
- func (s *SnapshotEvidence) Seal()
- func (s *SnapshotEvidence) SetBlockFingerprint(fp utils.BlockFingerPrint)
- func (s *SnapshotEvidence) SetPreSnapshot(snapshot protocol.Snapshot)
- type SnapshotImpl
- func (s *SnapshotImpl) ApplyBlock(block *commonPb.Block, txRWSetMap map[string]*commonPb.TxRWSet)
- func (s *SnapshotImpl) ApplyTxSimContext(txSimContext protocol.TxSimContext, specialTxType protocol.ExecOrderTxType, ...) (bool, int)
- func (s *SnapshotImpl) BuildDAG(isSql bool, txRWSetTable []*commonPb.TxRWSet) *commonPb.DAG
- func (s *SnapshotImpl) GetBlockFingerprint() string
- func (s *SnapshotImpl) GetBlockHeight() uint64
- func (s *SnapshotImpl) GetBlockProposer() *accesscontrol.Participant
- func (s *SnapshotImpl) GetBlockTimestamp() int64
- func (s *SnapshotImpl) GetBlockchainStore() protocol.BlockchainStore
- func (s *SnapshotImpl) GetKey(txExecSeq int, contractName string, key []byte) ([]byte, error)
- func (s *SnapshotImpl) GetKeys(txExecSeq int, keys []*vmPb.BatchKey) ([]*vmPb.BatchKey, error)
- func (s *SnapshotImpl) GetPreSnapshot() protocol.Snapshot
- func (s *SnapshotImpl) GetSnapshotSize() int
- func (s *SnapshotImpl) GetSpecialTxTable() []*commonPb.Transaction
- func (s *SnapshotImpl) GetTxRWSetTable() []*commonPb.TxRWSet
- func (s *SnapshotImpl) GetTxResultMap() map[string]*commonPb.Result
- func (s *SnapshotImpl) GetTxTable() []*commonPb.Transaction
- func (s *SnapshotImpl) IsSealed() bool
- func (s *SnapshotImpl) Seal()
- func (s *SnapshotImpl) SetBlockFingerprint(fp utils.BlockFingerPrint)
- func (s *SnapshotImpl) SetPreSnapshot(snapshot protocol.Snapshot)
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 (*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 ¶
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) 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) 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 (*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) 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) 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) 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