Documentation ¶
Index ¶
- Constants
- Variables
- func Run(env environment, targetTs ledger.Time, slotData *SlotData) (*transaction.Transaction, *txmetadata.TransactionMetadata, error)
- type ProposalGenerator
- type Proposer
- type SlotData
- func (s *SlotData) BranchTxSubmitted(txid *ledger.TransactionID)
- func (s *SlotData) Lines(prefix ...string) *lines.Lines
- func (s *SlotData) NewTarget()
- func (s *SlotData) NoProposals()
- func (s *SlotData) NotGoodEnough()
- func (s *SlotData) ProposalSubmitted(strategyName string)
- func (s *SlotData) SequencerTxSubmitted(txid *ledger.TransactionID)
- type Strategy
- type Task
Constants ¶
const TraceTagBaseProposer = "propose-base"
const TraceTagChooseFirstExtendEndorsePair = "chooseFirstPair"
const TraceTagEndorse1Proposer = "propose-endorse1"
const TraceTagEndorse2Proposer = "propose-endorse2"
const TraceTagEndorse2RndProposer = "propose-endorse2rnd"
const TraceTagInsertTagAlongInputs = "InsertTagAlongInputs"
const TraceTagTask = "task"
Variables ¶
Functions ¶
func Run ¶
func Run(env environment, targetTs ledger.Time, slotData *SlotData) (*transaction.Transaction, *txmetadata.TransactionMetadata, error)
Run starts task with the aim to generate sequencer transaction for the target ledger time. The proposer task consist of several proposers (goroutines) Each proposer generates proposals and writes it to the channel of the task. The best proposal is selected and returned. Function only returns transaction which is better than others in the tippool for the current slot. Otherwise, returns nil
Types ¶
type ProposalGenerator ¶
type ProposalGenerator func(p *Proposer) (*attacher.IncrementalAttacher, bool)
ProposalGenerator returns incremental attacher as draft transaction or otherwise nil and forceExit flag = true
type Proposer ¶
type Proposer struct { *Task Name string Msg string // how proposer ended. For debugging // contains filtered or unexported fields }
Task to generate proposals for the target ledger time. The task is interrupted by the context with deadline
func (*Proposer) ChooseFirstExtendEndorsePair ¶
func (p *Proposer) ChooseFirstExtendEndorsePair(shuffleEndorseCandidates bool, pairFilter func(extend vertex.WrappedOutput, endorse *vertex.WrappedTx) bool) *attacher.IncrementalAttacher
ChooseFirstExtendEndorsePair returns incremental attacher which corresponds to the first extend-endorse pair encountered while traversing endorse candidates. Endorse candidates are either sorted descending by coverage, or randomly shuffled Pairs are filtered before checking. It allows to exclude repeating pairs
type SlotData ¶
type SlotData struct {
// contains filtered or unexported fields
}
SlotData collect values of sequencer during one slot Proposers may keep theirs state there from target to target
func NewSlotData ¶
func (*SlotData) BranchTxSubmitted ¶
func (s *SlotData) BranchTxSubmitted(txid *ledger.TransactionID)
func (*SlotData) NoProposals ¶
func (s *SlotData) NoProposals()
func (*SlotData) NotGoodEnough ¶
func (s *SlotData) NotGoodEnough()
func (*SlotData) ProposalSubmitted ¶
func (*SlotData) SequencerTxSubmitted ¶
func (s *SlotData) SequencerTxSubmitted(txid *ledger.TransactionID)
type Strategy ¶
type Strategy struct { Name string ShortName string GenerateProposal ProposalGenerator }
Task to generate proposals for the target ledger time. The task is interrupted by the context with deadline
type Task ¶
type Task struct { // proposals []*proposal Name string // contains filtered or unexported fields }
Task to generate proposals for the target ledger time. The task is interrupted by the context with deadline
func (*Task) InsertTagAlongInputs ¶
func (t *Task) InsertTagAlongInputs(a *attacher.IncrementalAttacher) (numInserted int)
InsertTagAlongInputs includes tag-along outputs from the backlog into attacher