Skip to content

Commit

Permalink
remove go-da dep
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Jan 23, 2025
1 parent 254ce7d commit 9863444
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
11 changes: 5 additions & 6 deletions da/celestia/celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
"github.com/celestiaorg/nmt"
"github.com/dymensionxyz/gerr-cosmos/gerrc"
"github.com/gogo/protobuf/proto"
goDA "github.com/rollkit/go-da"

"github.com/dymensionxyz/dymint/da/celestia/client"
daclient "github.com/dymensionxyz/dymint/da/celestia/client"
Expand Down Expand Up @@ -321,14 +320,14 @@ func (c *DataAvailabilityLayerClient) submit(data []byte) (*da.DASubmitMetaData,
}, nil
}

func makeID(height uint64, commitment da.Commitment) goDA.ID {
func makeID(height uint64, commitment da.Commitment) daclient.ID {
id := make([]byte, heightLen+len(commitment))
binary.LittleEndian.PutUint64(id, height)
copy(id[heightLen:], commitment)
return id
}

func splitID(id goDA.ID) (uint64, da.Commitment) {
func splitID(id daclient.ID) (uint64, da.Commitment) {
if len(id) <= heightLen {
return 0, nil
}
Expand Down Expand Up @@ -379,7 +378,7 @@ func (c *DataAvailabilityLayerClient) retrieveBatches(daMetaData *da.DASubmitMet
var batches []*types.Batch

id := makeID(daMetaData.Height, daMetaData.Commitment)
blob, err := c.client.Get(ctx, []goDA.ID{id}, c.config.NamespaceID.Bytes())
blob, err := c.client.Get(ctx, []daclient.ID{id}, c.config.NamespaceID.Bytes())
if err != nil {
return da.ResultRetrieveBatch{
BaseResult: da.BaseResult{
Expand Down Expand Up @@ -449,7 +448,7 @@ func (c *DataAvailabilityLayerClient) getDAAvailabilityMetaData(daMetaData *da.D
ctx, cancel := context.WithTimeout(c.ctx, c.config.Timeout)
defer cancel()

ids := []goDA.ID{makeID(daMetaData.Height, daMetaData.Commitment)}
ids := []daclient.ID{makeID(daMetaData.Height, daMetaData.Commitment)}
daProofs, err := c.client.GetProofs(ctx, ids, c.config.NamespaceID.Bytes())
if err != nil || daProofs[0] == nil {
// TODO (srene): Not getting proof means there is no existing data for the namespace and commitment (the commitment is not valid).
Expand Down Expand Up @@ -508,7 +507,7 @@ func (c *DataAvailabilityLayerClient) validateInclusion(daMetaData *da.DACheckMe
ctx, cancel := context.WithTimeout(c.ctx, c.config.Timeout)
defer cancel()

ids := []goDA.ID{makeID(daMetaData.Height, daMetaData.Commitment)}
ids := []daclient.ID{makeID(daMetaData.Height, daMetaData.Commitment)}
included, err := c.client.Validate(ctx, ids, daMetaData.Proofs, c.config.NamespaceID.Bytes())
if err != nil {
return err
Expand Down
4 changes: 2 additions & 2 deletions da/da.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import (

"cosmossdk.io/math"
"github.com/cometbft/cometbft/crypto/merkle"
"github.com/rollkit/go-da"
"github.com/tendermint/tendermint/libs/pubsub"

daclient "github.com/dymensionxyz/dymint/da/celestia/client"
"github.com/dymensionxyz/dymint/store"
"github.com/dymensionxyz/dymint/types"
)
Expand Down Expand Up @@ -176,7 +176,7 @@ type DACheckMetaData struct {
// Number of shares of each blob
Length int
// Proofs necessary to validate blob inclusion in the specific height
Proofs []da.Proof
Proofs []daclient.Proof
// NMT roots for each NMT Proof
NMTRoots []byte
// Proofs necessary to validate blob inclusion in the specific height
Expand Down
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
github.com/libp2p/go-libp2p-routing-helpers v0.7.3
github.com/multiformats/go-multiaddr v0.12.2
github.com/prometheus/client_golang v1.18.0
github.com/rollkit/go-da v0.9.0
github.com/rs/cors v1.9.0
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.15.0
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1231,8 +1231,6 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rollkit/go-da v0.9.0 h1:ECpS7RSLE84w61Y5a93RfaZrAZKeiyfjVwGxzjsW2cU=
github.com/rollkit/go-da v0.9.0/go.mod h1:LQImomegjZ/dEQLKDJA7RdUnOLINSZJwI7q1CvFPWJw=
github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU=
github.com/rs/cors v1.9.0 h1:l9HGsTsHJcvW14Nk7J9KFz8bzeAWXn3CG6bgt7LsrAE=
github.com/rs/cors v1.9.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU=
Expand Down

0 comments on commit 9863444

Please sign in to comment.