diff --git a/api/gateway/share.go b/api/gateway/share.go index 36c1f94a0a..cdd40e1d2b 100644 --- a/api/gateway/share.go +++ b/api/gateway/share.go @@ -9,7 +9,7 @@ import ( "github.com/gorilla/mux" - "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/celestia-node/share" ) diff --git a/api/gateway/share_test.go b/api/gateway/share_test.go index 9b12240f62..1928c721ec 100644 --- a/api/gateway/share_test.go +++ b/api/gateway/share_test.go @@ -5,10 +5,10 @@ import ( "testing" "github.com/stretchr/testify/require" - coretypes "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/celestia-node/share/sharetest" ) @@ -23,13 +23,13 @@ func Test_dataFromShares(t *testing.T) { ns := sharetest.RandV0Namespace() sss := shares.NewSparseShareSplitter() for _, data := range testData { - b := coretypes.Blob{ + b := blob.Blob{ Data: data, - NamespaceID: ns.ID(), - NamespaceVersion: ns.Version(), - ShareVersion: appconsts.ShareVersionZero, + NamespaceId: ns.ID(), + NamespaceVersion: uint32(ns.Version()), + ShareVersion: uint32(appconsts.ShareVersionZero), } - err := sss.Write(b) + err := sss.Write(&b) require.NoError(t, err) } diff --git a/blob/blob.go b/blob/blob.go index 7fca83859d..369d464ef4 100644 --- a/blob/blob.go +++ b/blob/blob.go @@ -6,16 +6,21 @@ import ( "errors" "fmt" - tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/crypto/merkle" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/shares" - "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/inclusion" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/nmt" "github.com/celestiaorg/celestia-node/share" ) +// appVersion is the current application version of celestia-app. +const appVersion = v2.Version + var errEmptyShares = errors.New("empty shares") // The Proof is a set of nmt proofs that can be verified only through @@ -56,7 +61,7 @@ func (p Proof) equal(input Proof) error { // Blob represents any application-specific binary data that anyone can submit to Celestia. type Blob struct { - types.Blob `json:"blob"` + *blob.Blob `json:"blob"` Commitment Commitment `json:"commitment"` @@ -84,18 +89,18 @@ func NewBlob(shareVersion uint8, namespace share.Namespace, data []byte) (*Blob, return nil, err } - blob := tmproto.Blob{ + blob := blob.Blob{ NamespaceId: namespace.ID(), Data: data, ShareVersion: uint32(shareVersion), NamespaceVersion: uint32(namespace.Version()), } - com, err := types.CreateCommitment(&blob) + com, err := inclusion.CreateCommitment(&blob, merkle.HashFromByteSlices, appconsts.SubtreeRootThreshold(appVersion)) if err != nil { return nil, err } - return &Blob{Blob: blob, Commitment: com, namespace: namespace, index: -1}, nil + return &Blob{Blob: &blob, Commitment: com, namespace: namespace, index: -1}, nil } // Namespace returns blob's namespace. @@ -157,18 +162,19 @@ func (b *Blob) MarshalJSON() ([]byte, error) { } func (b *Blob) UnmarshalJSON(data []byte) error { - var blob jsonBlob - err := json.Unmarshal(data, &blob) + var jsonBlob jsonBlob + err := json.Unmarshal(data, &jsonBlob) if err != nil { return err } - b.Blob.NamespaceVersion = uint32(blob.Namespace.Version()) - b.Blob.NamespaceId = blob.Namespace.ID() - b.Blob.Data = blob.Data - b.Blob.ShareVersion = blob.ShareVersion - b.Commitment = blob.Commitment - b.namespace = blob.Namespace - b.index = blob.Index + b.Blob = &blob.Blob{} + b.Blob.NamespaceVersion = uint32(jsonBlob.Namespace.Version()) + b.Blob.NamespaceId = jsonBlob.Namespace.ID() + b.Blob.Data = jsonBlob.Data + b.Blob.ShareVersion = jsonBlob.ShareVersion + b.Commitment = jsonBlob.Commitment + b.namespace = jsonBlob.Namespace + b.index = jsonBlob.Index return nil } diff --git a/blob/blob_test.go b/blob/blob_test.go index 3756e2fffc..d747090758 100644 --- a/blob/blob_test.go +++ b/blob/blob_test.go @@ -6,9 +6,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/types" - apptypes "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + apptypes "github.com/celestiaorg/celestia-app/v2/x/blob/types" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/inclusion" + "github.com/celestiaorg/go-square/merkle" "github.com/celestiaorg/celestia-node/blob/blobtest" ) @@ -36,7 +39,11 @@ func TestBlob(t *testing.T) { { name: "compare commitments", expectedRes: func(t *testing.T) { - comm, err := apptypes.CreateCommitment(&blob[0].Blob) + comm, err := inclusion.CreateCommitment( + blob[0].Blob, + merkle.HashFromByteSlices, + appconsts.SubtreeRootThreshold(appVersion), + ) require.NoError(t, err) assert.Equal(t, blob[0].Commitment, Commitment(comm)) }, @@ -78,7 +85,7 @@ func TestBlob(t *testing.T) { newBlob := &Blob{} require.NoError(t, newBlob.UnmarshalJSON(data)) - require.True(t, bytes.Equal(blob[0].Blob.Data, newBlob.Data)) + require.True(t, bytes.Equal(blob[0].Blob.GetData(), newBlob.Data)) require.True(t, bytes.Equal(blob[0].Commitment, newBlob.Commitment)) }, }, @@ -89,10 +96,10 @@ func TestBlob(t *testing.T) { } } -func convertBlobs(appBlobs ...types.Blob) ([]*Blob, error) { +func convertBlobs(appBlobs ...*blob.Blob) ([]*Blob, error) { blobs := make([]*Blob, 0, len(appBlobs)) - for _, b := range appBlobs { - blob, err := NewBlob(b.ShareVersion, append([]byte{b.NamespaceVersion}, b.NamespaceID...), b.Data) + for _, appBlob := range appBlobs { + blob, err := NewBlob(uint8(appBlob.GetShareVersion()), appBlob.Namespace().Bytes(), appBlob.GetData()) if err != nil { return nil, err } diff --git a/blob/blobtest/testing.go b/blob/blobtest/testing.go index a22f22f790..eb85bead27 100644 --- a/blob/blobtest/testing.go +++ b/blob/blobtest/testing.go @@ -2,30 +2,30 @@ package blobtest import ( tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/shares" - "github.com/celestiaorg/celestia-app/test/util/testfactory" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/test/util/testfactory" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/celestia-node/share" ) // GenerateV0Blobs is a test utility producing v0 share formatted blobs with the // requested size and random namespaces. -func GenerateV0Blobs(sizes []int, sameNamespace bool) ([]types.Blob, error) { - blobs := make([]types.Blob, 0, len(sizes)) +func GenerateV0Blobs(sizes []int, sameNamespace bool) ([]*blob.Blob, error) { + blobs := make([]*blob.Blob, 0, len(sizes)) for _, size := range sizes { size := rawBlobSize(appconsts.FirstSparseShareContentSize * size) appBlob := testfactory.GenerateRandomBlob(size) if !sameNamespace { - nid, err := share.NewBlobNamespaceV0(tmrand.Bytes(7)) + namespace, err := share.NewBlobNamespaceV0(tmrand.Bytes(7)) if err != nil { return nil, err } - appBlob.NamespaceVersion = nid[0] - appBlob.NamespaceID = nid[1:] + appBlob.NamespaceVersion = uint32(namespace[0]) + appBlob.NamespaceId = namespace[1:] } blobs = append(blobs, appBlob) diff --git a/blob/commitment_proof.go b/blob/commitment_proof.go index 5cf419a659..ff08001060 100644 --- a/blob/commitment_proof.go +++ b/blob/commitment_proof.go @@ -4,10 +4,9 @@ import ( "bytes" "fmt" - coretypes "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/appconsts" "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/celestia-app/v2/pkg/proof" "github.com/celestiaorg/nmt" "github.com/celestiaorg/nmt/namespace" @@ -33,8 +32,8 @@ type CommitmentProof struct { NamespaceID namespace.ID `json:"namespace_id"` // RowProof is the proof of the rows containing the blob's data to the // data root. - RowProof coretypes.RowProof `json:"row_proof"` - NamespaceVersion uint8 `json:"namespace_version"` + RowProof proof.RowProof `json:"row_proof"` + NamespaceVersion uint8 `json:"namespace_version"` } func (com Commitment) String() string { diff --git a/blob/helper.go b/blob/helper.go index c1de773c24..17f0068c9e 100644 --- a/blob/helper.go +++ b/blob/helper.go @@ -1,33 +1,29 @@ package blob import ( - "bytes" "sort" - "github.com/tendermint/tendermint/types" - - "github.com/celestiaorg/celestia-app/pkg/shares" - apptypes "github.com/celestiaorg/celestia-app/x/blob/types" + squareblob "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/celestia-node/share" ) // BlobsToShares accepts blobs and convert them to the Shares. -func BlobsToShares(blobs ...*Blob) ([]share.Share, error) { - b := make([]types.Blob, len(blobs)) - for i, blob := range blobs { - namespace := blob.Namespace() - b[i] = types.Blob{ - NamespaceVersion: namespace[0], - NamespaceID: namespace[1:], - Data: blob.Data, - ShareVersion: uint8(blob.ShareVersion), +func BlobsToShares(nodeBlobs ...*Blob) ([]share.Share, error) { + b := make([]*squareblob.Blob, len(nodeBlobs)) + for i, nodeBlob := range nodeBlobs { + namespace := nodeBlob.Namespace() + b[i] = &squareblob.Blob{ + NamespaceVersion: uint32(namespace[0]), + NamespaceId: namespace[1:], + Data: nodeBlob.Data, + ShareVersion: nodeBlob.ShareVersion, } } sort.Slice(b, func(i, j int) bool { - val := bytes.Compare(b[i].NamespaceID, b[j].NamespaceID) - return val < 0 + return b[i].Namespace().Compare(b[j].Namespace()) < 0 }) rawShares, err := shares.SplitBlobs(b...) @@ -37,11 +33,11 @@ func BlobsToShares(blobs ...*Blob) ([]share.Share, error) { return shares.ToBytes(rawShares), nil } -// ToAppBlobs converts node's blob type to the blob type from celestia-app. -func ToAppBlobs(blobs ...*Blob) []*apptypes.Blob { - appBlobs := make([]*apptypes.Blob, 0, len(blobs)) +// ToAppBlobs converts node's blob type to the blob type from go-square. +func ToAppBlobs(blobs ...*Blob) []*squareblob.Blob { + appBlobs := make([]*squareblob.Blob, len(blobs)) for i := range blobs { - appBlobs[i] = &blobs[i].Blob + appBlobs[i] = blobs[i].Blob } return appBlobs } diff --git a/blob/helper_test.go b/blob/helper_test.go new file mode 100644 index 0000000000..b2c25ddeae --- /dev/null +++ b/blob/helper_test.go @@ -0,0 +1,57 @@ +package blob + +import ( + "bytes" + "testing" + + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + squareblob "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestBlobsToShares(t *testing.T) { + t.Run("should sort blobs by namespace in ascending order", func(t *testing.T) { + namespaceA := namespace.MustNewV0(bytes.Repeat([]byte{0xa}, 10)).Bytes() + namespaceB := namespace.MustNewV0(bytes.Repeat([]byte{0xb}, 10)).Bytes() + + blobA, err := NewBlob(appconsts.ShareVersionZero, namespaceA, []byte("dataA")) + require.NoError(t, err) + blobB, err := NewBlob(appconsts.ShareVersionZero, namespaceB, []byte("dataB")) + require.NoError(t, err) + + got, err := BlobsToShares(blobB, blobA) + require.NoError(t, err) + assert.Equal(t, got[0][:appconsts.NamespaceSize], namespaceA) + assert.Equal(t, got[1][:appconsts.NamespaceSize], namespaceB) + assert.IsIncreasing(t, got) + }) +} + +func TestToAppBlobs(t *testing.T) { + namespaceA := namespace.MustNewV0(bytes.Repeat([]byte{0xa}, 10)) + namespaceB := namespace.MustNewV0(bytes.Repeat([]byte{0xb}, 10)) + + blobA, err := NewBlob(appconsts.ShareVersionZero, namespaceA.Bytes(), []byte("dataA")) + require.NoError(t, err) + blobB, err := NewBlob(appconsts.ShareVersionZero, namespaceB.Bytes(), []byte("dataB")) + require.NoError(t, err) + + got := ToAppBlobs(blobA, blobB) + want := []*squareblob.Blob{ + { + NamespaceId: blobA.NamespaceId, + NamespaceVersion: blobA.NamespaceVersion, + Data: blobA.Data, + ShareVersion: blobA.ShareVersion, + }, + { + NamespaceId: blobB.NamespaceId, + NamespaceVersion: blobB.NamespaceVersion, + Data: blobB.Data, + ShareVersion: blobB.ShareVersion, + }, + } + assert.Equal(t, want, got) +} diff --git a/blob/parser.go b/blob/parser.go index 1b5ddc4a7a..0033d29ebf 100644 --- a/blob/parser.go +++ b/blob/parser.go @@ -4,7 +4,7 @@ import ( "errors" "fmt" - "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/go-square/shares" ) // parser helps to collect shares and transform them into a blob. diff --git a/blob/service.go b/blob/service.go index b1c394f075..caf54d2a01 100644 --- a/blob/service.go +++ b/blob/service.go @@ -17,9 +17,10 @@ import ( "go.opentelemetry.io/otel/trace" "github.com/celestiaorg/celestia-app/pkg/appconsts" - appns "github.com/celestiaorg/celestia-app/pkg/namespace" - pkgproof "github.com/celestiaorg/celestia-app/pkg/proof" - "github.com/celestiaorg/celestia-app/pkg/shares" + pkgproof "github.com/celestiaorg/celestia-app/v2/pkg/proof" + "github.com/celestiaorg/go-square/inclusion" + appns "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -169,15 +170,15 @@ func (s *Service) Subscribe(ctx context.Context, ns share.Namespace) (<-chan *Su func (s *Service) Submit(ctx context.Context, blobs []*Blob, txConfig *SubmitOptions) (uint64, error) { log.Debugw("submitting blobs", "amount", len(blobs)) - appblobs := make([]*state.Blob, len(blobs)) + squareBlobs := make([]*state.Blob, len(blobs)) for i := range blobs { if err := blobs[i].Namespace().ValidateForBlob(); err != nil { return 0, err } - appblobs[i] = &blobs[i].Blob + squareBlobs[i] = blobs[i].Blob } - resp, err := s.blobSubmitter.SubmitPayForBlob(ctx, appblobs, txConfig) + resp, err := s.blobSubmitter.SubmitPayForBlob(ctx, squareBlobs, txConfig) if err != nil { return 0, err } @@ -600,10 +601,12 @@ func ProveCommitment( // convert the shares to row root proofs to nmt proofs nmtProofs := make([]*nmt.Proof, 0) for _, proof := range sharesProof.ShareProofs { - nmtProof := nmt.NewInclusionProof(int(proof.Start), + nmtProof := nmt.NewInclusionProof( + int(proof.Start), int(proof.End), proof.Nodes, - true) + true, + ) nmtProofs = append( nmtProofs, &nmtProof, @@ -620,7 +623,7 @@ func ProveCommitment( ranges, err := nmt.ToLeafRanges( proof.Start(), proof.End(), - shares.SubTreeWidth(len(blobShares), appconsts.DefaultSubtreeRootThreshold), + inclusion.SubTreeWidth(len(blobShares), appconsts.DefaultSubtreeRootThreshold), ) if err != nil { return nil, err @@ -642,7 +645,7 @@ func ProveCommitment( SubtreeRoots: subtreeRoots, SubtreeRootProofs: nmtProofs, NamespaceID: namespace.ID(), - RowProof: sharesProof.RowProof, + RowProof: *sharesProof.RowProof, NamespaceVersion: namespace.Version(), } return &commitmentProof, nil diff --git a/blob/service_test.go b/blob/service_test.go index 101c755358..80f2e54b0a 100644 --- a/blob/service_test.go +++ b/blob/service_test.go @@ -18,12 +18,13 @@ import ( "github.com/tendermint/tendermint/crypto/merkle" tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - appns "github.com/celestiaorg/celestia-app/pkg/namespace" - pkgproof "github.com/celestiaorg/celestia-app/pkg/proof" - "github.com/celestiaorg/celestia-app/pkg/shares" - blobtypes "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + pkgproof "github.com/celestiaorg/celestia-app/v2/pkg/proof" "github.com/celestiaorg/go-header/store" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/inclusion" + squarens "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -349,7 +350,7 @@ func TestBlobService_Get(t *testing.T) { { name: "empty result and err when blobs were not found ", doFn: func() (interface{}, error) { - nid, err := share.NewBlobNamespaceV0(tmrand.Bytes(appns.NamespaceVersionZeroIDSize)) + nid, err := share.NewBlobNamespaceV0(tmrand.Bytes(squarens.NamespaceVersionZeroIDSize)) require.NoError(t, err) return service.GetAll(ctx, 1, []share.Namespace{nid}) }, @@ -643,8 +644,8 @@ func TestSkipPaddingsAndRetrieveBlob(t *testing.T) { appBlob, err := blobtest.GenerateV0Blobs([]int{6}, true) require.NoError(t, err) - appBlob[0].NamespaceVersion = nid[0] - appBlob[0].NamespaceID = nid[1:] + appBlob[0].NamespaceVersion = uint32(nid[0]) + appBlob[0].NamespaceId = nid[1:] blobs, err := convertBlobs(appBlob...) require.NoError(t, err) @@ -782,7 +783,7 @@ func TestService_Subscribe_MultipleNamespaces(t *testing.T) { appBlobs2, err := blobtest.GenerateV0Blobs([]int{100, 100}, true) for i := range appBlobs2 { // if we don't do this, appBlobs1 and appBlobs2 will share a NS - appBlobs2[i].NamespaceID[len(appBlobs2[i].NamespaceID)-1] = 0xDE + appBlobs2[i].GetNamespaceId()[len(appBlobs2[i].GetNamespaceId())-1] = 0xDE } require.NoError(t, err) @@ -929,13 +930,13 @@ func TestProveCommitmentAllCombinations(t *testing.T) { tests := map[string]struct { blobSize int }{ - "very small blobs that take less than a share": {blobSize: 350}, - "small blobs that take 2 shares": {blobSize: 1000}, - "small blobs that take ~10 shares": {blobSize: 5000}, - "large blobs ~100 shares": {blobSize: 50000}, - "large blobs ~150 shares": {blobSize: 75000}, - "large blobs ~300 shares": {blobSize: 150000}, - "very large blobs ~1500 shares": {blobSize: 750000}, + "blobs that take less than a share": {blobSize: 350}, + "blobs that take 2 shares": {blobSize: 1000}, + "blobs that take ~10 shares": {blobSize: 5000}, + "large blobs ~100 shares": {blobSize: 50000}, + "large blobs ~150 shares": {blobSize: 75000}, + "large blobs ~300 shares": {blobSize: 150000}, + "very large blobs ~1500 shares": {blobSize: 750000}, } for name, tc := range tests { @@ -949,7 +950,7 @@ func proveAndVerifyShareCommitments(t *testing.T, blobSize int) { msgs, blobs, nss, eds, _, _, dataRoot := edstest.GenerateTestBlock(t, blobSize, 10) for msgIndex, msg := range msgs { t.Run(fmt.Sprintf("msgIndex=%d", msgIndex), func(t *testing.T) { - blb, err := NewBlob(uint8(blobs[msgIndex].ShareVersion), nss[msgIndex].Bytes(), blobs[msgIndex].Data) + blb, err := NewBlob(uint8(blobs[msgIndex].GetShareVersion()), nss[msgIndex].Bytes(), blobs[msgIndex].GetData()) require.NoError(t, err) blobShares, err := BlobsToShares(blb) require.NoError(t, err) @@ -992,14 +993,14 @@ func generateCommitmentProofFromBlock( t *testing.T, eds *rsmt2d.ExtendedDataSquare, ns share.Namespace, - blob *blobtypes.Blob, + blob *blob.Blob, dataRoot []byte, ) CommitmentProof { // create the blob from the data blb, err := NewBlob( - uint8(blob.ShareVersion), + uint8(blob.GetShareVersion()), ns, - blob.Data, + blob.GetData(), ) require.NoError(t, err) @@ -1033,7 +1034,7 @@ func generateCommitmentProofFromBlock( ranges, err := nmt.ToLeafRanges( int(proof.Start), int(proof.End), - shares.SubTreeWidth(len(blobShares), appconsts.DefaultSubtreeRootThreshold), + inclusion.SubTreeWidth(len(blobShares), appconsts.DefaultSubtreeRootThreshold), ) require.NoError(t, err) roots, err := computeSubtreeRoots( @@ -1056,8 +1057,8 @@ func generateCommitmentProofFromBlock( commitmentProof := CommitmentProof{ SubtreeRoots: subtreeRoots, SubtreeRootProofs: nmtProofs, - NamespaceID: sharesProof.NamespaceID, - RowProof: sharesProof.RowProof, + NamespaceID: sharesProof.NamespaceId, + RowProof: *sharesProof.RowProof, NamespaceVersion: uint8(sharesProof.NamespaceVersion), } diff --git a/cmd/cel-key/main.go b/cmd/cel-key/main.go index 736ea9d7f5..5db3f4bc7c 100644 --- a/cmd/cel-key/main.go +++ b/cmd/cel-key/main.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/spf13/cobra" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" ) var encodingConfig = encoding.MakeConfig(app.ModuleEncodingRegisters...) diff --git a/cmd/start.go b/cmd/start.go index 66a2a44a4e..85970cbd6e 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -10,8 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/spf13/cobra" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" "github.com/celestiaorg/celestia-node/nodebuilder" ) diff --git a/core/client_test.go b/core/client_test.go index 8ad9060555..a00c6bb463 100644 --- a/core/client_test.go +++ b/core/client_test.go @@ -20,7 +20,7 @@ func TestRemoteClient_Status(t *testing.T) { } func TestRemoteClient_StartBlockSubscription_And_GetBlock(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) t.Cleanup(cancel) client := StartTestNode(t).Client diff --git a/core/eds.go b/core/eds.go index daab35fe8f..bb53178e09 100644 --- a/core/eds.go +++ b/core/eds.go @@ -8,11 +8,11 @@ import ( "github.com/filecoin-project/dagstore" "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/shares" - "github.com/celestiaorg/celestia-app/pkg/square" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" + "github.com/celestiaorg/go-square/shares" + "github.com/celestiaorg/go-square/square" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -32,7 +32,11 @@ func extendBlock(data types.Data, appVersion uint64, options ...nmt.Option) (*rs } // Construct the data square from the block's transactions - dataSquare, err := square.Construct(data.Txs.ToSliceOfBytes(), appVersion, appconsts.SquareSizeUpperBound(appVersion)) + dataSquare, err := square.Construct( + data.Txs.ToSliceOfBytes(), + appconsts.SquareSizeUpperBound(appVersion), + appconsts.SubtreeRootThreshold(appVersion), + ) if err != nil { return nil, err } diff --git a/core/eds_test.go b/core/eds_test.go index e8528eebe0..f6df18c4be 100644 --- a/core/eds_test.go +++ b/core/eds_test.go @@ -7,8 +7,8 @@ import ( "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" "github.com/celestiaorg/celestia-node/share" ) diff --git a/core/exchange_test.go b/core/exchange_test.go index f397ed6a5b..fc43121425 100644 --- a/core/exchange_test.go +++ b/core/exchange_test.go @@ -12,7 +12,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" "github.com/celestiaorg/celestia-node/header" "github.com/celestiaorg/celestia-node/pruner" @@ -25,7 +25,6 @@ func TestCoreExchange_RequestHeaders(t *testing.T) { t.Cleanup(cancel) cfg := DefaultTestConfig() - cfg.ChainID = testChainID fetcher, cctx := createCoreFetcher(t, cfg) generateNonEmptyBlocks(t, ctx, fetcher, cfg, cctx) @@ -69,7 +68,6 @@ func TestExchange_DoNotStoreHistoric(t *testing.T) { t.Cleanup(cancel) cfg := DefaultTestConfig() - cfg.ChainID = testChainID fetcher, cctx := createCoreFetcher(t, cfg) generateNonEmptyBlocks(t, ctx, fetcher, cfg, cctx) @@ -154,7 +152,7 @@ func fillBlocks( default: } - _, err := cctx.FillBlock(16, cfg.Accounts, flags.BroadcastBlock) + _, err := cctx.FillBlock(16, cfg.Genesis.Accounts()[0].Name, flags.BroadcastBlock) require.NoError(t, err) } } diff --git a/core/fetcher_no_race_test.go b/core/fetcher_no_race_test.go index 890b7c35c1..8b3af8e5e1 100644 --- a/core/fetcher_no_race_test.go +++ b/core/fetcher_no_race_test.go @@ -15,7 +15,7 @@ import ( // TestBlockFetcherHeaderValues tests that both the Commit and ValidatorSet // endpoints are working as intended. func TestBlockFetcherHeaderValues(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) t.Cleanup(cancel) client := StartTestNode(t).Client diff --git a/core/fetcher_test.go b/core/fetcher_test.go index 261b84d78c..42afa42bcd 100644 --- a/core/fetcher_test.go +++ b/core/fetcher_test.go @@ -10,7 +10,7 @@ import ( ) func TestBlockFetcher_GetBlock_and_SubscribeNewBlockEvent(t *testing.T) { - ctx, cancel := context.WithTimeout(context.Background(), time.Second*10) + ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) t.Cleanup(cancel) client := StartTestNode(t).Client diff --git a/core/listener_no_race_test.go b/core/listener_no_race_test.go index 3c261a7261..51b1abe4ca 100644 --- a/core/listener_no_race_test.go +++ b/core/listener_no_race_test.go @@ -25,7 +25,6 @@ func TestListenerWithNonEmptyBlocks(t *testing.T) { // create one block to store as Head in local store and then unsubscribe from block events cfg := DefaultTestConfig() - cfg.ChainID = testChainID fetcher, cctx := createCoreFetcher(t, cfg) eds := createEdsPubSub(ctx, t) @@ -45,7 +44,9 @@ func TestListenerWithNonEmptyBlocks(t *testing.T) { empty := share.EmptyRoot() // TODO extract 16 for i := 0; i < 16; i++ { - _, err := cctx.FillBlock(16, cfg.Accounts, flags.BroadcastBlock) + accounts := cfg.Genesis.Accounts() + require.Greater(t, len(accounts), 0) + _, err := cctx.FillBlock(16, accounts[0].Name, flags.BroadcastBlock) require.NoError(t, err) msg, err := sub.Next(ctx) require.NoError(t, err) diff --git a/core/listener_test.go b/core/listener_test.go index 9850efec5b..60b6600468 100644 --- a/core/listener_test.go +++ b/core/listener_test.go @@ -46,7 +46,7 @@ func TestListener(t *testing.T) { // create one block to store as Head in local store and then unsubscribe from block events cfg := DefaultTestConfig() - cfg.ChainID = testChainID + cfg.Genesis.ChainID = testChainID fetcher, _ := createCoreFetcher(t, cfg) eds := createEdsPubSub(ctx, t) @@ -80,7 +80,7 @@ func TestListenerWithWrongChainRPC(t *testing.T) { // create one block to store as Head in local store and then unsubscribe from block events cfg := DefaultTestConfig() - cfg.ChainID = testChainID + cfg.Genesis.ChainID = testChainID fetcher, _ := createCoreFetcher(t, cfg) eds := createEdsPubSub(ctx, t) @@ -107,7 +107,7 @@ func TestListener_DoesNotStoreHistoric(t *testing.T) { // create one block to store as Head in local store and then unsubscribe from block events cfg := DefaultTestConfig() - cfg.ChainID = testChainID + cfg.Genesis.ChainID = testChainID fetcher, cctx := createCoreFetcher(t, cfg) eds := createEdsPubSub(ctx, t) diff --git a/core/testing.go b/core/testing.go index 8d29ce9bbc..dafeaed756 100644 --- a/core/testing.go +++ b/core/testing.go @@ -10,9 +10,12 @@ import ( tmconfig "github.com/tendermint/tendermint/config" tmrand "github.com/tendermint/tendermint/libs/rand" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/test/util/genesis" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" ) +const chainID = "private" + // DefaultTestConfig returns the default testing configuration for Tendermint + Celestia App tandem. // // It fetches free ports from OS and sets them into configs, s.t. @@ -21,22 +24,20 @@ import ( // // Additionally, it instructs Tendermint + Celestia App tandem to setup 10 funded accounts. func DefaultTestConfig() *testnode.Config { - cfg := testnode.DefaultConfig() - - // instructs creating funded accounts - // 10 usually is enough for testing - accounts := make([]string, 10) - for i := range accounts { - accounts[i] = tmrand.Str(9) - } - - cfg.TmConfig.Consensus.TimeoutCommit = time.Millisecond * 200 + genesis := genesis.NewDefaultGenesis(). + WithChainID(chainID). + WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)). + WithConsensusParams(testnode.DefaultConsensusParams()) - cfg = cfg. - WithAccounts(accounts). - WithSupressLogs(true) + tmConfig := testnode.DefaultTendermintConfig() + tmConfig.Consensus.TimeoutCommit = time.Millisecond * 200 - return cfg + return testnode.DefaultConfig(). + WithChainID(chainID). + WithFundedAccounts(generateRandomAccounts(10)...). // 10 usually is enough for testing + WithGenesis(genesis). + WithTendermintConfig(tmConfig). + WithSuppressLogs(true) } // StartTestNode simply starts Tendermint and Celestia App tandem with default testing @@ -79,3 +80,12 @@ func getEndpoint(cfg *tmconfig.Config) (string, string, error) { } return host, url.Port(), nil } + +// generateRandomAccounts generates n random account names. +func generateRandomAccounts(n int) []string { + accounts := make([]string, n) + for i := range accounts { + accounts[i] = tmrand.Str(9) + } + return accounts +} diff --git a/go.mod b/go.mod index e028bc90d0..7b301db903 100644 --- a/go.mod +++ b/go.mod @@ -9,10 +9,13 @@ require ( github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b github.com/benbjohnson/clock v1.3.5 github.com/celestiaorg/celestia-app v1.13.0 + github.com/celestiaorg/celestia-app/v2 v2.0.0 github.com/celestiaorg/go-fraud v0.2.1 github.com/celestiaorg/go-header v0.6.2 github.com/celestiaorg/go-libp2p-messenger v0.2.0 - github.com/celestiaorg/nmt v0.22.0 + github.com/celestiaorg/go-square v1.1.0 + github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076 + github.com/celestiaorg/nmt v0.22.1 github.com/celestiaorg/rsmt2d v0.13.1 github.com/cosmos/cosmos-sdk v0.46.16 github.com/cristalhq/jwt/v5 v5.4.0 @@ -83,12 +86,10 @@ require ( cloud.google.com/go/storage v1.38.0 // indirect filippo.io/edwards25519 v1.0.0-rc.1 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect - github.com/99designs/keyring v1.2.1 // indirect + github.com/99designs/keyring v1.2.2 // indirect github.com/ChainSafe/go-schnorrkel v1.0.0 // indirect github.com/Jorropo/jsync v1.0.1 // indirect - github.com/Microsoft/go-winio v0.6.1 // indirect - github.com/PuerkitoBio/purell v1.1.1 // indirect - github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect + github.com/Microsoft/go-winio v0.6.2 // indirect github.com/StackExchange/wmi v1.2.1 // indirect github.com/Workiva/go-datastructures v1.0.53 // indirect github.com/armon/go-metrics v0.4.1 // indirect @@ -96,10 +97,10 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect github.com/bgentry/speakeasy v0.1.0 // indirect - github.com/bits-and-blooms/bitset v1.7.0 // indirect + github.com/bits-and-blooms/bitset v1.10.0 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 // indirect github.com/celestiaorg/merkletree v0.0.0-20230308153949-c33506a7aa26 // indirect - github.com/celestiaorg/quantum-gravity-bridge/v2 v2.1.2 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -113,20 +114,21 @@ require ( github.com/containerd/cgroups v1.1.0 // indirect github.com/coreos/go-systemd/v22 v22.5.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-alpha8 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.5.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.6 // indirect + github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2 // indirect github.com/cosmos/ibc-go/v6 v6.3.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.2 // indirect - github.com/crate-crypto/go-kzg-4844 v0.3.0 // indirect + github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/cskr/pubsub v1.0.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c // indirect - github.com/deckarep/golang-set/v2 v2.1.0 // indirect + github.com/deckarep/golang-set/v2 v2.6.0 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.3.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect @@ -137,8 +139,8 @@ require ( github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/elastic/gosigar v0.14.3 // indirect github.com/etclabscore/go-jsonschema-walk v0.0.6 // indirect - github.com/ethereum/c-kzg-4844 v0.4.0 // indirect - github.com/ethereum/go-ethereum v1.13.2 // indirect + github.com/ethereum/c-kzg-4844 v1.0.0 // indirect + github.com/ethereum/go-ethereum v1.14.5 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/flynn/noise v1.1.0 // indirect github.com/francoispqt/gojay v1.2.13 // indirect @@ -149,12 +151,11 @@ require ( github.com/go-logfmt/logfmt v0.6.0 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect - github.com/go-ole/go-ole v1.2.6 // indirect - github.com/go-openapi/jsonpointer v0.19.5 // indirect - github.com/go-openapi/jsonreference v0.19.4 // indirect + github.com/go-ole/go-ole v1.3.0 // indirect + github.com/go-openapi/jsonpointer v0.19.6 // indirect + github.com/go-openapi/jsonreference v0.20.2 // indirect github.com/go-openapi/spec v0.19.11 // indirect - github.com/go-openapi/swag v0.19.11 // indirect - github.com/go-stack/stack v1.8.1 // indirect + github.com/go-openapi/swag v0.22.3 // indirect github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect @@ -173,7 +174,7 @@ require ( github.com/google/uuid v1.6.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect - github.com/gorilla/handlers v1.5.1 // indirect + github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/websocket v1.5.3 // indirect github.com/grafana/pyroscope-go/godeltaprof v0.1.6 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -193,9 +194,9 @@ require ( github.com/hashicorp/golang-lru/arc/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 // indirect - github.com/holiman/uint256 v1.2.3 // indirect + github.com/holiman/uint256 v1.2.4 // indirect github.com/huin/goupnp v1.3.0 // indirect - github.com/iancoleman/orderedmap v0.1.0 // indirect + github.com/iancoleman/orderedmap v0.2.0 // indirect github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/ipfs/bbloom v0.0.4 // indirect @@ -297,7 +298,7 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/regen-network/cosmos-proto v0.3.1 // indirect github.com/rs/cors v1.8.3 // indirect - github.com/rs/zerolog v1.31.0 // indirect + github.com/rs/zerolog v1.33.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/shirou/gopsutil v3.21.6+incompatible // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect diff --git a/go.sum b/go.sum index 2f23150a9b..ba837aef75 100644 --- a/go.sum +++ b/go.sum @@ -205,8 +205,8 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/99designs/keyring v1.2.1 h1:tYLp1ULvO7i3fI5vE21ReQuj99QFSs7lGm0xWyJo87o= -github.com/99designs/keyring v1.2.1/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA= +github.com/99designs/keyring v1.2.2 h1:pZd3neh/EmUzWONb35LxQfvuY7kiSXAq3HQd97+XBn0= +github.com/99designs/keyring v1.2.2/go.mod h1:wes/FrByc8j7lFOAGLGSNEg8f/PaI3cgTBqhFkHUrPk= github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190306092124-e2d15f34fcf9/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8= github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M= @@ -233,15 +233,13 @@ github.com/Kubuxu/go-os-helper v0.0.1/go.mod h1:N8B+I7vPCT80IcP58r50u4+gEEcsZETF github.com/Masterminds/glide v0.13.2/go.mod h1:STyF5vcenH/rUqTEv+/hBXlSTo7KYwg2oc2f4tzPWic= github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= github.com/Masterminds/vcs v1.13.0/go.mod h1:N09YCmOQr6RLxC6UNHzuVwAdodYbbnycGHSmwVJjcKA= -github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= -github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= +github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= +github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -249,8 +247,9 @@ github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrU github.com/StackExchange/wmi v1.2.1 h1:VIkavFPXSjcnS+O8yTq7NI32k0R5Aj+v39y29VYDOSA= github.com/StackExchange/wmi v1.2.1/go.mod h1:rcmrprowKIVzvc+NUiLncP2uuArMWLCbu9SBzvHz7e8= github.com/Stebalien/go-bitfield v0.0.1/go.mod h1:GNjFpasyUVkHMsfEOk8EFLJ9syQ6SI+XWrX9Wf2XH0s= -github.com/VictoriaMetrics/fastcache v1.6.0 h1:C/3Oi3EiBCqufydp1neRZkqcwmEiuRT9c3fqvvgKm5o= github.com/VictoriaMetrics/fastcache v1.6.0/go.mod h1:0qHz5QP0GMX4pfmMA/zt5RgfNuXJrTP0zS7DqpHGGTw= +github.com/VictoriaMetrics/fastcache v1.12.2 h1:N0y9ASrJ0F6h0QaC3o6uJb3NIZ9VKLjCM7NQbSmF7WI= +github.com/VictoriaMetrics/fastcache v1.12.2/go.mod h1:AmC+Nzz1+3G2eCPapF6UcsnkThDcMsQicp4xDukwJYI= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/Workiva/go-datastructures v1.0.53 h1:J6Y/52yX10Xc5JjXmGtWoSSxs3mZnGSaq37xZZh7Yig= @@ -310,8 +309,8 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1U github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/bits-and-blooms/bitset v1.7.0 h1:YjAGVd3XmtK9ktAbX8Zg2g2PwLIMjGREZJHlV4j7NEo= -github.com/bits-and-blooms/bitset v1.7.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88= +github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= github.com/bmizerany/pat v0.0.0-20170815010413-6226ea591a40/go.mod h1:8rLXio+WjiTceGBHIoTvn60HIbs7Hm7bcHjyrSqYB9c= github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= github.com/bradfitz/go-smtpd v0.0.0-20170404230938-deb6d6237625/go.mod h1:HYsPBTaaSFSlLx/70C2HPIMNZpVV8+vt/A+FMnYP11g= @@ -353,8 +352,12 @@ github.com/buger/jsonparser v0.0.0-20181115193947-bf1c66bbce23/go.mod h1:bbYlZJ7 github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/casbin/casbin/v2 v2.1.2/go.mod h1:YcPU1XXisHhLzuxH9coDNf2FbKpjGlbCg3n9yuLkIJQ= +github.com/celestiaorg/blobstream-contracts/v3 v3.1.0 h1:h1Y4V3EMQ2mFmNtWt2sIhZIuyASInj1a9ExI8xOsTOw= +github.com/celestiaorg/blobstream-contracts/v3 v3.1.0/go.mod h1:x4DKyfKOSv1ZJM9NwV+Pw01kH2CD7N5zTFclXIVJ6GQ= github.com/celestiaorg/celestia-app v1.13.0 h1:7MWEox6lim6WDyiP84Y2/ERfWUJxWPfZlKxzO6OFcig= github.com/celestiaorg/celestia-app v1.13.0/go.mod h1:CF9VZwWAlTU0Is/BOsmxqkbkYnnmrgl0YRlSBIzr0m0= +github.com/celestiaorg/celestia-app/v2 v2.0.0 h1:cGrkLbqbaNqj+g+LhvmQ0iFKFyrD/GdU5z3WQI/bq8E= +github.com/celestiaorg/celestia-app/v2 v2.0.0/go.mod h1:0wP0W+GLghvsODxLhAYToKsy0RFKeg1HdZftQG90W5A= github.com/celestiaorg/celestia-core v1.38.0-tm-v0.34.29 h1:HwbA4OegRvXX0aNchBA7Cmu+oIxnH7xRcOhISuDP0ak= github.com/celestiaorg/celestia-core v1.38.0-tm-v0.34.29/go.mod h1:MyElURdWAOJkOp84WZnfEUJ+OLvTwOOHG2lbK9E8XRI= github.com/celestiaorg/cosmos-sdk v1.23.0-sdk-v0.46.16 h1:N2uETI13szEKnGAdKhtTR0EsrpcW0AwRKYER74WLnuw= @@ -367,12 +370,14 @@ github.com/celestiaorg/go-header v0.6.2 h1:qgWyJQg+/x6k4QAfN1rPt2HXHZjQOmCqD0ct4 github.com/celestiaorg/go-header v0.6.2/go.mod h1:Az4S4NxMOJ1eAzOaF8u5AZt5UzsSzg92uqpdXS3yOZE= github.com/celestiaorg/go-libp2p-messenger v0.2.0 h1:/0MuPDcFamQMbw9xTZ73yImqgTO3jHV7wKHvWD/Irao= github.com/celestiaorg/go-libp2p-messenger v0.2.0/go.mod h1:s9PIhMi7ApOauIsfBcQwbr7m+HBzmVfDIS+QLdgzDSo= +github.com/celestiaorg/go-square v1.1.0 h1:K4tBL5PCJwDtpBfyDxxZ3N962aC9VYb5/bw3LjagEtY= +github.com/celestiaorg/go-square v1.1.0/go.mod h1:1EXMErhDrWJM8B8V9hN7dqJ2kUTClfwdqMOmF9yQUa0= +github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076 h1:PYInrsYzrDIsZW9Yb86OTi2aEKuPcpgJt6Mc0Jlc/yg= +github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076/go.mod h1:hlidgivKyvv7m4Yl2Fdf2mSTmazZYxX8+bnr5IQrI98= github.com/celestiaorg/merkletree v0.0.0-20230308153949-c33506a7aa26 h1:P2RI1xJ49EZ8cuHMcH+ZSBonfRDtBS8OS9Jdt1BWX3k= github.com/celestiaorg/merkletree v0.0.0-20230308153949-c33506a7aa26/go.mod h1:2m8ukndOegwB0PU0AfJCwDUQHqd7QQRlSXvQL5VToVY= -github.com/celestiaorg/nmt v0.22.0 h1:AGtfmBiVgreR1KkIV5R7XFNeMp/H4IUDLlBbLjZZ3zk= -github.com/celestiaorg/nmt v0.22.0/go.mod h1:ia/EpCk0enD5yO5frcxoNoFToz2Ghtk2i+blmCRjIY8= -github.com/celestiaorg/quantum-gravity-bridge/v2 v2.1.2 h1:Q8nr5SAtDW5gocrBwqwDJcSS/JedqU58WwQA2SP+nXw= -github.com/celestiaorg/quantum-gravity-bridge/v2 v2.1.2/go.mod h1:s/LzLUw0WeYPJ6qdk4q46jKLOq7rc9Z5Mdrxtfpcigw= +github.com/celestiaorg/nmt v0.22.1 h1:t7fqoP5MJ8mBns5DB2XjfcPxQpS3CKMkY+v+BEkDxYc= +github.com/celestiaorg/nmt v0.22.1/go.mod h1:ia/EpCk0enD5yO5frcxoNoFToz2Ghtk2i+blmCRjIY8= github.com/celestiaorg/rsmt2d v0.13.1 h1:eRhp79DKTkDojwInKVs1lRK6f6zJc1BVlmZfUfI19yQ= github.com/celestiaorg/rsmt2d v0.13.1/go.mod h1:P7t92OATXbBmc/P5uR+GCOBv+PV8wLb0vU32ucrb148= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= @@ -423,16 +428,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/errors v1.8.1 h1:A5+txlVZfOqFBDa4mGz2bUWSp0aHElvHX2bKkdbQu+Y= -github.com/cockroachdb/errors v1.8.1/go.mod h1:qGwQn6JmZ+oMjuLwjWzUNqblqk0xl4CVV3SQbGwK7Ac= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f h1:o/kfcElHqOiXqcou5a3rIlMc7oJbMQkeLk0VQJ7zgqY= -github.com/cockroachdb/logtags v0.0.0-20190617123548-eb05cc24525f/go.mod h1:i/u985jwjWRlyHXQbwatDASoW0RMlZ/3i9yJHE2xLkI= -github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06 h1:T+Np/xtzIjYM/P5NAw0e2Rf1FGvzDau1h54MKvx8G7w= -github.com/cockroachdb/pebble v0.0.0-20230906160148-46873a6a7a06/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= -github.com/cockroachdb/redact v1.0.8 h1:8QG/764wK+vmEYoOlfobpe12EQcS81ukx/a4hdVMxNw= -github.com/cockroachdb/redact v1.0.8/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2 h1:IKgmqgMQlVJIZj19CdocBeSfSaiCbEBZGKODaixqtHM= -github.com/cockroachdb/sentry-go v0.6.1-cockroachdb.2/go.mod h1:8BT+cPK6xvFOcRlk0R8eg+OTkcqI6baNH4xAkpiYVvQ= +github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= +github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/pebble v1.1.0 h1:pcFh8CdCIt2kmEpK0OIatq67Ln9uGDYY3d5XnE0LJG4= +github.com/cockroachdb/pebble v1.1.0/go.mod h1:sEHm5NOXxyiAoKWhoFxT8xMgd/f3RA6qUqQ1BXKrh2E= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= +github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= @@ -473,17 +478,19 @@ github.com/coreos/pkg v0.0.0-20160727233714-3ac0863d7acf/go.mod h1:E3G3o1h8I7cfc github.com/corpix/uarand v0.1.1/go.mod h1:SFKZvkcRoLqVRFZ4u25xPmp6m9ktANfbpXZ7SJ0/FNU= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-proto v1.0.0-alpha8 h1:d3pCRuMYYvGA5bM0ZbbjKn+AoQD4A7dyNG2wzwWalUw= -github.com/cosmos/cosmos-proto v1.0.0-alpha8/go.mod h1:6/p+Bc4O8JKeZqe0VqUGTX31eoYqemTT4C1hLCWsO7I= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.6 h1:XY78yEeNPrEYyNCKlqr9chrwoeSDJ0bV2VjocTk//OU= github.com/cosmos/iavl v0.19.6/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2 h1:Hz4nkpStoXIHrC77CIEyu2mRiN2qysGEZPFRf0fpv7w= +github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6 v6.1.2/go.mod h1:Jo934o/sW7fNxuOa/TjCalSalz+1Fd649eLyANaJx8g= github.com/cosmos/ibc-go/v6 v6.3.0 h1:2EkkqDEd9hTQvzB/BsPhYZsu7T/dzAVA8+VD2UuJLSQ= github.com/cosmos/ibc-go/v6 v6.3.0/go.mod h1:Dm14j9s094bGyCEE8W4fD+2t8IneHv+cz+80Mvwjr1w= github.com/cosmos/ledger-cosmos-go v0.13.2 h1:aY0KZSmUwNKbBm9OvbIjvf7Ozz2YzzpAbgvN2C8x2T0= @@ -497,8 +504,10 @@ github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46t github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668 h1:ZFUue+PNxmHlu7pYv+IYMtqlaO/0VwaGEqKepZf9JpA= github.com/crackcomm/go-gitignore v0.0.0-20231225121904-e25f5bc08668/go.mod h1:p1d6YEZWvFzEh4KLyvBcVSnrfNDDvK2zfK/4x2v/4pE= -github.com/crate-crypto/go-kzg-4844 v0.3.0 h1:UBlWE0CgyFqqzTI+IFyCzA7A3Zw4iip6uzRv5NIXG0A= -github.com/crate-crypto/go-kzg-4844 v0.3.0/go.mod h1:SBP7ikXEgDnUPONgm33HtuDZEDtWa3L4QtN1ocJSEQ4= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c h1:uQYC5Z1mdLRPrZhHjHxufI8+2UG/i25QG92j0Er9p6I= +github.com/crate-crypto/go-ipa v0.0.0-20240223125850-b1e8a79f509c/go.mod h1:geZJZH3SzKCqnz5VT0q/DyIG/tvu/dZk+VIfXicupJs= +github.com/crate-crypto/go-kzg-4844 v1.0.0 h1:TsSgHwrkTKecKJ4kadtHi4b3xHW5dCFUDFnUp1TsawI= +github.com/crate-crypto/go-kzg-4844 v1.0.0/go.mod h1:1kMhvPgI0Ky3yIa+9lFySEBUBXkYxeOi8ZF1sYioxhc= github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -520,8 +529,8 @@ github.com/davidlazar/go-crypto v0.0.0-20170701192655-dcfb0a7ac018/go.mod h1:rQY github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= -github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= -github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= +github.com/deckarep/golang-set/v2 v2.6.0 h1:XfcQbWM1LlMB8BsJ8N9vW5ehnnPVIw0je80NsVHagjM= +github.com/deckarep/golang-set/v2 v2.6.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= @@ -560,8 +569,8 @@ github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwu github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= github.com/docker/docker v1.4.2-0.20180625184442-8e610b2b55bf/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= -github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= -github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec= +github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11 h1:IPrmumsT9t5BS7XcPhgsCTlkWbYg80SEXUzDpReaU6Y= +github.com/docker/go-connections v0.4.1-0.20210727194412-58542c764a11/go.mod h1:a6bNUGTbQBsY6VRHTr4h/rkOXjl244DyRD0tx3fgq4Q= github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4= github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk= @@ -597,11 +606,13 @@ github.com/etclabscore/go-jsonschema-walk v0.0.6 h1:DrNzoKWKd8f8XB5nFGBY00IcjakR github.com/etclabscore/go-jsonschema-walk v0.0.6/go.mod h1:VdfDY72AFAiUhy0ZXEaWSpveGjMT5JcDIm903NGqFwQ= github.com/etclabscore/go-openrpc-reflect v0.0.37 h1:IH0e7JqIvR9OhbbFWi/BHIkXrqbR3Zyia3RJ733eT6c= github.com/etclabscore/go-openrpc-reflect v0.0.37/go.mod h1:0404Ky3igAasAOpyj1eESjstTyneBAIk5PgJFbK4s5E= -github.com/ethereum/c-kzg-4844 v0.4.0 h1:3MS1s4JtA868KpJxroZoepdV0ZKBp3u/O5HcZ7R3nlY= -github.com/ethereum/c-kzg-4844 v0.4.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= +github.com/ethereum/c-kzg-4844 v1.0.0 h1:0X1LBXxaEtYD9xsyj9B9ctQEZIpnvVDeoBx8aHEwTNA= +github.com/ethereum/c-kzg-4844 v1.0.0/go.mod h1:VewdlzQmpT5QSrVhbBuGoCdFJkpaJlO1aQputP83wc0= github.com/ethereum/go-ethereum v1.10.17/go.mod h1:Lt5WzjM07XlXc95YzrhosmR4J9Ahd6X2wyEV2SvGhk0= -github.com/ethereum/go-ethereum v1.13.2 h1:g9mCpfPWqCA1OL4e6C98PeVttb0HadfBRuKTGvMnOvw= -github.com/ethereum/go-ethereum v1.13.2/go.mod h1:gkQ5Ygi64ZBh9M/4iXY1R8WqoNCx1Ey0CkYn2BD4/fw= +github.com/ethereum/go-ethereum v1.14.5 h1:szuFzO1MhJmweXjoM5nSAeDvjNUH3vIQoMzzQnfvjpw= +github.com/ethereum/go-ethereum v1.14.5/go.mod h1:VEDGGhSxY7IEjn98hJRFXl/uFvpRgbIIf2PpXiyGGgc= +github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0 h1:KrE8I4reeVvf7C1tm8elRjj4BdscTYzz/WAbYyf/JI4= +github.com/ethereum/go-verkle v0.1.1-0.20240306133620-7d920df305f0/go.mod h1:D9AJLVXSyZQXJQVk8oh1EwjISE+sJTn2duYIZC0dy3w= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= @@ -612,13 +623,13 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= -github.com/felixge/httpsnoop v1.0.1/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/filecoin-project/go-jsonrpc v0.4.0 h1:W6kEt8YCQGUZpmvDOvLF+vKwRhrLPBN+kaSHYLEio+c= github.com/filecoin-project/go-jsonrpc v0.4.0/go.mod h1:/n/niXcS4ZQua6i37LcVbY1TmlJR0UIK9mDFQq2ICek= -github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5 h1:FtmdgXiUlNeRsoNMFlKLDt+S+6hbjVMEW6RGQ7aUf7c= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= +github.com/fjl/memsize v0.0.2 h1:27txuSD9or+NZlnOWdKUxeBzTAUkWCVh+4Gf2dWFOzA= +github.com/fjl/memsize v0.0.2/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/flynn/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:1i71OnUq3iUe1ma7Lr6yG6/rjvM3emb6yoL7xLFzcVQ= github.com/flynn/noise v1.0.0/go.mod h1:xbMo+0i6+IGbYdJhF31t2eR1BIU0CYc12+BNAKwUTag= @@ -653,6 +664,8 @@ github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqG github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= @@ -693,38 +706,39 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-ole/go-ole v1.2.1/go.mod h1:7FAglXiTm7HKlQRDeOQ6ZNUHidzCWXuZWq/1dTyBNF8= github.com/go-ole/go-ole v1.2.5/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= -github.com/go-ole/go-ole v1.2.6 h1:/Fpf6oFPoeFik9ty7siob0G6Ke8QvQEuVcuChpwXzpY= -github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0= +github.com/go-ole/go-ole v1.3.0 h1:Dt6ye7+vXGIKZ7Xtk4s6/xVdGDQynvom7xCFEdWr6uE= +github.com/go-ole/go-ole v1.3.0/go.mod h1:5LS6F96DhAwUc7C+1HLexzMXY1xGRSryjyPPKW6zv78= github.com/go-openapi/jsonpointer v0.19.2/go.mod h1:3akKfEdA7DF1sugOqz1dVQHBcuDBPKZGEoHC/NkiQRg= github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= github.com/go-openapi/jsonpointer v0.19.5/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg= +github.com/go-openapi/jsonpointer v0.19.6 h1:eCs3fxoIi3Wh6vtgmLTOjdhSpiqphQ+DaPn38N2ZdrE= +github.com/go-openapi/jsonpointer v0.19.6/go.mod h1:osyAmYz/mB/C3I+WsTTSgw1ONzaLJoLCyoi6/zppojs= github.com/go-openapi/jsonreference v0.19.2/go.mod h1:jMjeRr2HHw6nAVajTXJ4eiUwohSTlpa0o73RUL1owJc= github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL98+wF9xc8zWvFonSJ8= -github.com/go-openapi/jsonreference v0.19.4 h1:3Vw+rh13uq2JFNxgnMTGE1rnoieU9FmyE1gvnyylsYg= github.com/go-openapi/jsonreference v0.19.4/go.mod h1:RdybgQwPxbL4UEjuAruzK1x3nE69AqPYEJeo/TWfEeg= +github.com/go-openapi/jsonreference v0.20.2 h1:3sVjiK66+uXK/6oQ8xgcRKcFgQ5KXa2KvnJRumpMGbE= +github.com/go-openapi/jsonreference v0.20.2/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= github.com/go-openapi/spec v0.19.7/go.mod h1:Hm2Jr4jv8G1ciIAo+frC/Ft+rR2kQDh8JHKHb3gWUSk= github.com/go-openapi/spec v0.19.11 h1:ogU5q8dtp3MMPn59a9VRrPKVxvJHEs5P7yNMR5sNnis= github.com/go-openapi/spec v0.19.11/go.mod h1:vqK/dIdLGCosfvYsQV3WfC7N3TiZSnGY2RZKoFK7X28= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.8/go.mod h1:ao+8BpOPyKdpQz3AOJfbeEVpLmWAvlT1IfTe5McPyhY= -github.com/go-openapi/swag v0.19.11 h1:RFTu/dlFySpyVvJDfp/7674JY4SDglYWKztbiIGFpmc= github.com/go-openapi/swag v0.19.11/go.mod h1:Uc0gKkdR+ojzsEpjh39QChyu92vPgIr72POcgHMAgSY= +github.com/go-openapi/swag v0.22.3 h1:yMBqmnQ0gyZvEb/+KzuWZOXgllrXT4SADYbvDaXHv/g= +github.com/go-openapi/swag v0.22.3/go.mod h1:UzaqsxGiab7freDnrUUra0MwWfN/q7tE4j+VcZ0yl14= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= -github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE= -github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.11.2 h1:q3SHpufmypg+erIExEKUmsgmhDTyhcJ38oeKGACXohU= +github.com/go-playground/validator/v10 v10.11.2/go.mod h1:NieE624vt4SCTJtD87arVLvdmjPAeV8BQlHtMnw9D7s= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= -github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= @@ -747,8 +761,9 @@ github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRx github.com/gogo/gateway v1.1.0 h1:u0SuhL9+Il+UbjM9VIE3ntfRujKbvVpFvNB4HbjeVQ0= github.com/gogo/gateway v1.1.0/go.mod h1:S7rR8FRQyG3QFESeSv4l2WnsyzlCLG0CzBbUUo/mbic= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= -github.com/golang-jwt/jwt/v4 v4.3.0 h1:kHL1vqdqWNfATmA0FNMdmZNMyZI1U6O31X4rlIPoBog= github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= +github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= +github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= @@ -894,8 +909,8 @@ github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORR github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c h1:7lF+Vz0LqiRidnzC1Oq86fpX1q/iEv2KJdrCtttYjT4= github.com/gopherjs/gopherjs v0.0.0-20190430165422-3e4dfb77656c/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= -github.com/gorilla/handlers v1.5.1 h1:9lRY6j8DEeeBT10CvO9hGW0gmky0BprnvDI5vfhUHH4= -github.com/gorilla/handlers v1.5.1/go.mod h1:t8XrUpc4KVXb7HGyJ4/cEnwQiaxrX/hz1Zv/4g96P1Q= +github.com/gorilla/handlers v1.5.2 h1:cLTUSsNkgcwhgRqvCNmdbRWG0A3N4F+M2nWKdScwyEE= +github.com/gorilla/handlers v1.5.2/go.mod h1:dX+xVpaxdSw+q0Qek8SSsl3dfMk3jNddUkMzo0GtH0w= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= @@ -994,13 +1009,13 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3 h1:aSVUgRRRtOrZOC1fYmY9gV0e9z/Iu+xNVSASWjsuyGU= github.com/hdevalence/ed25519consensus v0.0.0-20220222234857-c00d1f31bab3/go.mod h1:5PC6ZNPde8bBqU/ewGZig35+UIZtw9Ytxez8/q5ZyFE= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7 h1:3JQNjnMRil1yD0IfZKHF9GxxWKDJGj8I0IqOUol//sw= -github.com/holiman/billy v0.0.0-20230718173358-1c7e68d277a7/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4 h1:X4egAf/gcS1zATw6wn4Ej8vjuVGxeHdan+bRb2ebyv4= +github.com/holiman/billy v0.0.0-20240216141850-2abb0c79d3c4/go.mod h1:5GuXa7vkL8u9FkFuWdVvfR5ix8hRB7DbOAaYULamFpc= github.com/holiman/bloomfilter/v2 v2.0.3 h1:73e0e/V0tCydx14a0SCYS/EWCxgwLZ18CZcZKVu0fao= github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iURXE7ZOP9L9hSkA= github.com/holiman/uint256 v1.2.0/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= -github.com/holiman/uint256 v1.2.3 h1:K8UWO1HUJpRMXBxbmaY1Y8IAMZC/RsKB+ArEnnK4l5o= -github.com/holiman/uint256 v1.2.3/go.mod h1:SC8Ryt4n+UBbPbIBKaG9zbbDlp4jOru9xFZmPzLUTxw= +github.com/holiman/uint256 v1.2.4 h1:jUc4Nk8fm9jZabQuqr2JzednajVmBpC+oiTiXZJEApU= +github.com/holiman/uint256 v1.2.4/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= @@ -1010,8 +1025,9 @@ github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc= github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= github.com/iancoleman/orderedmap v0.0.0-20190318233801-ac98e3ecb4b0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= -github.com/iancoleman/orderedmap v0.1.0 h1:2orAxZBJsvimgEBmMWfXaFlzSG2fbQil5qzP3F6cCkg= github.com/iancoleman/orderedmap v0.1.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= +github.com/iancoleman/orderedmap v0.2.0 h1:sq1N/TFpYH++aViPcaKjys3bDClUEU7s5B+z6jq8pNA= +github.com/iancoleman/orderedmap v0.2.0/go.mod h1:N0Wam8K1arqPXNWjMo21EXnBPOPp36vB07FNRdD2geA= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= @@ -1732,8 +1748,8 @@ github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= -github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= -github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= +github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-tty v0.0.0-20180907095812-13ff1204f104/go.mod h1:XPvLUNfbS4fJH25nqRHfWLMa1ONC8Amw+mIA639KxkE= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= @@ -1964,8 +1980,8 @@ github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333 h1:CznVS40zms github.com/open-rpc/meta-schema v0.0.0-20201029221707-1b72ef2ea333/go.mod h1:Ag6rSXkHIckQmjFBCweJEEt1mrTPBv8b9W4aU/NQWfI= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= -github.com/opencontainers/image-spec v1.1.0-rc2 h1:2zx/Stx4Wc5pIPDvIxHXvXtQFW/7XWJGmnM7r3wg034= -github.com/opencontainers/image-spec v1.1.0-rc2/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b h1:YWuSjZCQAPM8UUBLkYUk1e+rZcvWHJmFb6i6rM44Xs8= +github.com/opencontainers/image-spec v1.1.0-rc2.0.20221005185240-3a7f492d3f1b/go.mod h1:3OVijpioIKYWTqjiG0zfF6wvoJ4fAXGbjdZuI2NgsRQ= github.com/opencontainers/runc v1.1.3 h1:vIXrkId+0/J2Ymu2m7VjGvbSlAId9XNRPhn2p4b+d8w= github.com/opencontainers/runc v1.1.3/go.mod h1:1J5XiS+vdZ3wCyZybsuxXZWGrgSr8fFJHLXuG2PsnNg= github.com/opencontainers/runtime-spec v1.0.2/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= @@ -2165,8 +2181,8 @@ github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.2.1/go.mod h1:+uKXf+4Djp6Md1KODXJxgGQPKngRmWyn10oCKFzNHOQ= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.21.0/go.mod h1:ZPhntP/xmq1nnND05hhpAh2QMhSsA4UN3MGZ6O2J3hM= -github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= -github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= +github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= +github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/russross/blackfriday v1.5.2 h1:HyvC0ARfnZBqnXwABFeSZHpKvJHJJfPz81GNueLj0oo= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -2332,8 +2348,9 @@ github.com/ucarion/urlpath v0.0.0-20200424170820-7ccc79b76bbb/go.mod h1:ikPs9bRW github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.9 h1:rmenucSohSTiyL09Y+l2OCk+FrMxGMzho2+tjr5ticU= +github.com/ugorji/go/codec v1.2.9/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= @@ -3311,8 +3328,8 @@ gopkg.in/gcfg.v1 v1.2.3/go.mod h1:yesOnuUOFQAhST5vPY4nbZsb/huCgGGXlipJsBn0b3o= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= -gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/natefinch/lumberjack.v2 v2.2.1 h1:bBRl1b0OH9s/DuPhuXpNl+VtCaJXFZ5/uEFST95x9zc= +gopkg.in/natefinch/lumberjack.v2 v2.2.1/go.mod h1:YD8tP3GAjkrDg1eZH7EGmyESg/lsYskCTPBJVb9jqSc= gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce/go.mod h1:5AcXVHNjg+BDxry382+8OKon8SEWiKktQR07RKPsv1c= gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6/go.mod h1:uAJfkITjFhyEEuUfm7bsmCZRbW5WRq8s9EY8HZ6hCns= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= @@ -3355,8 +3372,8 @@ lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1 nhooyr.io/websocket v1.8.6/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= nhooyr.io/websocket v1.8.7 h1:usjR2uOr/zjjkVMy0lW+PPohFok7PCow5sDjLgX4P4g= nhooyr.io/websocket v1.8.7/go.mod h1:B70DZP8IakI65RVQ51MsWP/8jndNma26DVA/nFSCgW0= -pgregory.net/rapid v0.5.3 h1:163N50IHFqr1phZens4FQOdPgfJscR7a562mjQqeo4M= -pgregory.net/rapid v0.5.3/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= +pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= diff --git a/header/header.go b/header/header.go index 01a84a2c0a..3ec691307d 100644 --- a/header/header.go +++ b/header/header.go @@ -11,8 +11,9 @@ import ( "github.com/tendermint/tendermint/light" core "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/da" + v1 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v1" + v2 "github.com/celestiaorg/celestia-app/v2/pkg/appconsts/v2" + "github.com/celestiaorg/celestia-app/v2/pkg/da" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/rsmt2d" ) @@ -114,9 +115,13 @@ func (eh *ExtendedHeader) Validate() error { return fmt.Errorf("ValidateBasic error on RawHeader at height %d: %w", eh.Height(), err) } - if eh.RawHeader.Version.App != appconsts.LatestVersion { - return fmt.Errorf("app version mismatch, expected: %d, got %d", appconsts.LatestVersion, - eh.RawHeader.Version.App) + if eh.RawHeader.Version.App != v1.Version && eh.RawHeader.Version.App != v2.Version { + return fmt.Errorf( + "app version mismatch, expected: %d or %d, got %d", + v1.Version, + v2.Version, + eh.RawHeader.Version.App, + ) } err = eh.Commit.ValidateBasic() diff --git a/header/headertest/fraud/testing.go b/header/headertest/fraud/testing.go index 66965cf178..7a876c7ecf 100644 --- a/header/headertest/fraud/testing.go +++ b/header/headertest/fraud/testing.go @@ -11,7 +11,7 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/header/headertest/testing.go b/header/headertest/testing.go index eec36bc9b3..245288b8c5 100644 --- a/header/headertest/testing.go +++ b/header/headertest/testing.go @@ -17,7 +17,7 @@ import ( "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/go-header/headertest" "github.com/celestiaorg/rsmt2d" diff --git a/header/headertest/validate_test.go b/header/headertest/validate_test.go new file mode 100644 index 0000000000..8d95c357de --- /dev/null +++ b/header/headertest/validate_test.go @@ -0,0 +1,64 @@ +package headertest + +import ( + "fmt" + "strconv" + "testing" + "time" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + "github.com/tendermint/tendermint/types" + + "github.com/celestiaorg/celestia-app/v2/pkg/da" + + "github.com/celestiaorg/celestia-node/header" +) + +func TestValidate(t *testing.T) { + testCases := []struct { + extendedHeader *header.ExtendedHeader + wantErr error + }{ + { + extendedHeader: getExtendedHeader(t, 1), + wantErr: nil, + }, + { + extendedHeader: getExtendedHeader(t, 2), + wantErr: nil, + }, + { + extendedHeader: getExtendedHeader(t, 3), + wantErr: fmt.Errorf("app version mismatch, expected: 1 or 2, got 3"), + }, + } + + for i, tc := range testCases { + t.Run(strconv.Itoa(i), func(t *testing.T) { + got := tc.extendedHeader.Validate() + assert.Equal(t, tc.wantErr, got) + }) + } +} + +func getExtendedHeader(t *testing.T, appVersion uint64) *header.ExtendedHeader { + validatorSet, privValidators := RandValidatorSet(1, 1) + rawHeader := RandRawHeader(t) + rawHeader.Version.App = appVersion + rawHeader.ValidatorsHash = validatorSet.Hash() + + minHeader := da.MinDataAvailabilityHeader() + rawHeader.DataHash = minHeader.Hash() + + blockID := RandBlockID(t) + blockID.Hash = rawHeader.Hash() + voteSet := types.NewVoteSet(rawHeader.ChainID, rawHeader.Height, 0, tmproto.PrecommitType, validatorSet) + commit, err := MakeCommit(blockID, rawHeader.Height, 0, voteSet, privValidators, time.Now()) + require.NoError(t, err) + + result, err := header.MakeExtendedHeader(rawHeader, commit, validatorSet, nil) + require.NoError(t, err) + return result +} diff --git a/header/pb/extended_header.pb.go b/header/pb/extended_header.pb.go index 59fdee0d72..03ca6cba06 100644 --- a/header/pb/extended_header.pb.go +++ b/header/pb/extended_header.pb.go @@ -5,7 +5,7 @@ package header_pb import ( fmt "fmt" - da "github.com/celestiaorg/celestia-app/proto/celestia/da" + da "github.com/celestiaorg/celestia-app/v2/proto/celestia/core/v1/da" proto "github.com/gogo/protobuf/proto" types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" diff --git a/header/serde.go b/header/serde.go index a511a1352b..fae310457b 100644 --- a/header/serde.go +++ b/header/serde.go @@ -5,7 +5,7 @@ import ( core "github.com/tendermint/tendermint/types" "golang.org/x/crypto/blake2b" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" header_pb "github.com/celestiaorg/celestia-node/header/pb" ) diff --git a/libs/edssser/edssser.go b/libs/edssser/edssser.go index 34712b785a..10c9c6b3bd 100644 --- a/libs/edssser/edssser.go +++ b/libs/edssser/edssser.go @@ -11,7 +11,7 @@ import ( "github.com/ipfs/go-datastore" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/celestia-node/share/eds" "github.com/celestiaorg/celestia-node/share/eds/edstest" diff --git a/libs/keystore/map_keystore.go b/libs/keystore/map_keystore.go index 84de91458e..9efd21f88b 100644 --- a/libs/keystore/map_keystore.go +++ b/libs/keystore/map_keystore.go @@ -6,8 +6,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" ) // mapKeystore is a simple in-memory Keystore implementation. diff --git a/nodebuilder/da/service.go b/nodebuilder/da/service.go index ebb47b9e3f..113fe10c80 100644 --- a/nodebuilder/da/service.go +++ b/nodebuilder/da/service.go @@ -10,7 +10,7 @@ import ( logging "github.com/ipfs/go-log/v2" "github.com/rollkit/go-da" - "github.com/celestiaorg/celestia-app/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" "github.com/celestiaorg/celestia-node/blob" nodeblob "github.com/celestiaorg/celestia-node/nodebuilder/blob" diff --git a/nodebuilder/init.go b/nodebuilder/init.go index 2de71a3998..6c0854ff91 100644 --- a/nodebuilder/init.go +++ b/nodebuilder/init.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/gofrs/flock" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" "github.com/celestiaorg/celestia-node/libs/utils" "github.com/celestiaorg/celestia-node/nodebuilder/node" diff --git a/nodebuilder/init_test.go b/nodebuilder/init_test.go index bc345626c2..99c93d7878 100644 --- a/nodebuilder/init_test.go +++ b/nodebuilder/init_test.go @@ -11,8 +11,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" "github.com/celestiaorg/celestia-node/nodebuilder/node" ) diff --git a/nodebuilder/share/constructors.go b/nodebuilder/share/constructors.go index 10bec434b3..49789a8771 100644 --- a/nodebuilder/share/constructors.go +++ b/nodebuilder/share/constructors.go @@ -7,7 +7,7 @@ import ( "github.com/filecoin-project/dagstore" "github.com/ipfs/boxo/blockservice" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" headerServ "github.com/celestiaorg/celestia-node/nodebuilder/header" "github.com/celestiaorg/celestia-node/share" diff --git a/nodebuilder/store_test.go b/nodebuilder/store_test.go index 52207a86e1..a7968a6d72 100644 --- a/nodebuilder/store_test.go +++ b/nodebuilder/store_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/nodebuilder/tests/api_test.go b/nodebuilder/tests/api_test.go index f9e10c5ea6..0a4839345e 100644 --- a/nodebuilder/tests/api_test.go +++ b/nodebuilder/tests/api_test.go @@ -111,9 +111,9 @@ func TestBlobRPC(t *testing.T) { require.NoError(t, err) newBlob, err := blob.NewBlob( - appBlobs[0].ShareVersion, - append([]byte{appBlobs[0].NamespaceVersion}, appBlobs[0].NamespaceID...), - appBlobs[0].Data, + uint8(appBlobs[0].GetShareVersion()), + appBlobs[0].Namespace().Bytes(), + appBlobs[0].GetData(), ) require.NoError(t, err) diff --git a/nodebuilder/tests/blob_test.go b/nodebuilder/tests/blob_test.go index a1478108a2..bd3c94847a 100644 --- a/nodebuilder/tests/blob_test.go +++ b/nodebuilder/tests/blob_test.go @@ -13,6 +13,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + squareblob "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/celestia-node/blob" "github.com/celestiaorg/celestia-node/blob/blobtest" "github.com/celestiaorg/celestia-node/nodebuilder/node" @@ -32,8 +34,8 @@ func TestBlobModule(t *testing.T) { require.NoError(t, err) blobs := make([]*blob.Blob, 0, len(appBlobs0)+len(appBlobs1)) - for _, b := range append(appBlobs0, appBlobs1...) { - blob, err := blob.NewBlob(b.ShareVersion, append([]byte{b.NamespaceVersion}, b.NamespaceID...), b.Data) + for _, squareBlob := range append(appBlobs0, appBlobs1...) { + blob, err := convert(squareBlob) require.NoError(t, err) blobs = append(blobs, blob) } @@ -117,11 +119,7 @@ func TestBlobModule(t *testing.T) { doFn: func(t *testing.T) { appBlob, err := blobtest.GenerateV0Blobs([]int{4}, false) require.NoError(t, err) - newBlob, err := blob.NewBlob( - appBlob[0].ShareVersion, - append([]byte{appBlob[0].NamespaceVersion}, appBlob[0].NamespaceID...), - appBlob[0].Data, - ) + newBlob, err := convert(appBlob[0]) require.NoError(t, err) b, err := fullClient.Blob.Get(ctx, height, newBlob.Namespace(), newBlob.Commitment) @@ -139,11 +137,7 @@ func TestBlobModule(t *testing.T) { doFn: func(t *testing.T) { appBlob, err := blobtest.GenerateV0Blobs([]int{8, 4}, true) require.NoError(t, err) - b, err := blob.NewBlob( - appBlob[0].ShareVersion, - append([]byte{appBlob[0].NamespaceVersion}, appBlob[0].NamespaceID...), - appBlob[0].Data, - ) + b, err := convert(appBlob[0]) require.NoError(t, err) height, err := fullClient.Blob.Submit(ctx, []*blob.Blob{b, b}, state.NewTxConfig()) @@ -207,3 +201,9 @@ func TestBlobModule(t *testing.T) { }) } } + +// convert converts a squareblob.Blob to a blob.Blob. +// convert may be deduplicated with convertBlobs from the blob package. +func convert(squareBlob *squareblob.Blob) (nodeBlob *blob.Blob, err error) { + return blob.NewBlob(uint8(squareBlob.GetShareVersion()), squareBlob.Namespace().Bytes(), squareBlob.GetData()) +} diff --git a/nodebuilder/tests/da_test.go b/nodebuilder/tests/da_test.go index 12cbe17fdd..292227881d 100644 --- a/nodebuilder/tests/da_test.go +++ b/nodebuilder/tests/da_test.go @@ -12,7 +12,7 @@ import ( "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" "github.com/celestiaorg/celestia-node/blob" "github.com/celestiaorg/celestia-node/blob/blobtest" @@ -37,8 +37,12 @@ func TestDaModule(t *testing.T) { blobs := make([]*blob.Blob, 0, len(appBlobs0)+len(appBlobs1)) daBlobs := make([][]byte, 0, len(appBlobs0)+len(appBlobs1)) - for _, b := range append(appBlobs0, appBlobs1...) { - blob, err := blob.NewBlob(b.ShareVersion, namespace, b.Data) + for _, squareBlob := range append(appBlobs0, appBlobs1...) { + blob, err := blob.NewBlob( + uint8(squareBlob.GetShareVersion()), + squareBlob.Namespace().Bytes(), + squareBlob.GetData(), + ) require.NoError(t, err) blobs = append(blobs, blob) daBlobs = append(daBlobs, blob.Data) diff --git a/nodebuilder/tests/fraud_test.go b/nodebuilder/tests/fraud_test.go index 2630475820..83375df6b0 100644 --- a/nodebuilder/tests/fraud_test.go +++ b/nodebuilder/tests/fraud_test.go @@ -56,7 +56,7 @@ func TestFraudProofHandling(t *testing.T) { ) sw := swamp.NewSwamp(t, swamp.WithBlockTime(blockTime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, blockSize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], blockSize, blocks) set, val := sw.Validators(t) fMaker := headerfraud.NewFraudMaker(t, 10, []types.PrivValidator{val}, set) diff --git a/nodebuilder/tests/nd_test.go b/nodebuilder/tests/nd_test.go index 338aa6d0c1..d82f405a0c 100644 --- a/nodebuilder/tests/nd_test.go +++ b/nodebuilder/tests/nd_test.go @@ -33,7 +33,7 @@ func TestShrexNDFromLights(t *testing.T) { t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) bridge := sw.NewBridgeNode() sw.SetBootstrapper(t, bridge) @@ -85,14 +85,14 @@ func TestShrexNDFromLightsWithBadFulls(t *testing.T) { btime = time.Millisecond * 300 bsize = 16 amountOfFulls = 5 - testTimeout = time.Second * 10 + testTimeout = time.Second * 20 ) ctx, cancel := context.WithTimeout(context.Background(), testTimeout) t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) bridge := sw.NewBridgeNode() sw.SetBootstrapper(t, bridge) diff --git a/nodebuilder/tests/prune_test.go b/nodebuilder/tests/prune_test.go index 79a20ef1f9..59b665e141 100644 --- a/nodebuilder/tests/prune_test.go +++ b/nodebuilder/tests/prune_test.go @@ -47,7 +47,7 @@ func TestArchivalBlobSync(t *testing.T) { t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) archivalBN := sw.NewBridgeNode() sw.SetBootstrapper(t, archivalBN) diff --git a/nodebuilder/tests/reconstruct_test.go b/nodebuilder/tests/reconstruct_test.go index d047182669..98789cbcc1 100644 --- a/nodebuilder/tests/reconstruct_test.go +++ b/nodebuilder/tests/reconstruct_test.go @@ -45,7 +45,7 @@ func TestFullReconstructFromBridge(t *testing.T) { ctx, cancel := context.WithTimeout(context.Background(), swamp.DefaultTestTimeout) t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) bridge := sw.NewBridgeNode() err := bridge.Start(ctx) @@ -102,7 +102,7 @@ func TestFullReconstructFromFulls(t *testing.T) { t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) const defaultTimeInterval = time.Second * 5 bridge := sw.NewBridgeNode() @@ -273,7 +273,7 @@ func TestFullReconstructFromLights(t *testing.T) { t.Cleanup(cancel) sw := swamp.NewSwamp(t, swamp.WithBlockTime(btime)) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, blocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, blocks) const defaultTimeInterval = time.Second * 5 cfg := nodebuilder.DefaultConfig(node.Full) diff --git a/nodebuilder/tests/swamp/config.go b/nodebuilder/tests/swamp/config.go index 047baa9f59..39740c6d18 100644 --- a/nodebuilder/tests/swamp/config.go +++ b/nodebuilder/tests/swamp/config.go @@ -3,7 +3,7 @@ package swamp import ( "time" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" "github.com/celestiaorg/celestia-node/core" ) diff --git a/nodebuilder/tests/swamp/swamp.go b/nodebuilder/tests/swamp/swamp.go index 3578698622..e601ba5a13 100644 --- a/nodebuilder/tests/swamp/swamp.go +++ b/nodebuilder/tests/swamp/swamp.go @@ -21,7 +21,7 @@ import ( "go.uber.org/fx" "golang.org/x/exp/maps" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/celestia-node/core" @@ -39,8 +39,8 @@ import ( var blackholeIP6 = net.ParseIP("100::") // DefaultTestTimeout should be used as the default timeout on all the Swamp tests. -// It's generously set to 5 minutes to give enough time for CI. -const DefaultTestTimeout = time.Minute * 5 +// It's generously set to 10 minutes to give enough time for CI. +const DefaultTestTimeout = time.Minute * 10 // Swamp represents the main functionality that is needed for the test-case: // - Network to link the nodes @@ -84,7 +84,7 @@ func NewSwamp(t *testing.T, options ...Option) *Swamp { cfg: ic, Network: mocknet.New(), ClientContext: cctx, - Accounts: ic.Accounts, + Accounts: getAccounts(ic), nodes: map[*nodebuilder.Node]struct{}{}, } @@ -93,6 +93,13 @@ func NewSwamp(t *testing.T, options ...Option) *Swamp { return swp } +func getAccounts(config *testnode.Config) (accounts []string) { + for _, account := range config.Genesis.Accounts() { + accounts = append(accounts, account.Name) + } + return accounts +} + // cleanup frees up all the resources // including stop of all created nodes func (s *Swamp) cleanup() { diff --git a/nodebuilder/tests/swamp/swamp_tx.go b/nodebuilder/tests/swamp/swamp_tx.go index 656b2f341d..3cfe904ab1 100644 --- a/nodebuilder/tests/swamp/swamp_tx.go +++ b/nodebuilder/tests/swamp/swamp_tx.go @@ -6,12 +6,12 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" ) // FillBlocks produces the given amount of contiguous blocks with customizable size. // The returned channel reports when the process is finished. -func FillBlocks(ctx context.Context, cctx testnode.Context, accounts []string, bsize, blocks int) chan error { +func FillBlocks(ctx context.Context, cctx testnode.Context, account string, bsize, blocks int) chan error { errCh := make(chan error) go func() { // TODO: FillBlock must respect the context @@ -19,7 +19,7 @@ func FillBlocks(ctx context.Context, cctx testnode.Context, accounts []string, b time.Sleep(time.Millisecond * 50) var err error for i := 0; i < blocks; i++ { - _, err = cctx.FillBlock(bsize, accounts, flags.BroadcastBlock) + _, err = cctx.FillBlock(bsize, account, flags.BroadcastBlock) if err != nil { break } diff --git a/nodebuilder/tests/sync_test.go b/nodebuilder/tests/sync_test.go index ec8386ea43..90baabd218 100644 --- a/nodebuilder/tests/sync_test.go +++ b/nodebuilder/tests/sync_test.go @@ -49,7 +49,7 @@ func TestSyncAgainstBridge_NonEmptyChain(t *testing.T) { sw := swamp.NewSwamp(t, swamp.WithBlockTime(sbtime)) // wait for core network to fill 20 blocks - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, numBlocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, numBlocks) sw.WaitTillHeight(ctx, numBlocks) // create a bridge node and set it as the bootstrapper for the suite @@ -222,7 +222,7 @@ func TestSyncStartStopLightWithBridge(t *testing.T) { sw := swamp.NewSwamp(t) // wait for core network to fill 20 blocks - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, numBlocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, numBlocks) sw.WaitTillHeight(ctx, numBlocks) // create bridge and set it as a bootstrapper @@ -289,7 +289,7 @@ func TestSyncLightAgainstFull(t *testing.T) { sw := swamp.NewSwamp(t) // wait for the core network to fill up 20 blocks - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, numBlocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, numBlocks) sw.WaitTillHeight(ctx, numBlocks) // create bridge and set it as a bootstrapper @@ -367,7 +367,7 @@ func TestSyncLightWithTrustedPeers(t *testing.T) { t.Cleanup(cancel) sw := swamp.NewSwamp(t) - fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts, bsize, numBlocks) + fillDn := swamp.FillBlocks(ctx, sw.ClientContext, sw.Accounts[0], bsize, numBlocks) sw.WaitTillHeight(ctx, numBlocks) // create a BN and set as a bootstrapper diff --git a/share/availability.go b/share/availability.go index f3511da450..84ae08bc53 100644 --- a/share/availability.go +++ b/share/availability.go @@ -4,7 +4,7 @@ import ( "context" "errors" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/header" diff --git a/share/availability/full/availability_test.go b/share/availability/full/availability_test.go index 8ac0648a87..400acfa087 100644 --- a/share/availability/full/availability_test.go +++ b/share/availability/full/availability_test.go @@ -8,7 +8,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/celestia-node/header/headertest" "github.com/celestiaorg/celestia-node/share" diff --git a/share/eds/byzantine/bad_encoding.go b/share/eds/byzantine/bad_encoding.go index 9c754eaf47..7e1386a863 100644 --- a/share/eds/byzantine/bad_encoding.go +++ b/share/eds/byzantine/bad_encoding.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/go-fraud" "github.com/celestiaorg/rsmt2d" diff --git a/share/eds/byzantine/bad_encoding_test.go b/share/eds/byzantine/bad_encoding_test.go index d54ed23940..59ac24ad55 100644 --- a/share/eds/byzantine/bad_encoding_test.go +++ b/share/eds/byzantine/bad_encoding_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" core "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/test/util/malicious" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/test/util/malicious" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/share/eds/byzantine/byzantine.go b/share/eds/byzantine/byzantine.go index 030453c31a..44307138c5 100644 --- a/share/eds/byzantine/byzantine.go +++ b/share/eds/byzantine/byzantine.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/boxo/blockstore" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share/ipld" diff --git a/share/eds/byzantine/share_proof_test.go b/share/eds/byzantine/share_proof_test.go index 170ba591e2..2b5cb57bb9 100644 --- a/share/eds/byzantine/share_proof_test.go +++ b/share/eds/byzantine/share_proof_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share" diff --git a/share/eds/eds.go b/share/eds/eds.go index 079d7636b9..03753bd44c 100644 --- a/share/eds/eds.go +++ b/share/eds/eds.go @@ -11,11 +11,14 @@ import ( "github.com/ipfs/go-cid" "github.com/ipld/go-car" "github.com/ipld/go-car/util" + "github.com/tendermint/tendermint/crypto/merkle" + corebytes "github.com/tendermint/tendermint/libs/bytes" + coretypes "github.com/tendermint/tendermint/proto/tendermint/types" "github.com/tendermint/tendermint/types" - pkgproof "github.com/celestiaorg/celestia-app/pkg/proof" - "github.com/celestiaorg/celestia-app/pkg/shares" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + pkgproof "github.com/celestiaorg/celestia-app/v2/pkg/proof" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -293,5 +296,47 @@ func ProveShares(eds *rsmt2d.ExtendedDataSquare, start, end int) (*types.SharePr if err != nil { return nil, err } - return &proof, nil + coreProof := toCoreShareProof(proof) + return &coreProof, nil +} + +// toCoreShareProof utility function that converts a share proof defined in app +// to the share proof defined in node. +// This will be removed once we unify both these proofs. +// Reference issue: https://github.com/celestiaorg/celestia-app/issues/3734 +func toCoreShareProof(appShareProof pkgproof.ShareProof) types.ShareProof { + shareProofs := make([]*coretypes.NMTProof, 0) + for _, proof := range appShareProof.ShareProofs { + shareProofs = append(shareProofs, &coretypes.NMTProof{ + Start: proof.Start, + End: proof.End, + Nodes: proof.Nodes, + LeafHash: proof.LeafHash, + }) + } + + rowRoots := make([]corebytes.HexBytes, 0) + rowProofs := make([]*merkle.Proof, 0) + for index, proof := range appShareProof.RowProof.Proofs { + rowRoots = append(rowRoots, appShareProof.RowProof.RowRoots[index]) + rowProofs = append(rowProofs, &merkle.Proof{ + Total: proof.Total, + Index: proof.Index, + LeafHash: proof.LeafHash, + Aunts: proof.Aunts, + }) + } + + return types.ShareProof{ + Data: appShareProof.Data, + ShareProofs: shareProofs, + NamespaceID: appShareProof.NamespaceId, + RowProof: types.RowProof{ + RowRoots: rowRoots, + Proofs: rowProofs, + StartRow: appShareProof.RowProof.StartRow, + EndRow: appShareProof.RowProof.EndRow, + }, + NamespaceVersion: appShareProof.NamespaceVersion, + } } diff --git a/share/eds/eds_test.go b/share/eds/eds_test.go index fb615fb84f..fb1c13eaf1 100644 --- a/share/eds/eds_test.go +++ b/share/eds/eds_test.go @@ -17,11 +17,11 @@ import ( "github.com/tendermint/tendermint/libs/rand" coretypes "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/namespace" - pkgproof "github.com/celestiaorg/celestia-app/pkg/proof" - "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + pkgproof "github.com/celestiaorg/celestia-app/v2/pkg/proof" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share" @@ -330,7 +330,7 @@ func TestProveShares(t *testing.T) { ) require.NoError(t, err) require.NoError(t, proof.Validate(dataRoot.Hash())) - return proof + return toCoreShareProof(proof) }(), }, } diff --git a/share/eds/edstest/testing.go b/share/eds/edstest/testing.go index 5f6dcfa6f7..c5131f8656 100644 --- a/share/eds/edstest/testing.go +++ b/share/eds/edstest/testing.go @@ -6,17 +6,19 @@ import ( "github.com/stretchr/testify/require" coretypes "github.com/tendermint/tendermint/types" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/namespace" - "github.com/celestiaorg/celestia-app/pkg/shares" - "github.com/celestiaorg/celestia-app/pkg/square" - "github.com/celestiaorg/celestia-app/pkg/wrapper" - "github.com/celestiaorg/celestia-app/test/util/blobfactory" - "github.com/celestiaorg/celestia-app/test/util/testfactory" - "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/user" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/test/util/blobfactory" + "github.com/celestiaorg/celestia-app/v2/test/util/testfactory" + "github.com/celestiaorg/celestia-app/v2/x/blob/types" + "github.com/celestiaorg/go-square/blob" + "github.com/celestiaorg/go-square/namespace" + "github.com/celestiaorg/go-square/shares" + "github.com/celestiaorg/go-square/square" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" @@ -24,6 +26,11 @@ import ( "github.com/celestiaorg/celestia-node/share/sharetest" ) +const ( + accountName = "test-account" + testChainID = "private" +) + func RandByzantineEDS(t testing.TB, size int, options ...nmt.Option) *rsmt2d.ExtendedDataSquare { eds := RandEDS(t, size) shares := eds.Flattened() @@ -64,7 +71,7 @@ func GenerateTestBlock( blobSize, numberOfTransactions int, ) ( []*types.MsgPayForBlobs, - []*types.Blob, + []*blob.Blob, []namespace.Namespace, *rsmt2d.ExtendedDataSquare, coretypes.Txs, @@ -81,8 +88,8 @@ func GenerateTestBlock( txs = append(txs, coreTxs...) dataSquare, err := square.Construct( txs.ToSliceOfBytes(), - appconsts.LatestVersion, appconsts.SquareSizeUpperBound(appconsts.LatestVersion), + appconsts.SubtreeRootThreshold(appconsts.LatestVersion), ) require.NoError(t, err) @@ -105,15 +112,17 @@ func GenerateTestBlock( func createTestBlobTransactions( t *testing.T, numberOfTransactions, size int, -) ([]namespace.Namespace, []*types.MsgPayForBlobs, []*types.Blob, []coretypes.Tx) { - acc := "blobstream-api-tests" - kr := testfactory.GenerateKeyring(acc) - signer := types.NewKeyringSigner(kr, acc, "test") - +) ([]namespace.Namespace, []*types.MsgPayForBlobs, []*blob.Blob, []coretypes.Tx) { nss := make([]namespace.Namespace, 0) msgs := make([]*types.MsgPayForBlobs, 0) - blobs := make([]*types.Blob, 0) + blobs := make([]*blob.Blob, 0) coreTxs := make([]coretypes.Tx, 0) + config := encoding.MakeConfig(app.ModuleEncodingRegisters...) + keyring := testfactory.TestKeyring(config.Codec, accountName) + account := user.NewAccount(accountName, 0, 0) + signer, err := user.NewSigner(keyring, config.TxConfig, testChainID, appconsts.LatestVersion, account) + require.NoError(t, err) + for i := 0; i < numberOfTransactions; i++ { ns, msg, blob, coreTx := createTestBlobTransaction(t, signer, size+i*1000) nss = append(nss, ns) @@ -129,22 +138,13 @@ func createTestBlobTransactions( // PFB size. The size is in bytes. func createTestBlobTransaction( t *testing.T, - signer *types.KeyringSigner, + signer *user.Signer, size int, -) (namespace.Namespace, *types.MsgPayForBlobs, *types.Blob, coretypes.Tx) { - addr, err := signer.GetSignerInfo().GetAddress() - require.NoError(t, err) - +) (namespace.Namespace, *types.MsgPayForBlobs, *blob.Blob, coretypes.Tx) { ns := namespace.RandomBlobNamespace() - msg, blob := blobfactory.RandMsgPayForBlobsWithNamespaceAndSigner(addr.String(), ns, size) - require.NoError(t, err) - - builder := signer.NewTxBuilder() - stx, err := signer.BuildSignedTx(builder, msg) - require.NoError(t, err) - rawTx, err := encoding.MakeConfig(app.ModuleEncodingRegisters...).TxConfig.TxEncoder()(stx) - require.NoError(t, err) - cTx, err := coretypes.MarshalBlobTx(rawTx, blob) + account := signer.Account(accountName) + msg, b := blobfactory.RandMsgPayForBlobsWithNamespaceAndSigner(account.Address().String(), ns, size) + cTx, _, err := signer.CreatePayForBlobs(accountName, []*blob.Blob{b}) require.NoError(t, err) - return ns, msg, blob, cTx + return ns, msg, b, cTx } diff --git a/share/eds/retriever.go b/share/eds/retriever.go index 989da376f7..606746cbc8 100644 --- a/share/eds/retriever.go +++ b/share/eds/retriever.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/otel/codes" "go.opentelemetry.io/otel/trace" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/share/eds/retriever_no_race_test.go b/share/eds/retriever_no_race_test.go index 6b2667ee6f..73f86d555a 100644 --- a/share/eds/retriever_no_race_test.go +++ b/share/eds/retriever_no_race_test.go @@ -9,8 +9,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/share/eds/retriever_quadrant.go b/share/eds/retriever_quadrant.go index a7328f5de2..64cab6366c 100644 --- a/share/eds/retriever_quadrant.go +++ b/share/eds/retriever_quadrant.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/go-cid" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share/ipld" diff --git a/share/eds/retriever_test.go b/share/eds/retriever_test.go index 6bf6b45900..3c0763f62a 100644 --- a/share/eds/retriever_test.go +++ b/share/eds/retriever_test.go @@ -11,7 +11,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/header" diff --git a/share/eds/store_test.go b/share/eds/store_test.go index 6bc6972bb4..c5d87f7352 100644 --- a/share/eds/store_test.go +++ b/share/eds/store_test.go @@ -18,7 +18,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share" diff --git a/share/empty.go b/share/empty.go index c95ce58192..9d1a4ff561 100644 --- a/share/empty.go +++ b/share/empty.go @@ -5,9 +5,9 @@ import ( "fmt" "sync" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/shares" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/go-square/shares" "github.com/celestiaorg/rsmt2d" ) diff --git a/share/getters/getter_test.go b/share/getters/getter_test.go index b39101c510..16766299f2 100644 --- a/share/getters/getter_test.go +++ b/share/getters/getter_test.go @@ -14,8 +14,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/header" diff --git a/share/getters/testing.go b/share/getters/testing.go index fafeb0541c..665690ffe3 100644 --- a/share/getters/testing.go +++ b/share/getters/testing.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/header" diff --git a/share/ipld/add.go b/share/ipld/add.go index 4dc5f1cf47..42705557ae 100644 --- a/share/ipld/add.go +++ b/share/ipld/add.go @@ -6,7 +6,7 @@ import ( "github.com/ipfs/boxo/blockservice" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/nmt" "github.com/celestiaorg/rsmt2d" diff --git a/share/ipld/get_shares_test.go b/share/ipld/get_shares_test.go index 2f5d630473..93a697ffde 100644 --- a/share/ipld/get_shares_test.go +++ b/share/ipld/get_shares_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/wrapper" + "github.com/celestiaorg/celestia-app/v2/pkg/wrapper" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/libs/utils" diff --git a/share/ipld/nmt.go b/share/ipld/nmt.go index 6140d569df..767c1686ea 100644 --- a/share/ipld/nmt.go +++ b/share/ipld/nmt.go @@ -16,8 +16,8 @@ import ( mh "github.com/multiformats/go-multihash" mhcore "github.com/multiformats/go-multihash/core" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/nmt" "github.com/celestiaorg/celestia-node/share" diff --git a/share/ipld/nmt_test.go b/share/ipld/nmt_test.go index ecff64bf15..76d67bd2a8 100644 --- a/share/ipld/nmt_test.go +++ b/share/ipld/nmt_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/da" + "github.com/celestiaorg/celestia-app/v2/pkg/da" "github.com/celestiaorg/rsmt2d" "github.com/celestiaorg/celestia-node/share/eds/edstest" diff --git a/share/namespace.go b/share/namespace.go index df4ad74058..24188ecb9b 100644 --- a/share/namespace.go +++ b/share/namespace.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "fmt" - appns "github.com/celestiaorg/celestia-app/pkg/namespace" + appns "github.com/celestiaorg/go-square/namespace" "github.com/celestiaorg/nmt/namespace" ) diff --git a/share/namespace_test.go b/share/namespace_test.go index 9593319f00..e6007c245e 100644 --- a/share/namespace_test.go +++ b/share/namespace_test.go @@ -7,7 +7,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - appns "github.com/celestiaorg/celestia-app/pkg/namespace" + appns "github.com/celestiaorg/go-square/namespace" ) var ( diff --git a/share/share.go b/share/share.go index 298c3d46d4..6ad4bbf40f 100644 --- a/share/share.go +++ b/share/share.go @@ -7,7 +7,7 @@ import ( "fmt" "hash" - "github.com/celestiaorg/celestia-app/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" ) // DefaultRSMT2DCodec sets the default rsmt2d.Codec for shares. diff --git a/share/sharetest/testing.go b/share/sharetest/testing.go index 7805bce3fe..8d9b824b69 100644 --- a/share/sharetest/testing.go +++ b/share/sharetest/testing.go @@ -10,7 +10,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/pkg/namespace" + "github.com/celestiaorg/go-square/namespace" "github.com/celestiaorg/celestia-node/share" ) diff --git a/state/core_access.go b/state/core_access.go index 9e46bcfc08..11eb72bea5 100644 --- a/state/core_access.go +++ b/state/core_access.go @@ -23,10 +23,10 @@ import ( "google.golang.org/grpc/connectivity" "google.golang.org/grpc/credentials/insecure" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/app/encoding" - apperrors "github.com/celestiaorg/celestia-app/app/errors" - "github.com/celestiaorg/celestia-app/pkg/user" + "github.com/celestiaorg/celestia-app/v2/app" + "github.com/celestiaorg/celestia-app/v2/app/encoding" + apperrors "github.com/celestiaorg/celestia-app/v2/app/errors" + "github.com/celestiaorg/celestia-app/v2/pkg/user" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/celestia-node/header" @@ -209,7 +209,7 @@ func (ca *CoreAccessor) SubmitPayForBlob( if gas == 0 { blobSizes := make([]uint32, len(appblobs)) for i, blob := range appblobs { - blobSizes[i] = uint32(len(blob.Data)) + blobSizes[i] = uint32(len(blob.GetData())) } gas = estimateGasForBlobs(blobSizes) } @@ -235,7 +235,7 @@ func (ca *CoreAccessor) SubmitPayForBlob( var lastErr error for attempt := 0; attempt < maxRetries; attempt++ { - opts := []user.TxOption{user.SetGasLimitAndFee(gas, gasPrice)} + opts := []user.TxOption{user.SetGasLimitAndGasPrice(gas, gasPrice)} if feeGrant != nil { opts = append(opts, feeGrant) } @@ -621,7 +621,7 @@ func (ca *CoreAccessor) submitMsg( gasPrice = ca.minGasPrice } - txConfig = append(txConfig, user.SetGasLimitAndFee(gas, gasPrice)) + txConfig = append(txConfig, user.SetGasLimitAndGasPrice(gas, gasPrice)) if cfg.FeeGranterAddress() != "" { granter, err := parseAccAddressFromString(cfg.FeeGranterAddress()) diff --git a/state/core_access_test.go b/state/core_access_test.go index ce8f77b9e9..e8120adc39 100644 --- a/state/core_access_test.go +++ b/state/core_access_test.go @@ -13,10 +13,12 @@ import ( sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/pkg/appconsts" - "github.com/celestiaorg/celestia-app/test/util/testnode" - apptypes "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/app" + appconsts "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + genesis "github.com/celestiaorg/celestia-app/v2/test/util/genesis" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" + apptypes "github.com/celestiaorg/celestia-app/v2/x/blob/types" + squareblob "github.com/celestiaorg/go-square/blob" "github.com/celestiaorg/celestia-node/share" ) @@ -36,29 +38,25 @@ func TestSubmitPayForBlob(t *testing.T) { blobbyTheBlob, err := apptypes.NewBlob(ns.ToAppNamespace(), []byte("data"), 0) require.NoError(t, err) - minGas, err := ca.queryMinimumGasPrice(ctx) - require.NoError(t, err) - require.Equal(t, appconsts.DefaultMinGasPrice, minGas) - testcases := []struct { name string - blobs []*apptypes.Blob + blobs []*squareblob.Blob gasPrice float64 gasLim uint64 expErr error }{ { name: "empty blobs", - blobs: []*apptypes.Blob{}, + blobs: []*squareblob.Blob{}, gasPrice: DefaultGasPrice, gasLim: 0, expErr: errors.New("state: no blobs provided"), }, { name: "good blob with user provided gas and fees", - blobs: []*apptypes.Blob{blobbyTheBlob}, + blobs: []*squareblob.Blob{blobbyTheBlob}, gasPrice: 0.005, - gasLim: apptypes.DefaultEstimateGas([]uint32{uint32(len(blobbyTheBlob.Data))}), + gasLim: apptypes.DefaultEstimateGas([]uint32{uint32(len(blobbyTheBlob.GetData()))}), expErr: nil, }, // TODO: add more test cases. The problem right now is that the celestia-app doesn't @@ -213,19 +211,56 @@ func extractPort(addr string) string { } func buildAccessor(t *testing.T) (*CoreAccessor, []string) { + chainID := "private" + t.Helper() - accounts := []string{"jimmy", "carl", "sheen", "cindy"} + accounts := []genesis.KeyringAccount{ + { + Name: "jimmy", + InitialTokens: 100_000_000, + }, + { + Name: "carl", + InitialTokens: 100_000_000, + }, + { + Name: "sheen", + InitialTokens: 100_000_000, + }, + { + Name: "cindy", + InitialTokens: 100_000_000, + }, + } tmCfg := testnode.DefaultTendermintConfig() tmCfg.Consensus.TimeoutCommit = time.Millisecond * 1 appConf := testnode.DefaultAppConfig() appConf.API.Enable = true - appConf.MinGasPrices = fmt.Sprintf("0.002%s", app.BondDenom) - config := testnode.DefaultConfig().WithTendermintConfig(tmCfg).WithAppConfig(appConf).WithAccounts(accounts) + appCreator := testnode.CustomAppCreator(fmt.Sprintf("0.002%s", app.BondDenom)) + + g := genesis.NewDefaultGenesis(). + WithChainID(chainID). + WithValidators(genesis.NewDefaultValidator(testnode.DefaultValidatorAccountName)). + WithConsensusParams(testnode.DefaultConsensusParams()).WithKeyringAccounts(accounts...) + + config := testnode.DefaultConfig(). + WithChainID(chainID). + WithTendermintConfig(tmCfg). + WithAppConfig(appConf). + WithGenesis(g). + WithAppCreator(appCreator) // needed until https://github.com/celestiaorg/celestia-app/pull/3680 merges cctx, _, grpcAddr := testnode.NewNetwork(t, config) - ca, err := NewCoreAccessor(cctx.Keyring, accounts[0], nil, "127.0.0.1", extractPort(grpcAddr)) + ca, err := NewCoreAccessor(cctx.Keyring, accounts[0].Name, nil, "127.0.0.1", extractPort(grpcAddr)) require.NoError(t, err) - return ca, accounts + return ca, getNames(accounts) +} + +func getNames(accounts []genesis.KeyringAccount) (names []string) { + for _, account := range accounts { + names = append(names, account.Name) + } + return names } diff --git a/state/integration_test.go b/state/integration_test.go index 8025d7b2f2..54c76fbcd3 100644 --- a/state/integration_test.go +++ b/state/integration_test.go @@ -16,9 +16,9 @@ import ( rpcclient "github.com/tendermint/tendermint/rpc/client" "google.golang.org/grpc" - "github.com/celestiaorg/celestia-app/app" - "github.com/celestiaorg/celestia-app/test/util/testfactory" - "github.com/celestiaorg/celestia-app/test/util/testnode" + "github.com/celestiaorg/celestia-app/v2/pkg/appconsts" + "github.com/celestiaorg/celestia-app/v2/test/util/genesis" + "github.com/celestiaorg/celestia-app/v2/test/util/testnode" libhead "github.com/celestiaorg/go-header" "github.com/celestiaorg/celestia-node/core" @@ -33,7 +33,7 @@ type IntegrationTestSuite struct { suite.Suite cleanups []func() error - accounts []string + accounts []genesis.Account cctx testnode.Context accessor *CoreAccessor @@ -47,9 +47,12 @@ func (s *IntegrationTestSuite) SetupSuite() { cfg := core.DefaultTestConfig() s.cctx = core.StartTestNodeWithConfig(s.T(), cfg) - s.accounts = cfg.Accounts + s.accounts = cfg.Genesis.Accounts() - accessor, err := NewCoreAccessor(s.cctx.Keyring, s.accounts[0], localHeader{s.cctx.Client}, "", "") + s.Require().Greater(len(s.accounts), 0) + accountName := s.accounts[0].Name + + accessor, err := NewCoreAccessor(s.cctx.Keyring, accountName, localHeader{s.cctx.Client}, "", "") require.NoError(s.T(), err) setClients(accessor, s.cctx.GRPCClient) s.accessor = accessor @@ -78,16 +81,6 @@ func (s *IntegrationTestSuite) TearDownSuite() { } } -func (s *IntegrationTestSuite) getAddress(acc string) sdk.Address { - rec, err := s.cctx.Keyring.Key(acc) - require.NoError(s.T(), err) - - addr, err := rec.GetAddress() - require.NoError(s.T(), err) - - return addr -} - type localHeader struct { client rpcclient.Client } @@ -108,11 +101,16 @@ func (l localHeader) Head( func (s *IntegrationTestSuite) TestGetBalance() { require := s.Require() - expectedBal := sdk.NewCoin(app.BondDenom, sdk.NewInt(int64(99999999999999999))) - for _, acc := range s.accounts { - bal, err := s.accessor.BalanceForAddress(context.Background(), Address{s.getAddress(acc)}) + + for _, account := range s.accounts { + hexAddress := account.PubKey.Address().String() + sdkAddress, err := sdk.AccAddressFromHexUnsafe(hexAddress) + require.NoError(err) + + bal, err := s.accessor.BalanceForAddress(context.Background(), Address{sdkAddress}) require.NoError(err) - require.Equal(&expectedBal, bal) + require.Equal(bal.Denom, appconsts.BondDenom) + require.True(bal.Amount.GT(sdk.NewInt(1))) // verify that each account has some balance } } @@ -121,14 +119,16 @@ func (s *IntegrationTestSuite) TestGetBalance() { func (s *IntegrationTestSuite) TestGenerateJSONBlock() { t := s.T() t.Skip("skipping testdata generation test") - resp, err := s.cctx.FillBlock(4, s.accounts, flags.BroadcastSync) + s.Require().Greater(len(s.accounts), 0) + accountName := s.accounts[0].Name + resp, err := s.cctx.FillBlock(4, accountName, flags.BroadcastSync) require := s.Require() require.NoError(err) require.Equal(abci.CodeTypeOK, resp.Code) require.NoError(s.cctx.WaitForNextBlock()) // download the block that the tx was in - res, err := testfactory.QueryWithoutProof(s.cctx.Context, resp.TxHash) + res, err := testnode.QueryWithoutProof(s.cctx.Context, resp.TxHash) require.NoError(err) block, err := s.cctx.Client.Block(s.cctx.GoContext(), &res.Height) diff --git a/state/state.go b/state/state.go index e5ed1c557a..5f09bcc19b 100644 --- a/state/state.go +++ b/state/state.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" coretypes "github.com/tendermint/tendermint/types" - apptypes "github.com/celestiaorg/celestia-app/x/blob/types" + squareblob "github.com/celestiaorg/go-square/blob" ) // Balance is an alias to the Coin type from Cosmos-SDK. @@ -26,8 +26,8 @@ type Address struct { sdk.Address } -// Blob is an alias of Blob from celestia-app. -type Blob = apptypes.Blob +// Blob is an alias of Blob from go-square. +type Blob = squareblob.Blob // ValAddress is an alias to the ValAddress type from Cosmos-SDK. type ValAddress = sdk.ValAddress diff --git a/state/tx_config.go b/state/tx_config.go index 84c42d2c02..0c0ea5e372 100644 --- a/state/tx_config.go +++ b/state/tx_config.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" sdktypes "github.com/cosmos/cosmos-sdk/types" - "github.com/celestiaorg/celestia-app/pkg/user" - apptypes "github.com/celestiaorg/celestia-app/x/blob/types" + "github.com/celestiaorg/celestia-app/v2/pkg/user" + apptypes "github.com/celestiaorg/celestia-app/v2/x/blob/types" ) const (