Skip to content

Commit

Permalink
Test a theory
Browse files Browse the repository at this point in the history
  • Loading branch information
piotrm50 committed Apr 17, 2024
1 parent 98d2689 commit 5f0784e
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pkg/protocol/engine/booker/inmemorybooker/booker.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ func (b *Booker) Queue(block *blocks.Block) error {
func (b *Booker) Reset() { /* nothing to reset but comply with interface */ }

func (b *Booker) setupBlock(block *blocks.Block, signedTransactionMetadata mempool.SignedTransactionMetadata) {
var payloadDependencies, directlyReferencedPayloadDependencies ds.Set[mempool.StateMetadata]
var _, directlyReferencedPayloadDependencies ds.Set[mempool.StateMetadata]

if signedTransactionMetadata != nil && signedTransactionMetadata.SignaturesInvalid() == nil && !signedTransactionMetadata.TransactionMetadata().IsInvalid() {
payloadDependencies = signedTransactionMetadata.TransactionMetadata().Inputs()
_ = signedTransactionMetadata.TransactionMetadata().Inputs()
directlyReferencedPayloadDependencies = ds.NewSet[mempool.StateMetadata]()
}

Expand All @@ -164,6 +164,7 @@ func (b *Booker) setupBlock(block *blocks.Block, signedTransactionMetadata mempo

if unbookedParentsCount.Add(-1) == 0 {
block.ParentsBooked.Trigger()
block.PayloadDependenciesAvailable.Trigger()
}
})

Expand All @@ -174,13 +175,13 @@ func (b *Booker) setupBlock(block *blocks.Block, signedTransactionMetadata mempo
})
})

block.ParentsBooked.OnTrigger(func() {
if directlyReferencedPayloadDependencies != nil {
payloadDependencies.DeleteAll(directlyReferencedPayloadDependencies)
}

block.WaitForPayloadDependencies(payloadDependencies)
})
//block.ParentsBooked.OnTrigger(func() {

Check failure on line 178 in pkg/protocol/engine/booker/inmemorybooker/booker.go

View workflow job for this annotation

GitHub Actions / GolangCI-Lint

commentFormatting: put a space between `//` and comment text (gocritic)
// if directlyReferencedPayloadDependencies != nil {
// payloadDependencies.DeleteAll(directlyReferencedPayloadDependencies)
// }
//
// block.WaitForPayloadDependencies(payloadDependencies)
//})

block.PayloadDependenciesAvailable.OnTrigger(func() {
if err := b.book(block); err != nil {
Expand Down

0 comments on commit 5f0784e

Please sign in to comment.