Add the option to force or not a forgeBatch at the beginning of the slot

This commit is contained in:
Pantani
2021-03-11 23:26:17 -03:00
parent d361abb8cd
commit 968fcc207e
5 changed files with 13 additions and 1 deletions

View File

@@ -87,6 +87,11 @@ type Config struct {
// MustForgeAtSlotDeadline enables the coordinator to forge slots if
// the empty slots reach the slot deadline.
MustForgeAtSlotDeadline bool
// IgnoreSlotCommitment disables forcing the coordinator to forge a
// slot immediately when the slot is not committed. If set to false,
// the coordinator will immediately forge a batch at the beginning of
// a slot if it's the slot winner.
IgnoreSlotCommitment bool
// SyncRetryInterval is the waiting interval between calls to the main
// handler of a synced block after an error
SyncRetryInterval time.Duration

View File

@@ -414,7 +414,7 @@ func (p *Pipeline) forgeBatch(batchNum common.BatchNum) (batchInfo *BatchInfo, e
var coordIdxs []common.Idx
// Check if the slot is not yet fulfilled
slotCommitted := false
slotCommitted := p.cfg.IgnoreSlotCommitment
if p.stats.Sync.Auction.CurrentSlot.ForgerCommitment ||
p.stats.Sync.Auction.CurrentSlot.SlotNum == p.state.lastSlotForged {
slotCommitted = true