diff --git a/node/pkg/aggregator/aggregator.go b/node/pkg/aggregator/aggregator.go index e8b69f53b..fb85a6179 100644 --- a/node/pkg/aggregator/aggregator.go +++ b/node/pkg/aggregator/aggregator.go @@ -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 @@ -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 } } diff --git a/node/pkg/error/sentinel.go b/node/pkg/error/sentinel.go index 1b267a38e..46aa659b2 100644 --- a/node/pkg/error/sentinel.go +++ b/node/pkg/error/sentinel.go @@ -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"} diff --git a/node/pkg/fetcher/app.go b/node/pkg/fetcher/app.go index 1ab220f3d..aef075110 100644 --- a/node/pkg/fetcher/app.go +++ b/node/pkg/fetcher/app.go @@ -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 }