arnaucube
arnaucube/hermez-nodePublic Self-hosted repository
Add the option to force or not a forgeBatch at the beginning of the slot
Pantani danpantani@gmail.com
Thu, 11 Mar 2021 23:26:17 -0300
commit

968fcc207e3c95edb057b571baaf2b597c9eb140

parent

d361abb8cd0a434b7adc5d873099524236c5ad6d

M cli/node/cfg.buidler.toml → cli/node/cfg.buidler.toml

@@ -64,6 +64,7 @@ ForgeDelay = "10s"

ForgeNoTxsDelay = "0s" PurgeByExtDelInterval = "1m" MustForgeAtSlotDeadline = true +IgnoreSlotCommitment = false [Coordinator.FeeAccount] Address = "0x56232B1c5B10038125Bc7345664B4AFD745bcF8E"
M config/config.go → config/config.go

@@ -104,6 +104,11 @@ ForgeNoTxsDelay Duration `validate:"-"`

// MustForgeAtSlotDeadline enables the coordinator to forge slots if // the empty slots reach the slot deadline. MustForgeAtSlotDeadline bool + // IgnoreSlotCommitment 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 Duration `validate:"required"`
M coordinator/coordinator.go → coordinator/coordinator.go

@@ -87,6 +87,11 @@ ForgeNoTxsDelay time.Duration

// 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
M coordinator/pipeline.go → coordinator/pipeline.go

@@ -414,7 +414,7 @@ var auths [][]byte

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
M node/node.go → node/node.go

@@ -338,6 +338,7 @@ L1BatchTimeoutPerc: cfg.Coordinator.L1BatchTimeoutPerc,

ForgeRetryInterval: cfg.Coordinator.ForgeRetryInterval.Duration, ForgeDelay: cfg.Coordinator.ForgeDelay.Duration, MustForgeAtSlotDeadline: cfg.Coordinator.MustForgeAtSlotDeadline, + IgnoreSlotCommitment: cfg.Coordinator.IgnoreSlotCommitment, ForgeNoTxsDelay: cfg.Coordinator.ForgeNoTxsDelay.Duration, SyncRetryInterval: cfg.Coordinator.SyncRetryInterval.Duration, PurgeByExtDelInterval: cfg.Coordinator.PurgeByExtDelInterval.Duration,