Skip to content

Commit

Permalink
fix: minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bisonai committed Aug 28, 2024
1 parent 2fedc64 commit c9ab262
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions node/pkg/aggregator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ func NewAggregator(
Signer: signHelper,
LatestLocalAggregates: latestLocalAggregates,
bus: mb,

roundLocalAggregate: map[int32]int64{},
}
aggregator.Raft.LeaderJob = aggregator.LeaderJob
aggregator.Raft.HandleCustomMessage = aggregator.HandleCustomMessage
Expand Down Expand Up @@ -308,6 +310,8 @@ func (n *Aggregator) HandleProofMessage(ctx context.Context, msg raft.Message) e
if err != nil {
log.Warn().Str("Player", "Aggregator").Err(err).Msg("failed to publish fetcher refresh bus message")
}

return errorSentinel.ErrAggregatorGlobalLocalPriceMismatch
}
}

Expand Down
1 change: 1 addition & 0 deletions node/pkg/error/sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ var (
ErrAggregatorNotFound = &CustomError{Service: Aggregator, Code: InternalError, Message: "Aggregator not found"}
ErrAggregatorCancelNotFound = &CustomError{Service: Aggregator, Code: InternalError, Message: "Aggregator cancel function not found"}
ErrAggregatorEmptyProof = &CustomError{Service: Aggregator, Code: InternalError, Message: "Empty proof"}
ErrAggregatorGlobalLocalPriceMismatch = &CustomError{Service: Aggregator, Code: InternalError, Message: "Global and local price mismatch"}

ErrBootAPIDbPoolNotFound = &CustomError{Service: BootAPI, Code: InternalError, Message: "db pool not found"}

Expand Down
2 changes: 1 addition & 1 deletion node/pkg/fetcher/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (a *App) subscribe(ctx context.Context) {
}

func (a *App) handleMessage(ctx context.Context, msg bus.Message) {
if msg.From != bus.ADMIN && msg.From != bus.ACTIVATE_AGGREGATOR {
if msg.From != bus.ADMIN && msg.From != bus.AGGREGATOR {
log.Debug().Str("Player", "Fetcher").Msg("fetcher received message from non-admin")
return
}
Expand Down

0 comments on commit c9ab262

Please sign in to comment.