Documentation ¶
Index ¶
- type AuthoritySignature
- type Block
- type BlockAnchor
- type BlockAnchorState
- type BlockState
- func (s *BlockState) Empty() bool
- func (s *BlockState) GetPending() []*url.TxID
- func (s *BlockState) MarkTransactionDelivered(id *url.TxID)
- func (s *BlockState) MarkTransactionPending(id *url.TxID)
- func (s *BlockState) MergeSignature(r *ProcessSignatureState)
- func (s *BlockState) MergeTransaction(r *chain.ProcessTransactionState)
- type BlockTimerType
- type CreditPayment
- type Dispatcher
- type Executor
- func (m *Executor) ActiveGlobals_TESTONLY() *core.GlobalValues
- func (x *Executor) Begin(params execute.BlockParams) (_ execute.Block, err error)
- func (m *Executor) EnableTimers()
- func (m *Executor) EndBlock(block *Block) error
- func (x *Executor) Init(validators []*execute.ValidatorUpdate) (additional []*execute.ValidatorUpdate, err error)
- func (x *Executor) LastBlock() (*execute.BlockParams, [32]byte, error)
- func (x *Executor) SetExecutor_TESTONLY(y chain.TransactionExecutor)
- func (m *Executor) StoreBlockTimers(ds *logging.DataSet)
- func (x *Executor) Validate(envelope *messaging.Envelope, _ bool) ([]*protocol.TransactionStatus, error)
- type ExecutorFor
- type ExecutorOptions
- type ExpiredTransaction
- type Globals
- type MessageContext
- func (m *MessageContext) AuthorityDidVote(batch *database.Batch, transaction *protocol.Transaction, authUrl *url.URL) (bool, protocol.VoteType, error)
- func (m *MessageContext) AuthorityWillVote(batch *database.Batch, block uint64, transaction *protocol.Transaction, ...) (*chain.AuthVote, error)
- func (*MessageContext) GetAccountAuthoritySet(batch *database.Batch, account protocol.Account) (*protocol.AccountAuth, error)
- func (m *MessageContext) GetActiveGlobals() *core.GlobalValues
- func (b MessageContext) GetSignatureAs(batch *database.Batch, hash [32]byte) (protocol.Signature, error)
- func (*MessageContext) SignerCanSign(batch *database.Batch, transaction *protocol.Transaction, ...) error
- func (m *MessageContext) SignerWillVote(batch *database.Batch, block uint64, transaction *protocol.Transaction, ...) (bool, protocol.VoteType, error)
- func (*MessageContext) TransactionIsInitiated(batch *database.Batch, transaction *protocol.Transaction) (bool, *messaging.CreditPayment, error)
- func (m *MessageContext) Type() messaging.MessageType
- type MessageExecutor
- type MessageIsReady
- type NetworkUpdate
- type ProcessSignatureState
- type ProducedMessage
- type PseudoSynthetic
- type SequencedMessage
- type SignatureContext
- type SignatureExecutor
- type SignatureMessage
- type SignatureRequest
- type SyntheticMessage
- type TimerRecord
- type TimerSet
- type TransactionContext
- type TransactionMessage
- type UserSignature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthoritySignature ¶
type AuthoritySignature struct{}
AuthoritySignature processes delegated signatures.
func (AuthoritySignature) Process ¶
func (x AuthoritySignature) Process(batch *database.Batch, ctx *SignatureContext) (_ *protocol.TransactionStatus, err error)
func (AuthoritySignature) Validate ¶
func (x AuthoritySignature) Validate(batch *database.Batch, ctx *SignatureContext) (*protocol.TransactionStatus, error)
type Block ¶
type Block struct { execute.BlockParams State BlockState Batch *database.Batch Executor *Executor }
Block implements execute.Block.
func (*Block) Close ¶
func (b *Block) Close() (execute.BlockState, error)
Close ends the block and returns the block state.
func (*Block) Params ¶
func (b *Block) Params() execute.BlockParams
type BlockAnchor ¶
type BlockAnchor struct{}
BlockAnchor executes the signature, queuing the transaction for processing when appropriate.
func (BlockAnchor) Process ¶
func (x BlockAnchor) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (BlockAnchor) Validate ¶
func (x BlockAnchor) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type BlockAnchorState ¶
BlockAnchorState is used to construc the anchor for the block.
type BlockState ¶
type BlockState struct { OpenedMajorBlock bool MakeMajorBlock uint64 MakeMajorBlockTime time.Time Delivered uint64 Signed uint64 Produced int ChainUpdates chain.ChainUpdates ReceivedAnchors []*chain.ReceivedAnchor Anchor *BlockAnchorState Pending map[[32]byte]*url.TxID Events int }
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) GetPending ¶ added in v1.2.0
func (s *BlockState) GetPending() []*url.TxID
func (*BlockState) MarkTransactionDelivered ¶ added in v1.2.0
func (s *BlockState) MarkTransactionDelivered(id *url.TxID)
func (*BlockState) MarkTransactionPending ¶ added in v1.2.0
func (s *BlockState) MarkTransactionPending(id *url.TxID)
func (*BlockState) MergeSignature ¶
func (s *BlockState) MergeSignature(r *ProcessSignatureState)
func (*BlockState) MergeTransaction ¶
func (s *BlockState) MergeTransaction(r *chain.ProcessTransactionState)
type BlockTimerType ¶
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 ¶
func BlockTimerTypeByName(name string) (BlockTimerType, bool)
BlockTimerTypeByName returns the named Block Timer Type.
func (BlockTimerType) GetEnumValue ¶
func (v BlockTimerType) GetEnumValue() uint64
GetEnumValue returns the value of the Block Timer Type
func (BlockTimerType) MarshalJSON ¶
func (v BlockTimerType) MarshalJSON() ([]byte, error)
MarshalJSON marshals the Block Timer Type to JSON as a string.
func (*BlockTimerType) SetEnumValue ¶
func (v *BlockTimerType) SetEnumValue(id uint64) bool
SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.
func (BlockTimerType) String ¶
func (v BlockTimerType) String() string
String returns the name of the Block Timer Type.
func (*BlockTimerType) UnmarshalJSON ¶
func (v *BlockTimerType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals the Block Timer Type from JSON as a string.
type CreditPayment ¶
type CreditPayment struct{}
CreditPayment processes a credit payment
func (CreditPayment) Process ¶
func (x CreditPayment) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (CreditPayment) Validate ¶
func (x CreditPayment) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type Dispatcher ¶
type Dispatcher = execute.Dispatcher
type Executor ¶
type Executor struct { ExecutorOptions BlockTimers TimerSet // contains filtered or unexported fields }
func NewExecutor ¶
func NewExecutor(opts ExecutorOptions) (*Executor, error)
NewExecutor creates a new Executor.
func (*Executor) ActiveGlobals_TESTONLY ¶
func (m *Executor) ActiveGlobals_TESTONLY() *core.GlobalValues
func (*Executor) EnableTimers ¶
func (m *Executor) EnableTimers()
func (*Executor) Init ¶ added in v1.2.0
func (x *Executor) Init(validators []*execute.ValidatorUpdate) (additional []*execute.ValidatorUpdate, err error)
func (*Executor) SetExecutor_TESTONLY ¶
func (x *Executor) SetExecutor_TESTONLY(y chain.TransactionExecutor)
func (*Executor) StoreBlockTimers ¶
type ExecutorFor ¶
type ExecutorOptions ¶
type ExpiredTransaction ¶ added in v1.2.0
type ExpiredTransaction struct{}
ExpiredTransaction expires a transaction
func (ExpiredTransaction) Process ¶ added in v1.2.0
func (x ExpiredTransaction) Process(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
func (ExpiredTransaction) Validate ¶ added in v1.2.0
func (ExpiredTransaction) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type Globals ¶
type Globals struct {
Active, Pending core.GlobalValues
}
type MessageContext ¶
type MessageContext struct {
// contains filtered or unexported fields
}
MessageContext is the context in which a message is processed.
func (*MessageContext) AuthorityDidVote ¶ added in v1.2.0
func (*MessageContext) AuthorityWillVote ¶ added in v1.2.0
func (m *MessageContext) AuthorityWillVote(batch *database.Batch, block uint64, transaction *protocol.Transaction, authUrl *url.URL) (*chain.AuthVote, error)
AuthorityWillVote checks if the authority is ready to vote. MUST NOT MODIFY STATE.
func (*MessageContext) GetAccountAuthoritySet ¶ added in v1.2.0
func (*MessageContext) GetAccountAuthoritySet(batch *database.Batch, account protocol.Account) (*protocol.AccountAuth, error)
func (*MessageContext) GetActiveGlobals ¶ added in v1.2.0
func (m *MessageContext) GetActiveGlobals() *core.GlobalValues
func (MessageContext) GetSignatureAs ¶ added in v1.2.0
func (b MessageContext) GetSignatureAs(batch *database.Batch, hash [32]byte) (protocol.Signature, error)
GetSignatureAs loads a Signature from the database or from the message bundle.
func (*MessageContext) SignerCanSign ¶ added in v1.2.0
func (*MessageContext) SignerCanSign(batch *database.Batch, transaction *protocol.Transaction, signer protocol.Signer) error
func (*MessageContext) SignerWillVote ¶ added in v1.2.0
func (m *MessageContext) SignerWillVote(batch *database.Batch, block uint64, transaction *protocol.Transaction, signerUrl *url.URL) (bool, protocol.VoteType, error)
SignerWillVote checks if the signer is ready to vote. MUST NOT MODIFY STATE.
func (*MessageContext) TransactionIsInitiated ¶ added in v1.2.0
func (*MessageContext) TransactionIsInitiated(batch *database.Batch, transaction *protocol.Transaction) (bool, *messaging.CreditPayment, error)
func (*MessageContext) Type ¶
func (m *MessageContext) Type() messaging.MessageType
type MessageExecutor ¶
type MessageExecutor = ExecutorFor[messaging.MessageType, *MessageContext]
type MessageIsReady ¶
type MessageIsReady struct{}
MessageIsReady executes a message.
func (MessageIsReady) Process ¶
func (MessageIsReady) Process(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
func (MessageIsReady) Validate ¶
func (MessageIsReady) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type NetworkUpdate ¶
type NetworkUpdate struct{}
NetworkUpdate constructs a transaction for the network update and queues it for processing.
func (NetworkUpdate) Process ¶
func (NetworkUpdate) Process(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
func (NetworkUpdate) Validate ¶
func (NetworkUpdate) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type ProcessSignatureState ¶
type ProcessSignatureState struct { }
func (*ProcessSignatureState) Merge ¶
func (s *ProcessSignatureState) Merge(r *ProcessSignatureState)
type ProducedMessage ¶
type ProducedMessage struct { // Producer is the ID of the producer. Producer *url.TxID // Destination is the account that the message should be routed to. Destination *url.URL // Message is the produced message. Message messaging.Message }
ProducedMessage is a message produced by another message.
type PseudoSynthetic ¶
type PseudoSynthetic struct{}
PseudoSynthetic executes a message.
func (PseudoSynthetic) Process ¶
func (PseudoSynthetic) Process(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
func (PseudoSynthetic) Validate ¶
func (PseudoSynthetic) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type SequencedMessage ¶
type SequencedMessage struct{ TransactionMessage }
SequencedMessage records the sequence metadata and executes the message inside.
func (SequencedMessage) Process ¶
func (x SequencedMessage) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (SequencedMessage) Validate ¶
func (x SequencedMessage) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type SignatureContext ¶
type SignatureContext struct { *MessageContext // contains filtered or unexported fields }
SignatureContext is the context in which a message is executed.
func (SignatureContext) GetSignatureAs ¶ added in v1.2.0
func (b SignatureContext) GetSignatureAs(batch *database.Batch, hash [32]byte) (protocol.Signature, error)
GetSignatureAs loads a Signature from the database or from the message bundle.
func (*SignatureContext) Type ¶
func (s *SignatureContext) Type() protocol.SignatureType
type SignatureExecutor ¶
type SignatureExecutor = ExecutorFor[protocol.SignatureType, *SignatureContext]
type SignatureMessage ¶
type SignatureMessage struct{}
SignatureMessage executes the signature, queuing the transaction for processing when appropriate.
func (SignatureMessage) Process ¶
func (x SignatureMessage) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (SignatureMessage) Validate ¶
func (x SignatureMessage) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type SignatureRequest ¶
type SignatureRequest struct{}
SignatureRequest lists a transaction as pending on an authority.
func (SignatureRequest) Process ¶
func (x SignatureRequest) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (SignatureRequest) Validate ¶
func (x SignatureRequest) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type SyntheticMessage ¶
type SyntheticMessage struct{}
SyntheticMessage records the synthetic transaction but does not execute it.
func (SyntheticMessage) Process ¶
func (x SyntheticMessage) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (SyntheticMessage) Validate ¶
func (x SyntheticMessage) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type TimerRecord ¶
type TimerRecord struct {
// contains filtered or unexported fields
}
type TimerSet ¶
type TimerSet struct {
// contains filtered or unexported fields
}
func (*TimerSet) Initialize ¶
func (t *TimerSet) Initialize(executors *map[protocol.TransactionType]chain.TransactionExecutor)
func (*TimerSet) Start ¶
func (t *TimerSet) Start(record any) *TimerRecord
func (*TimerSet) Stop ¶
func (t *TimerSet) Stop(r *TimerRecord)
type TransactionContext ¶
type TransactionContext struct { *MessageContext // contains filtered or unexported fields }
TransactionContext is the context in which a transaction is executed.
type TransactionMessage ¶
type TransactionMessage struct{}
TransactionMessage records the transaction but does not execute it. Transactions are executed in response to _authority signature_ messages, not user transaction messages.
func (TransactionMessage) Process ¶
func (x TransactionMessage) Process(batch *database.Batch, ctx *MessageContext) (_ *protocol.TransactionStatus, err error)
func (TransactionMessage) Validate ¶
func (x TransactionMessage) Validate(batch *database.Batch, ctx *MessageContext) (*protocol.TransactionStatus, error)
type UserSignature ¶
type UserSignature struct{}
UserSignature processes user signatures.
func (UserSignature) Process ¶
func (x UserSignature) Process(batch *database.Batch, ctx *SignatureContext) (_ *protocol.TransactionStatus, err error)
Process processes a signature.
func (UserSignature) Validate ¶
func (x UserSignature) Validate(batch *database.Batch, ctx *SignatureContext) (*protocol.TransactionStatus, error)
Validate validates a signature.
Source Files ¶
- block.go
- block_begin.go
- block_end.go
- block_timers.go
- enums_gen.go
- exec_common.go
- exec_process.go
- exec_validate.go
- executor.go
- globals.go
- msg_block_anchor.go
- msg_common.go
- msg_credit_payment.go
- msg_is_ready.go
- msg_network_update.go
- msg_pseudo_synthetic.go
- msg_sequenced.go
- msg_signature.go
- msg_signature_request.go
- msg_synthetic.go
- msg_transaction.go
- network_accounts.go
- sig_authority.go
- sig_common.go
- sig_user.go
- state.go
- synthetic.go
- transaction.go
- txn_common.go
- utils.go