diff --git a/aggregator/aggregator.go b/aggregator/aggregator.go index e3f3116a..06576319 100644 --- a/aggregator/aggregator.go +++ b/aggregator/aggregator.go @@ -75,8 +75,6 @@ type Aggregator struct { blsAggregationService blsagg.BlsAggregationService tasks map[types.TaskIndex]cstaskmanager.IIncredibleSquaringTaskManagerTask tasksMu sync.RWMutex - taskResponses map[types.TaskIndex]map[sdktypes.TaskResponseDigest]cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse - taskResponsesMu sync.RWMutex } // NewAggregator creates a new Aggregator with the provided config. @@ -156,7 +154,6 @@ func NewAggregator(c *config.Config) (*Aggregator, error) { avsWriter: avsWriter, blsAggregationService: blsAggregationService, tasks: make(map[types.TaskIndex]cstaskmanager.IIncredibleSquaringTaskManagerTask), - taskResponses: make(map[types.TaskIndex]map[sdktypes.TaskResponseDigest]cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse), }, nil } @@ -225,9 +222,7 @@ func (agg *Aggregator) sendAggregatedResponseToContract(blsAggServiceResp blsagg agg.tasksMu.RLock() task := agg.tasks[blsAggServiceResp.TaskIndex] agg.tasksMu.RUnlock() - agg.taskResponsesMu.RLock() - taskResponse := agg.taskResponses[blsAggServiceResp.TaskIndex][blsAggServiceResp.TaskResponseDigest] - agg.taskResponsesMu.RUnlock() + taskResponse, _ := blsAggServiceResp.TaskResponse.(cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse) _, err := agg.avsWriter.SendAggregatedResponse(context.Background(), task, taskResponse, nonSignerStakesAndSignature) if err != nil { agg.logger.Error("Aggregator failed to respond to task", "err", err) diff --git a/aggregator/aggregator_test.go b/aggregator/aggregator_test.go index b97b42f1..16485c9c 100644 --- a/aggregator/aggregator_test.go +++ b/aggregator/aggregator_test.go @@ -155,7 +155,6 @@ func createMockAggregator( avsWriter: mockAvsWriter, blsAggregationService: mockBlsAggregationService, tasks: make(map[types.TaskIndex]cstaskmanager.IIncredibleSquaringTaskManagerTask), - taskResponses: make(map[types.TaskIndex]map[sdktypes.TaskResponseDigest]cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse), } return aggregator, mockAvsWriter, mockBlsAggregationService, nil } diff --git a/aggregator/rpc_server.go b/aggregator/rpc_server.go index a07f5e81..70f4ad7c 100644 --- a/aggregator/rpc_server.go +++ b/aggregator/rpc_server.go @@ -7,11 +7,9 @@ import ( "net/rpc" cstaskmanager "github.com/Layr-Labs/incredible-squaring-avs/contracts/bindings/IncredibleSquaringTaskManager" - "github.com/Layr-Labs/incredible-squaring-avs/core" "github.com/Layr-Labs/eigensdk-go/crypto/bls" "github.com/Layr-Labs/eigensdk-go/types" - sdktypes "github.com/Layr-Labs/eigensdk-go/types" ) var ( @@ -50,21 +48,8 @@ type SignedTaskResponse struct { func (agg *Aggregator) ProcessSignedTaskResponse(signedTaskResponse *SignedTaskResponse, reply *bool) error { agg.logger.Infof("Received signed task response: %#v", signedTaskResponse) taskIndex := signedTaskResponse.TaskResponse.ReferenceTaskIndex - taskResponseDigest, err := core.GetTaskResponseDigest(&signedTaskResponse.TaskResponse) - if err != nil { - agg.logger.Error("Failed to get task response digest", "err", err) - return TaskResponseDigestNotFoundError500 - } - agg.taskResponsesMu.Lock() - if _, ok := agg.taskResponses[taskIndex]; !ok { - agg.taskResponses[taskIndex] = make(map[sdktypes.TaskResponseDigest]cstaskmanager.IIncredibleSquaringTaskManagerTaskResponse) - } - if _, ok := agg.taskResponses[taskIndex][taskResponseDigest]; !ok { - agg.taskResponses[taskIndex][taskResponseDigest] = signedTaskResponse.TaskResponse - } - agg.taskResponsesMu.Unlock() - err = agg.blsAggregationService.ProcessNewSignature( + err := agg.blsAggregationService.ProcessNewSignature( context.Background(), taskIndex, signedTaskResponse.TaskResponse, &signedTaskResponse.BlsSignature, signedTaskResponse.OperatorId, )