Skip to content

Commit

Permalink
Minor fixes (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-shim authored Mar 18, 2024
1 parent 7bd41f9 commit a5f9e24
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion api/docs/disperser.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ AuthenticationData contains the signature of the BlobAuthHeader.

### BlobAuthHeader
BlobAuthHeader contains information about the blob for the client to verify and sign.
- Once payments are enabled, the BlobAuthHeader the KZG commitment to the blob, which the client
- Once payments are enabled, the BlobAuthHeader will contain the KZG commitment to the blob, which the client
will verify and sign. Having the client verify the KZG commitment instead of calculating it avoids
the need for the client to have the KZG structured reference string (SRS), which can be large.
The signed KZG commitment prevents the disperser from sending a different blob to the DA Nodes
Expand Down
15 changes: 8 additions & 7 deletions api/grpc/churner/churner.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/grpc/disperser/disperser.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion api/proto/disperser/disperser.proto
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ message AuthenticatedReply {
}

// BlobAuthHeader contains information about the blob for the client to verify and sign.
// - Once payments are enabled, the BlobAuthHeader the KZG commitment to the blob, which the client
// - Once payments are enabled, the BlobAuthHeader will contain the KZG commitment to the blob, which the client
// will verify and sign. Having the client verify the KZG commitment instead of calculating it avoids
// the need for the client to have the KZG structured reference string (SRS), which can be large.
// The signed KZG commitment prevents the disperser from sending a different blob to the DA Nodes
Expand Down
2 changes: 1 addition & 1 deletion core/data.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ type BlobHeader struct {
QuorumInfos []*BlobQuorumInfo

// AccountID is the account that is paying for the blob to be stored
AccountID AccountID `json:"account_id"`
AccountID AccountID
}

func (b *BlobHeader) GetQuorumInfo(quorum QuorumID) *BlobQuorumInfo {
Expand Down
6 changes: 3 additions & 3 deletions disperser/apiserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *DispersalServer) DisperseBlobAuthenticated(stream pb.Disperser_Disperse
return api.NewInvalidArgError(fmt.Sprintf("error receiving next message: %v", err))
}

request, ok := in.Payload.(*pb.AuthenticatedRequest_DisperseRequest)
request, ok := in.GetPayload().(*pb.AuthenticatedRequest_DisperseRequest)
if !ok {
return api.NewInvalidArgError("missing DisperseBlobRequest")
}
Expand Down Expand Up @@ -148,7 +148,7 @@ func (s *DispersalServer) DisperseBlobAuthenticated(stream pb.Disperser_Disperse
return api.NewInvalidArgError(fmt.Sprintf("error receiving next message: %v", err))
}

challengeReply, ok := in.Payload.(*pb.AuthenticatedRequest_AuthenticationData)
challengeReply, ok := in.GetPayload().(*pb.AuthenticatedRequest_AuthenticationData)
if !ok {
return api.NewInvalidArgError("expected AuthenticationData")
}
Expand Down Expand Up @@ -223,7 +223,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 request", "origin", origin, "securityParams", strings.Join(securityParamsStrings, ", "))
s.logger.Debug("received a new blob dispersal request", "origin", origin, "securityParams", strings.Join(securityParamsStrings, ", "))

if s.ratelimiter != nil {
err := s.checkRateLimitsAndAddRates(ctx, blob, origin, authenticatedAddress)
Expand Down
4 changes: 2 additions & 2 deletions node/grpc/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ func (s *Server) serveDispersal() error {
addr := fmt.Sprintf("%s:%s", localhost, s.config.InternalDispersalPort)
listener, err := net.Listen("tcp", addr)
if err != nil {
s.logger.Fatalf("Could not start tcp listener: %w", err)
s.logger.Fatalf("Could not start tcp listener: %v", err)
}

opt := grpc.MaxRecvMsgSize(1024 * 1024 * 1024) // 1 GiB
Expand All @@ -107,7 +107,7 @@ func (s *Server) serveRetrieval() error {
addr := fmt.Sprintf("%s:%s", localhost, s.config.InternalRetrievalPort)
listener, err := net.Listen("tcp", addr)
if err != nil {
s.logger.Fatalf("Could not start tcp listener: %w", err)
s.logger.Fatalf("Could not start tcp listener: %v", err)
}

opt := grpc.MaxRecvMsgSize(1024 * 1024 * 300) // 300 MiB
Expand Down
2 changes: 1 addition & 1 deletion node/grpc/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func GetBatchHeader(in *pb.StoreChunksRequest) (*core.BatchHeader, error) {
var batchRoot [32]byte
copy(batchRoot[:], in.GetBatchHeader().GetBatchRoot())
batchHeader := core.BatchHeader{
ReferenceBlockNumber: uint(in.BatchHeader.ReferenceBlockNumber),
ReferenceBlockNumber: uint(in.GetBatchHeader().GetReferenceBlockNumber()),
BatchRoot: batchRoot,
}
return &batchHeader, nil
Expand Down
2 changes: 1 addition & 1 deletion retriever/eth/chain_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type chainClient struct {
logger logging.Logger
}

func NewChainClient(ethClient common.EthClient, logger logging.Logger) *chainClient {
func NewChainClient(ethClient common.EthClient, logger logging.Logger) ChainClient {
return &chainClient{
ethClient: ethClient,
logger: logger,
Expand Down

0 comments on commit a5f9e24

Please sign in to comment.