Skip to content

Commit

Permalink
chore: logs and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hopeyen committed Dec 17, 2024
1 parent 05efb9c commit 56f8699
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
4 changes: 1 addition & 3 deletions core/meterer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package meterer

import (
"context"
"fmt"

commonaws "github.com/Layr-Labs/eigenda/common/aws"
test_utils "github.com/Layr-Labs/eigenda/common/aws/dynamodb/utils"
Expand All @@ -13,7 +12,7 @@ import (

func CreateReservationTable(clientConfig commonaws.ClientConfig, tableName string) error {
ctx := context.Background()
res, err := test_utils.CreateTable(ctx, clientConfig, tableName, &dynamodb.CreateTableInput{
_, err := test_utils.CreateTable(ctx, clientConfig, tableName, &dynamodb.CreateTableInput{
AttributeDefinitions: []types.AttributeDefinition{
{
AttributeName: aws.String("AccountID"),
Expand Down Expand Up @@ -41,7 +40,6 @@ func CreateReservationTable(clientConfig commonaws.ClientConfig, tableName strin
},
})

fmt.Printf("Made table %s\n", res)
return err
}

Expand Down
3 changes: 1 addition & 2 deletions disperser/apiserver/disperse_blob_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,14 @@ func (s *DispersalServerV2) validateDispersalRequest(ctx context.Context, req *p
if err != nil {
return api.NewErrorInvalidArg(fmt.Sprintf("invalid blob header: %s", err.Error()))
}
// TODO(ian-shim): enable this check for authentication

if blobHeader.PaymentMetadata == (core.PaymentMetadata{}) {
return api.NewErrorInvalidArg("payment metadata is required")
}
if err = s.authenticator.AuthenticateBlobRequest(blobHeader); err != nil {
return api.NewErrorInvalidArg(fmt.Sprintf("authentication failed: %s", err.Error()))
}

// TODO(ian-shim): enable this check when we have payment metadata + authentication in disperser client
if len(blobHeader.PaymentMetadata.AccountID) == 0 || blobHeader.PaymentMetadata.ReservationPeriod == 0 || blobHeader.PaymentMetadata.CumulativePayment == nil {
return api.NewErrorInvalidArg("invalid payment metadata")
}
Expand Down
4 changes: 0 additions & 4 deletions disperser/apiserver/server_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,7 @@ func TestV2DisperseBlobRequestValidation(t *testing.T) {
Data: data,
BlobHeader: invalidReqProto,
})
// TODO(hopeyen); re-enable this validation after adding signature verification
assert.ErrorContains(t, err, "authentication failed")
// assert.NoError(t, err)

// request with invalid payment metadata
invalidReqProto = &pbcommonv2.BlobHeader{
Expand All @@ -229,9 +227,7 @@ func TestV2DisperseBlobRequestValidation(t *testing.T) {
Data: data,
BlobHeader: invalidReqProto,
})
// TODO(ian-shim): re-enable this validation after fixing the payment metadata validation
assert.ErrorContains(t, err, "invalid payment metadata")
// assert.NoError(t, err)

// request with invalid commitment
invalidCommitment := commitmentProto
Expand Down
9 changes: 4 additions & 5 deletions inabox/deploy/localstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,20 +143,19 @@ func DeployResources(
return err
}

v2PaymentName := "e2e_v2"
fmt.Println("Creating payment related tables ---- in localstack")
v2PaymentName := "e2e_v2_"
// create payment related tables
err = meterer.CreateReservationTable(cfg, v2PaymentName+"_reservation")
err = meterer.CreateReservationTable(cfg, v2PaymentName+"reservation")
if err != nil {
fmt.Println("err", err)
return err
}
err = meterer.CreateOnDemandTable(cfg, v2PaymentName+"_ondemand")
err = meterer.CreateOnDemandTable(cfg, v2PaymentName+"ondemand")
if err != nil {
fmt.Println("err", err)
return err
}
err = meterer.CreateGlobalReservationTable(cfg, v2PaymentName+"_global_reservation")
err = meterer.CreateGlobalReservationTable(cfg, v2PaymentName+"global_reservation")
if err != nil {
fmt.Println("err", err)
return err
Expand Down

0 comments on commit 56f8699

Please sign in to comment.