From 31b1bd25f1bd6a9a23bc89c3d4e669aa511cf874 Mon Sep 17 00:00:00 2001 From: Daniel Mancia <21249320+dmanc@users.noreply.github.com> Date: Fri, 7 Jun 2024 10:15:06 -0700 Subject: [PATCH 1/2] Use accountKey as accountID --- disperser/apiserver/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index e604b2a3ae..89306baa51 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -457,6 +457,11 @@ func (s *DispersalServer) checkRateLimitsAndAddRatesToHeader(ctx context.Context // Update the quorum rate blob.RequestHeader.SecurityParams[i].QuorumRate = accountRates.Throughput + // Update AccountID to accountKey. + // This will use the origin as the account key if the user does not provide + // an authenticated address. + blob.RequestHeader.BlobAuthHeader.AccountID = accountKey + // Get the encoded blob size from the blob header. Calculation is done in a way that nodes can replicate encodedLength := encoding.GetEncodedBlobLength(length, uint8(param.ConfirmationThreshold), uint8(param.AdversaryThreshold)) encodedSize := encoding.GetBlobSize(encodedLength) From 5f14a447434fc33fdaebd7fd7d9dc39396fe28a1 Mon Sep 17 00:00:00 2001 From: Daniel Mancia <21249320+dmanc@users.noreply.github.com> Date: Fri, 7 Jun 2024 16:23:48 -0700 Subject: [PATCH 2/2] Add authenticated address to log --- disperser/apiserver/server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/disperser/apiserver/server.go b/disperser/apiserver/server.go index 89306baa51..753b7c55a8 100644 --- a/disperser/apiserver/server.go +++ b/disperser/apiserver/server.go @@ -267,7 +267,7 @@ func (s *DispersalServer) disperseBlob(ctx context.Context, blob *core.Blob, aut return nil, api.NewInvalidArgError(err.Error()) } - s.logger.Debug("received a new blob dispersal request", "origin", origin, "securityParams", strings.Join(securityParamsStrings, ", ")) + s.logger.Debug("received a new blob dispersal request", "authenticatedAddress", authenticatedAddress, "origin", origin, "securityParams", strings.Join(securityParamsStrings, ", ")) if s.ratelimiter != nil { err := s.checkRateLimitsAndAddRatesToHeader(ctx, blob, origin, authenticatedAddress, apiMethodName)