Documentation ¶
Index ¶
- type Block
- type BlockAnchorState
- type BlockMeta
- type BlockState
- type BlockTimerType
- type Executor
- func (m *Executor) ActiveGlobals_TESTONLY() *core.GlobalValues
- func (x *Executor) AuthorityIsSatisfied(batch *database.Batch, transaction *protocol.Transaction, ...) (bool, error)
- func (x *Executor) BeginBlock(block *Block) error
- func (m *Executor) EnableTimers()
- func (m *Executor) EndBlock(block *Block) error
- func (x *Executor) ExecuteEnvelope(block *Block, delivery *chain.Delivery) (*protocol.TransactionStatus, error)
- func (x *Executor) ExecuteEnvelopeSet(block *Block, deliveries []*chain.Delivery, ...) []*protocol.TransactionStatus
- func (m *Executor) Genesis(block *Block, exec chain.TransactionExecutor) error
- func (x *Executor) GetAccountAuthoritySet(batch *database.Batch, account protocol.Account) (*protocol.AccountAuth, error)
- func (x *Executor) InitChainValidators(initVal []abci.ValidatorUpdate) (additional [][]byte, err 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) RestoreSnapshot(db database.Beginner, file ioutil2.SectionReader) error
- func (x *Executor) SetExecutor_TESTONLY(y chain.TransactionExecutor)
- 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, delivery *chain.Delivery, ...) (bool, error)
- func (x *Executor) ValidateEnvelope(batch *database.Batch, delivery *chain.Delivery) (protocol.TransactionResult, error)
- func (x *Executor) ValidateEnvelopeSet(batch *database.Batch, deliveries []*chain.Delivery, ...) []*protocol.TransactionStatus
- func (x *Executor) ValidateSignature(batch *database.Batch, delivery *chain.Delivery, ...) error
- type ExecutorOptions
- type Globals
- type ProcessSignatureState
- type TimerRecord
- type TimerSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockAnchorState ¶ added in v1.0.0
BlockAnchorState is used to construc the anchor for the block.
type BlockMeta ¶
type BlockMeta struct { IsLeader bool Index uint64 Time time.Time CommitInfo *types.CommitInfo Evidence []types.Misbehavior }
BlockMeta is metadata about a block.
type BlockState ¶
type BlockState struct { OpenedMajorBlock bool MakeMajorBlock uint64 MakeMajorBlockTime time.Time Delivered uint64 Signed uint64 ProducedTxns []*protocol.Transaction ChainUpdates chain.ChainUpdates ReceivedAnchors []*chain.ReceivedAnchor Anchor *BlockAnchorState }
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 BlockTimerType ¶ added in v1.0.0
type BlockTimerType uint64
const BlockTimerTypeBeginBlock BlockTimerType = 2
BlockTimerTypeBeginBlock .
const BlockTimerTypeCheckTx BlockTimerType = 3
BlockTimerTypeCheckTx .
const BlockTimerTypeCommit BlockTimerType = 6
BlockTimerTypeCommit .
const BlockTimerTypeDeliverTx BlockTimerType = 4
BlockTimerTypeDeliverTx .
const BlockTimerTypeEndBlock BlockTimerType = 5
BlockTimerTypeEndBlock .
const BlockTimerTypeExecuteEnvelope BlockTimerType = 0
BlockTimerTypeExecuteEnvelope .
const BlockTimerTypeNetworkAccountUpdates BlockTimerType = 8
BlockTimerTypeNetworkAccountUpdates .
const BlockTimerTypeProcessRemoteSignatures BlockTimerType = 9
BlockTimerTypeProcessRemoteSignatures .
const BlockTimerTypeProcessSignature BlockTimerType = 1
BlockTimerTypeProcessSignature .
const BlockTimerTypeProcessTransaction BlockTimerType = 10
BlockTimerTypeProcessTransaction .
const BlockTimerTypeSigning BlockTimerType = 7
BlockTimerTypeSigning .
const BlockTimerTypeTransactionOffset BlockTimerType = 240
BlockTimerTypeTransactionOffset .
func BlockTimerTypeByName ¶ added in v1.0.0
func BlockTimerTypeByName(name string) (BlockTimerType, bool)
BlockTimerTypeByName returns the named Block Timer Type.
func (BlockTimerType) GetEnumValue ¶ added in v1.0.0
func (v BlockTimerType) GetEnumValue() uint64
GetEnumValue returns the value of the Block Timer Type
func (BlockTimerType) MarshalJSON ¶ added in v1.0.0
func (v BlockTimerType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Block Timer Type to JSON as a string.
func (*BlockTimerType) SetEnumValue ¶ added in v1.0.0
func (v *BlockTimerType) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (BlockTimerType) String ¶ added in v1.0.0
func (v BlockTimerType) String() string
String returns the name of the Block Timer Type.
func (*BlockTimerType) UnmarshalJSON ¶ added in v1.0.0
func (v *BlockTimerType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Block Timer Type from JSON as a string.
type Executor ¶
type Executor struct { ExecutorOptions // contains filtered or unexported fields }
func NewGenesisExecutor ¶
func NewGenesisExecutor(db *database.Database, logger log.Logger, network *config.Describe, globals *core.GlobalValues, 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.Beginner) (*Executor, error)
NewNodeExecutor creates a new Executor for a node.
func (*Executor) ActiveGlobals_TESTONLY ¶ added in v1.0.0
func (m *Executor) ActiveGlobals_TESTONLY() *core.GlobalValues
func (*Executor) AuthorityIsSatisfied ¶ added in v1.0.0
func (*Executor) BeginBlock ¶
BeginBlock implements ./Chain
func (*Executor) EnableTimers ¶ added in v1.0.0
func (m *Executor) EnableTimers()
func (*Executor) ExecuteEnvelope ¶ added in v0.6.0
func (*Executor) ExecuteEnvelopeSet ¶ added in v1.0.0
func (*Executor) Genesis ¶
func (m *Executor) Genesis(block *Block, exec chain.TransactionExecutor) error
func (*Executor) GetAccountAuthoritySet ¶ added in v1.0.0
func (*Executor) InitChainValidators ¶ added in v1.0.0
func (x *Executor) InitChainValidators(initVal []abci.ValidatorUpdate) (additional [][]byte, err error)
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) RestoreSnapshot ¶ added in v1.0.0
func (*Executor) SetExecutor_TESTONLY ¶ added in v1.0.0
func (x *Executor) SetExecutor_TESTONLY(y chain.TransactionExecutor)
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 (*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.
func (*Executor) ValidateEnvelopeSet ¶ added in v1.0.0
type ExecutorOptions ¶
type ExecutorOptions struct { Logger log.Logger // Key ed25519.PrivateKey // Private validator key Router routing.Router // Describe config.Describe // Network description EventBus *events.Bus // MajorBlockScheduler blockscheduler.MajorBlockScheduler // Background func(func()) // Background task launcher BlockTimers TimerSet // contains filtered or unexported fields }
type Globals ¶ added in v1.0.0
type Globals struct {
Active, Pending core.GlobalValues
}
type ProcessSignatureState ¶
type ProcessSignatureState struct { }
func (*ProcessSignatureState) Merge ¶
func (s *ProcessSignatureState) Merge(r *ProcessSignatureState)
type TimerRecord ¶ added in v1.0.0
type TimerRecord struct {
// contains filtered or unexported fields
}
type TimerSet ¶ added in v1.0.0
type TimerSet struct {
// contains filtered or unexported fields
}
func (*TimerSet) Initialize ¶ added in v1.0.0
func (t *TimerSet) Initialize(executors *map[protocol.TransactionType]chain.TransactionExecutor)
func (*TimerSet) Start ¶ added in v1.0.0
func (t *TimerSet) Start(record any) *TimerRecord
func (*TimerSet) Stop ¶ added in v1.0.0
func (t *TimerSet) Stop(r *TimerRecord)