Documentation ¶
Index ¶
- func GetAllSignatures(batch *database.Batch, transaction *database.Transaction, ...) ([]protocol.Signature, error)
- func GetSignaturesForSigner(batch *database.Batch, transaction *database.Transaction, ...) ([]protocol.Signature, error)
- type Block
- type BlockMeta
- type BlockState
- type Executor
- func (x *Executor) AuthorityIsSatisfied(batch *database.Batch, transaction *protocol.Transaction, ...) (bool, error)
- func (x *Executor) BeginBlock(block *Block) (err error)
- func (m *Executor) EndBlock(block *Block) error
- func (x *Executor) ExecuteEnvelope(block *Block, delivery *chain.Delivery) (*protocol.TransactionStatus, error)
- func (m *Executor) Genesis(block *Block, exec chain.TransactionExecutor) error
- func (*Executor) GetAccountAuthoritySet(batch *database.Batch, account protocol.Account) (*protocol.AccountAuth, error)
- func (m *Executor) InitFromGenesis(batch *database.Batch, data []byte) error
- func (m *Executor) InitFromSnapshot(batch *database.Batch, file ioutil2.SectionReader) error
- func (m *Executor) LoadStateRoot(batch *database.Batch) ([]byte, error)
- func (x *Executor) ProcessRemoteSignatures(block *Block, delivery *chain.Delivery) error
- func (x *Executor) ProcessSignature(batch *database.Batch, delivery *chain.Delivery, signature protocol.Signature) (*ProcessSignatureState, error)
- func (x *Executor) ProcessTransaction(batch *database.Batch, delivery *chain.Delivery) (*protocol.TransactionStatus, *chain.ProcessTransactionState, error)
- func (x *Executor) ProduceSynthetic(batch *database.Batch, from *protocol.Transaction, ...) error
- func (m *Executor) Query(batch *database.Batch, q query.Request, _ int64, prove bool) (k, v []byte, _ *protocol.Error)
- func (m *Executor) SaveSnapshot(batch *database.Batch, file io.WriteSeeker) error
- func (x *Executor) SignerIsAuthorized(batch *database.Batch, transaction *protocol.Transaction, ...) error
- func (x *Executor) SignerIsSatisfied(batch *database.Batch, transaction *protocol.Transaction, ...) (bool, error)
- func (x *Executor) TransactionIsReady(batch *database.Batch, transaction *protocol.Transaction, ...) (bool, error)
- func (x *Executor) ValidateEnvelope(batch *database.Batch, delivery *chain.Delivery) (protocol.TransactionResult, error)
- type ExecutorOptions
- type ProcessSignatureState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllSignatures ¶
func GetAllSignatures(batch *database.Batch, transaction *database.Transaction, status *protocol.TransactionStatus, txnInitHash []byte) ([]protocol.Signature, error)
Types ¶
type BlockMeta ¶
type BlockMeta struct { IsLeader bool Index uint64 Time time.Time CommitInfo *types.LastCommitInfo Evidence []types.Evidence }
BlockMeta is metadata about a block.
type BlockState ¶
type BlockState struct { Delivered uint64 Signed uint64 SynthSigned uint64 SynthSent uint64 ValidatorsUpdates []chain.ValidatorUpdate ProducedTxns []*protocol.Transaction ChainUpdates chain.ChainUpdates }
BlockState tracks various metrics of a block of transactions as they are executed.
func (*BlockState) Empty ¶
func (s *BlockState) Empty() bool
Empty returns true if nothing happened during the block.
func (*BlockState) MergeSignature ¶
func (s *BlockState) MergeSignature(r *ProcessSignatureState)
func (*BlockState) MergeTransaction ¶
func (s *BlockState) MergeTransaction(r *chain.ProcessTransactionState)
type Executor ¶
type Executor struct { ExecutorOptions // contains filtered or unexported fields }
func NewGenesisExecutor ¶
func NewGenesisExecutor(db *database.Database, logger log.Logger, network config.Network, router routing.Router) (*Executor, error)
NewGenesisExecutor creates a transaction executor that can be used to set up the genesis state.
func NewNodeExecutor ¶
func NewNodeExecutor(opts ExecutorOptions, db *database.Database) (*Executor, error)
NewNodeExecutor creates a new Executor for a node.
func (*Executor) AuthorityIsSatisfied ¶ added in v1.0.0
func (*Executor) BeginBlock ¶
BeginBlock implements ./Chain
func (*Executor) ExecuteEnvelope ¶ added in v0.6.0
func (*Executor) Genesis ¶
func (m *Executor) Genesis(block *Block, exec chain.TransactionExecutor) error
func (*Executor) GetAccountAuthoritySet ¶ added in v1.0.0
func (*Executor) InitFromGenesis ¶
func (*Executor) InitFromSnapshot ¶
func (*Executor) LoadStateRoot ¶ added in v1.0.0
func (*Executor) ProcessRemoteSignatures ¶ added in v0.6.0
func (*Executor) ProcessSignature ¶
func (*Executor) ProcessTransaction ¶
func (x *Executor) ProcessTransaction(batch *database.Batch, delivery *chain.Delivery) (*protocol.TransactionStatus, *chain.ProcessTransactionState, error)
ProcessTransaction processes a transaction. It will not return an error if the transaction fails - in that case the status code will be non zero. It only returns an error in cases like a database failure.
func (*Executor) ProduceSynthetic ¶
func (x *Executor) ProduceSynthetic(batch *database.Batch, from *protocol.Transaction, produced []*protocol.Transaction) error
func (*Executor) SaveSnapshot ¶
func (*Executor) SignerIsAuthorized ¶ added in v1.0.0
func (x *Executor) SignerIsAuthorized(batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer, checkAuthz bool) error
SignerIsAuthorized verifies that the signer is allowed to sign the transaction
func (*Executor) SignerIsSatisfied ¶ added in v1.0.0
func (*Executor) TransactionIsReady ¶ added in v0.6.0
func (x *Executor) TransactionIsReady(batch *database.Batch, transaction *protocol.Transaction, status *protocol.TransactionStatus) (bool, error)
func (*Executor) ValidateEnvelope ¶
func (x *Executor) ValidateEnvelope(batch *database.Batch, delivery *chain.Delivery) (protocol.TransactionResult, error)
ValidateEnvelope verifies that the envelope is valid. It checks the basics, like the envelope has signatures and a hash and/or a transaction. It validates signatures, ensuring they match the transaction hash, reference a signator, etc. And more.
ValidateEnvelope should not modify anything. Right now it updates signer timestamps and credits, but that will be moved to ProcessSignature.
type ExecutorOptions ¶
type ProcessSignatureState ¶
type ProcessSignatureState struct { }
func (*ProcessSignatureState) Merge ¶
func (s *ProcessSignatureState) Merge(r *ProcessSignatureState)