Skip to content

Commit

Permalink
merkleroot proc perf improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv committed Dec 18, 2024
1 parent ec2d169 commit 8e9ca18
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions commit/merkleroot/observation.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,32 @@ func (p *Processor) getObservation(
nextState := previousOutcome.nextState()
switch nextState {
case selectingRangesForReport:
offRampNextSeqNums := p.observer.ObserveOffRampNextSeqNums(ctx)
onRampLatestSeqNums := p.observer.ObserveLatestOnRampSeqNums(ctx, p.destChain)
rmnRemoteCfg := p.observer.ObserveRMNRemoteCfg(ctx, p.destChain)
var (
offRampNextSeqNums []plugintypes.SeqNumChain
onRampLatestSeqNums []plugintypes.SeqNumChain
rmnRemoteCfg rmntypes.RemoteConfig
)

eg := &errgroup.Group{}

eg.Go(func() error {
offRampNextSeqNums = p.observer.ObserveOffRampNextSeqNums(ctx)
return nil
})

eg.Go(func() error {
onRampLatestSeqNums = p.observer.ObserveLatestOnRampSeqNums(ctx, p.destChain)
return nil
})

eg.Go(func() error {
rmnRemoteCfg = p.observer.ObserveRMNRemoteCfg(ctx, p.destChain)
return nil
})

if err := eg.Wait(); err != nil {
return Observation{}, nextState, fmt.Errorf("failed to get observation: %w", err)
}

return Observation{
OnRampMaxSeqNums: onRampLatestSeqNums,
Expand Down

0 comments on commit 8e9ca18

Please sign in to comment.