@@ -40,9 +40,8 @@ type API struct {
4040
4141// Get returns Blob for each given ID, or an error.
4242func (api * API ) Get (ctx context.Context , ids []da.ID , ns []byte ) ([]da.Blob , error ) {
43- preparedNs := da .PrepareNamespace (ns )
44- api .Logger .Debug ().Str ("method" , "Get" ).Int ("num_ids" , len (ids )).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
45- res , err := api .Internal .Get (ctx , ids , preparedNs )
43+ api .Logger .Debug ().Str ("method" , "Get" ).Int ("num_ids" , len (ids )).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
44+ res , err := api .Internal .Get (ctx , ids , ns )
4645 if err != nil {
4746 if strings .Contains (err .Error (), context .Canceled .Error ()) {
4847 api .Logger .Debug ().Str ("method" , "Get" ).Msg ("RPC call canceled due to context cancellation" )
@@ -58,9 +57,8 @@ func (api *API) Get(ctx context.Context, ids []da.ID, ns []byte) ([]da.Blob, err
5857
5958// GetIDs returns IDs of all Blobs located in DA at given height.
6059func (api * API ) GetIDs (ctx context.Context , height uint64 , ns []byte ) (* da.GetIDsResult , error ) {
61- preparedNs := da .PrepareNamespace (ns )
62- api .Logger .Debug ().Str ("method" , "GetIDs" ).Uint64 ("height" , height ).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
63- res , err := api .Internal .GetIDs (ctx , height , preparedNs )
60+ api .Logger .Debug ().Str ("method" , "GetIDs" ).Uint64 ("height" , height ).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
61+ res , err := api .Internal .GetIDs (ctx , height , ns )
6462 if err != nil {
6563 // Using strings.contains since JSON RPC serialization doesn't preserve error wrapping
6664 // Check if the error is specifically BlobNotFound, otherwise log and return
@@ -92,9 +90,8 @@ func (api *API) GetIDs(ctx context.Context, height uint64, ns []byte) (*da.GetID
9290
9391// GetProofs returns inclusion Proofs for Blobs specified by their IDs.
9492func (api * API ) GetProofs (ctx context.Context , ids []da.ID , ns []byte ) ([]da.Proof , error ) {
95- preparedNs := da .PrepareNamespace (ns )
96- api .Logger .Debug ().Str ("method" , "GetProofs" ).Int ("num_ids" , len (ids )).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
97- res , err := api .Internal .GetProofs (ctx , ids , preparedNs )
93+ api .Logger .Debug ().Str ("method" , "GetProofs" ).Int ("num_ids" , len (ids )).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
94+ res , err := api .Internal .GetProofs (ctx , ids , ns )
9895 if err != nil {
9996 api .Logger .Error ().Err (err ).Str ("method" , "GetProofs" ).Msg ("RPC call failed" )
10097 } else {
@@ -105,9 +102,8 @@ func (api *API) GetProofs(ctx context.Context, ids []da.ID, ns []byte) ([]da.Pro
105102
106103// Commit creates a Commitment for each given Blob.
107104func (api * API ) Commit (ctx context.Context , blobs []da.Blob , ns []byte ) ([]da.Commitment , error ) {
108- preparedNs := da .PrepareNamespace (ns )
109- api .Logger .Debug ().Str ("method" , "Commit" ).Int ("num_blobs" , len (blobs )).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
110- res , err := api .Internal .Commit (ctx , blobs , preparedNs )
105+ api .Logger .Debug ().Str ("method" , "Commit" ).Int ("num_blobs" , len (blobs )).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
106+ res , err := api .Internal .Commit (ctx , blobs , ns )
111107 if err != nil {
112108 api .Logger .Error ().Err (err ).Str ("method" , "Commit" ).Msg ("RPC call failed" )
113109 } else {
@@ -118,9 +114,8 @@ func (api *API) Commit(ctx context.Context, blobs []da.Blob, ns []byte) ([]da.Co
118114
119115// Validate validates Commitments against the corresponding Proofs. This should be possible without retrieving the Blobs.
120116func (api * API ) Validate (ctx context.Context , ids []da.ID , proofs []da.Proof , ns []byte ) ([]bool , error ) {
121- preparedNs := da .PrepareNamespace (ns )
122- api .Logger .Debug ().Str ("method" , "Validate" ).Int ("num_ids" , len (ids )).Int ("num_proofs" , len (proofs )).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
123- res , err := api .Internal .Validate (ctx , ids , proofs , preparedNs )
117+ api .Logger .Debug ().Str ("method" , "Validate" ).Int ("num_ids" , len (ids )).Int ("num_proofs" , len (proofs )).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
118+ res , err := api .Internal .Validate (ctx , ids , proofs , ns )
124119 if err != nil {
125120 api .Logger .Error ().Err (err ).Str ("method" , "Validate" ).Msg ("RPC call failed" )
126121 } else {
@@ -131,15 +126,14 @@ func (api *API) Validate(ctx context.Context, ids []da.ID, proofs []da.Proof, ns
131126
132127// Submit submits the Blobs to Data Availability layer.
133128func (api * API ) Submit (ctx context.Context , blobs []da.Blob , gasPrice float64 , ns []byte ) ([]da.ID , error ) {
134- preparedNs := da .PrepareNamespace (ns )
135- api .Logger .Debug ().Str ("method" , "Submit" ).Int ("num_blobs" , len (blobs )).Float64 ("gas_price" , gasPrice ).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
136- res , err := api .Internal .Submit (ctx , blobs , gasPrice , preparedNs )
129+ api .Logger .Debug ().Str ("method" , "Submit" ).Int ("num_blobs" , len (blobs )).Float64 ("gas_price" , gasPrice ).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
130+ res , err := api .Internal .Submit (ctx , blobs , gasPrice , ns )
137131 if err != nil {
138132 if strings .Contains (err .Error (), context .Canceled .Error ()) {
139133 api .Logger .Debug ().Str ("method" , "Submit" ).Msg ("RPC call canceled due to context cancellation" )
140134 return res , context .Canceled
141135 }
142- api .Logger .Error ().Err (err ).Str ("method" , "Submit" ).Bytes ("namespace" , preparedNs ).Msg ("RPC call failed" )
136+ api .Logger .Error ().Err (err ).Str ("method" , "Submit" ).Bytes ("namespace" , ns ).Msg ("RPC call failed" )
143137 } else {
144138 api .Logger .Debug ().Str ("method" , "Submit" ).Int ("num_ids_returned" , len (res )).Msg ("RPC call successful" )
145139 }
@@ -172,9 +166,8 @@ func (api *API) SubmitWithOptions(ctx context.Context, inputBlobs []da.Blob, gas
172166 return nil , da .ErrBlobSizeOverLimit
173167 }
174168
175- preparedNs := da .PrepareNamespace (ns )
176- api .Logger .Debug ().Str ("method" , "SubmitWithOptions" ).Int ("num_blobs" , len (inputBlobs )).Uint64 ("total_size" , totalSize ).Float64 ("gas_price" , gasPrice ).Str ("namespace" , hex .EncodeToString (preparedNs )).Msg ("Making RPC call" )
177- res , err := api .Internal .SubmitWithOptions (ctx , inputBlobs , gasPrice , preparedNs , options )
169+ api .Logger .Debug ().Str ("method" , "SubmitWithOptions" ).Int ("num_blobs" , len (inputBlobs )).Uint64 ("total_size" , totalSize ).Float64 ("gas_price" , gasPrice ).Str ("namespace" , hex .EncodeToString (ns )).Msg ("Making RPC call" )
170+ res , err := api .Internal .SubmitWithOptions (ctx , inputBlobs , gasPrice , ns , options )
178171 if err != nil {
179172 if strings .Contains (err .Error (), context .Canceled .Error ()) {
180173 api .Logger .Debug ().Str ("method" , "SubmitWithOptions" ).Msg ("RPC call canceled due to context cancellation" )
0 commit comments