Skip to content

Commit

Permalink
move pool creation location
Browse files Browse the repository at this point in the history
  • Loading branch information
Ubuntu committed Dec 12, 2023
1 parent 9119b43 commit 70f4b6a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ type Node struct {
Transactor core.Transactor
PubIPProvider pubip.Provider
OperatorSocketsFilterer indexer.OperatorSocketsFilterer
Pool common.WorkerPool

mu sync.Mutex
CurrentSocket string
Expand All @@ -69,8 +68,6 @@ func NewNode(config *Config, pubIPProvider pubip.Provider, logger common.Logger)

config.ID = keyPair.GetPubKeyG1().GetOperatorID()

pool := workerpool.New(config.NumBatchValidators)

// Make sure config folder exists.
err = os.MkdirAll(config.DbPath, os.ModePerm)
if err != nil {
Expand Down Expand Up @@ -147,7 +144,6 @@ func NewNode(config *Config, pubIPProvider pubip.Provider, logger common.Logger)
Validator: validator,
PubIPProvider: pubIPProvider,
OperatorSocketsFilterer: socketsFilterer,
Pool: pool,
}, nil
}

Expand Down Expand Up @@ -326,7 +322,8 @@ func (n *Node) ValidateBatch(ctx context.Context, header *core.BatchHeader, blob
return err
}

return n.Validator.ValidateBatch(blobs, operatorState, n.Pool)
pool := workerpool.New(n.Config.NumBatchValidators)
return n.Validator.ValidateBatch(blobs, operatorState, pool)
}

func (n *Node) updateSocketAddress(ctx context.Context, newSocketAddr string) {
Expand Down

0 comments on commit 70f4b6a

Please sign in to comment.