Skip to content

Commit

Permalink
Do not fan-out event to TipSelection and Notarization, but call them …
Browse files Browse the repository at this point in the history
…sequentially.
  • Loading branch information
piotrm50 committed Nov 21, 2023
1 parent 42ab4fd commit bd8a3e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
1 change: 1 addition & 0 deletions pkg/protocol/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ func (e *Engine) acceptanceHandler() {
e.Ledger.TrackBlock(block)
e.SybilProtection.TrackBlock(block)
e.UpgradeOrchestrator.TrackValidationBlock(block)
e.TipSelection.SetAcceptanceTime(block.IssuingTime())

e.Events.AcceptedBlockProcessed.Trigger(block)
}, event.WithWorkerPool(wp))
Expand Down
5 changes: 0 additions & 5 deletions pkg/protocol/engine/tipselection/v1/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
"github.com/iotaledger/hive.go/runtime/module"
"github.com/iotaledger/hive.go/runtime/options"
"github.com/iotaledger/iota-core/pkg/protocol/engine"
"github.com/iotaledger/iota-core/pkg/protocol/engine/blocks"
"github.com/iotaledger/iota-core/pkg/protocol/engine/tipmanager"
"github.com/iotaledger/iota-core/pkg/protocol/engine/tipselection"
iotago "github.com/iotaledger/iota.go/v4"
Expand All @@ -23,10 +22,6 @@ func NewProvider(opts ...options.Option[TipSelection]) module.Provider[*engine.E
// wait for submodules to be constructed (so all of their properties are available)
module.OnAllConstructed(func() {
t.Construct(e.TipManager, e.Ledger.ConflictDAG(), e.Ledger.MemPool().TransactionMetadata, func() iotago.BlockIDs { return lo.Keys(e.EvictionState.ActiveRootBlocks()) }, DynamicLivenessThreshold(e.SybilProtection.SeatManager().OnlineCommittee().Size))

e.Events.AcceptedBlockProcessed.Hook(func(block *blocks.Block) {
t.SetAcceptanceTime(block.IssuingTime())
})
}, e.TipManager, e.Ledger, e.SybilProtection)
})

Expand Down

0 comments on commit bd8a3e1

Please sign in to comment.