diff --git a/share/eds/edstest/testing.go b/share/eds/edstest/testing.go index 8210f736a7..e66b42a566 100644 --- a/share/eds/edstest/testing.go +++ b/share/eds/edstest/testing.go @@ -39,5 +39,7 @@ func RandEDSWithNamespace( shares := sharetest.RandSharesWithNamespace(t, namespace, size*size) eds, err := rsmt2d.ComputeExtendedDataSquare(shares, share.DefaultRSMT2DCodec(), wrapper.NewConstructor(uint64(size))) require.NoError(t, err, "failure to recompute the extended data square") - return eds, da.NewDataAvailabilityHeader(eds) + dah, err := da.NewDataAvailabilityHeader(eds) + require.NoError(t, err) + return eds, dah } diff --git a/share/getters/shrex_test.go b/share/getters/shrex_test.go index 704859124b..ef07cf6797 100644 --- a/share/getters/shrex_test.go +++ b/share/getters/shrex_test.go @@ -1,11 +1,12 @@ package getters import ( + "bytes" "context" - "math/rand" - "sort" "encoding/binary" "errors" + "math/rand" + "sort" "testing" "time" @@ -19,6 +20,7 @@ import ( "github.com/stretchr/testify/require" "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/pkg/wrapper" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -67,7 +69,7 @@ func TestShrexGetter(t *testing.T) { // generate test data namespace := sharetest.RandV0Namespace() - randEDS, dah := edstest.RandEDSWithNamespace(t, namespace, 64) + randEDS, dah := singleNamespaceEds(t, namespace, 64) require.NoError(t, edsStore.Put(ctx, dah.Hash(), randEDS)) peerManager.Validate(ctx, srvHost.ID(), shrexsub.Notification{ DataHash: dah.Hash(), @@ -390,5 +392,7 @@ func singleNamespaceEds( sort.Slice(shares, func(i, j int) bool { return bytes.Compare(shares[i], shares[j]) < 0 }) eds, err := rsmt2d.ComputeExtendedDataSquare(shares, share.DefaultRSMT2DCodec(), wrapper.NewConstructor(uint64(size))) require.NoError(t, err, "failure to recompute the extended data square") - return eds, da.NewDataAvailabilityHeader(eds) + dah, err := da.NewDataAvailabilityHeader(eds) + require.NoError(t, err) + return eds, dah } diff --git a/share/p2p/shrexnd/pb/share.pb.go b/share/p2p/shrexnd/pb/share.pb.go index 1baa7fc73d..7e3c11416f 100644 --- a/share/p2p/shrexnd/pb/share.pb.go +++ b/share/p2p/shrexnd/pb/share.pb.go @@ -212,30 +212,28 @@ func init() { func init() { proto.RegisterFile("share/p2p/shrexnd/pb/share.proto", fileDescriptor_ed9f13149b0de397) } var fileDescriptor_ed9f13149b0de397 = []byte{ - // 357 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x91, 0x4d, 0x6b, 0xea, 0x40, - 0x14, 0x86, 0xf3, 0xe1, 0xcd, 0xd5, 0xa3, 0xd7, 0x1b, 0xe6, 0xc2, 0x35, 0x54, 0x09, 0x22, 0x14, - 0xa4, 0x85, 0x04, 0x52, 0xe8, 0x3e, 0x7e, 0xb4, 0x95, 0xda, 0x51, 0x46, 0xfb, 0xb1, 0x93, 0xa4, - 0x4e, 0xc9, 0xa6, 0x99, 0x69, 0x26, 0x62, 0xbb, 0xee, 0x1f, 0xe8, 0xcf, 0xea, 0xd2, 0x65, 0x97, - 0x45, 0xff, 0x48, 0xc9, 0x98, 0xe2, 0xa2, 0xee, 0xe6, 0xbc, 0xe7, 0x39, 0x67, 0x5e, 0xde, 0x03, - 0x4d, 0x11, 0x05, 0x09, 0x75, 0xb9, 0xc7, 0x5d, 0x11, 0x25, 0xf4, 0x39, 0x9e, 0xbb, 0x3c, 0x74, - 0xa5, 0xe8, 0xf0, 0x84, 0xa5, 0x0c, 0xa1, 0xbc, 0xf0, 0xb8, 0x23, 0x09, 0x27, 0x9e, 0x1f, 0x54, - 0x79, 0xe8, 0xf2, 0x84, 0xb1, 0x87, 0x2d, 0xd3, 0xba, 0x83, 0xfa, 0x39, 0x4d, 0x27, 0x19, 0x28, - 0x3a, 0x2f, 0x38, 0x78, 0xa4, 0x82, 0x07, 0xf7, 0x94, 0xd0, 0xa7, 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- 0xdb, 0xea, 0x6a, 0x6d, 0xab, 0x9f, 0x6b, 0x5b, 0x7d, 0xdb, 0xd8, 0xca, 0x6a, 0x63, 0x2b, 0x1f, - 0x1b, 0x5b, 0x09, 0x0d, 0x79, 0x9f, 0x93, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x8b, 0x14, - 0xc5, 0xe7, 0x01, 0x00, 0x00, + // 326 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x90, 0x4f, 0x4b, 0xf3, 0x40, + 0x10, 0xc6, 0x93, 0x96, 0x37, 0x6f, 0x3b, 0xad, 0x35, 0x2c, 0x22, 0xc5, 0xca, 0x52, 0x02, 0x42, + 0xf1, 0xb0, 0x81, 0x08, 0x1e, 0x85, 0xd6, 0xfa, 0xa7, 0x58, 0x52, 0xd9, 0xb6, 0xe2, 0x41, 0x28, + 0x1b, 0xbb, 0x92, 0x8b, 0xd9, 0x35, 0xbb, 0x45, 0xfd, 0x16, 0x7e, 0x2c, 0x8f, 0x3d, 0x7a, 0x94, + 0xf6, 0x8b, 0x48, 0xb6, 0xd1, 0x1c, 0xf4, 0xb6, 0xf3, 0xcc, 0x33, 0xbf, 0x7d, 0x66, 0xa0, 0xad, + 0x62, 0x96, 0x72, 0x5f, 0x06, 0xd2, 0x57, 0x71, 0xca, 0x5f, 0x92, 0xb9, 0x2f, 0x23, 0xdf, 0x88, + 0x44, 0xa6, 0x42, 0x0b, 0x84, 0xf2, 0x22, 0x90, 0xc4, 0x38, 0x48, 0x32, 0xdf, 0x6b, 0xc8, 0xc8, + 0x97, 0xa9, 0x10, 0x0f, 0x1b, 0x8f, 0x77, 0x0b, 0xad, 0x0b, 0xae, 0xc7, 0x99, 0x51, 0xf5, 0x5e, + 0x43, 0xf6, 0xc8, 0x95, 0x64, 0xf7, 0x9c, 0xf2, 0xa7, 0x05, 0x57, 0x1a, 0xb5, 0xa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x00, 0x00, } func (m *GetSharesByNamespaceRequest) Marshal() (dAtA []byte, err error) { diff --git a/share/p2p/shrexnd/server.go b/share/p2p/shrexnd/server.go index 670ecdcf99..b391a3b2ce 100644 --- a/share/p2p/shrexnd/server.go +++ b/share/p2p/shrexnd/server.go @@ -56,7 +56,6 @@ func NewServer(params *Parameters, host host.Host, store *eds.Store, getter shar ctx, cancel := context.WithCancel(context.Background()) srv.cancel = cancel - srv.handler = srv.middleware.RateLimitHandler(srv.streamHandler(ctx)) return srv, nil }