Skip to content

Commit ccf7be5

Browse files
committed
apply suggestions left by @Wondertan
1 parent ffb185b commit ccf7be5

File tree

14 files changed

+210
-272
lines changed

14 files changed

+210
-272
lines changed

api/docgen/examples.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"golang.org/x/text/cases"
2323
"golang.org/x/text/language"
2424

25+
appfibre "github.com/celestiaorg/celestia-app/v8/fibre"
2526
"github.com/celestiaorg/go-fraud"
2627
libhead "github.com/celestiaorg/go-header"
2728
libshare "github.com/celestiaorg/go-square/v4/share"
@@ -193,7 +194,7 @@ func init() {
193194
add(bytes.HexBytes(hash))
194195

195196
// Fibre types
196-
fibreCommitment := fibre.Commitment{}
197+
fibreCommitment := appfibre.Commitment{}
197198
copy(fibreCommitment[:], commitment)
198199
add(fibreCommitment)
199200

fibre/account.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func (a *AccountClient) QueryEscrowAccount(ctx context.Context, signer string) (
9191
}
9292

9393
if resp == nil {
94-
return nil, fmt.Errorf("querying escrow account %w", err)
94+
return nil, fmt.Errorf("querying escrow account: %w", err)
9595
}
9696
if !resp.Found {
9797
return nil, fmt.Errorf("escrow account not found for signer:%s", signer)

fibre/fibre.go

Lines changed: 0 additions & 45 deletions
This file was deleted.

fibre/metrics.go

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ const (
2424
type blobMetrics struct {
2525
uploadDuration metric.Float64Histogram
2626
submitDuration metric.Float64Histogram
27-
getDuration metric.Float64Histogram
2827
}
2928

3029
func (s *Service) WithMetrics() error {
@@ -54,19 +53,9 @@ func (s *Service) withBlobMetrics() error {
5453
return err
5554
}
5655

57-
getDuration, err := meter.Float64Histogram(
58-
"fibre_get_duration_seconds",
59-
metric.WithDescription("Duration of fibre blob retrieval operations"),
60-
metric.WithUnit("s"),
61-
)
62-
if err != nil {
63-
return err
64-
}
65-
6656
s.metrics = &blobMetrics{
6757
uploadDuration: uploadDuration,
6858
submitDuration: submitDuration,
69-
getDuration: getDuration,
7059
}
7160
return nil
7261
}
@@ -85,13 +74,6 @@ func (m *blobMetrics) observeSubmit(ctx context.Context, dur time.Duration, blob
8574
m.submitDuration.Record(ctx, dur.Seconds(), blobAttrs(blobSize, err))
8675
}
8776

88-
func (m *blobMetrics) observeGet(ctx context.Context, dur time.Duration, err error) {
89-
if m == nil {
90-
return
91-
}
92-
m.getDuration.Record(ctx, dur.Seconds(), errorAttrs(err))
93-
}
94-
9577
func blobAttrs(blobSize int, err error) metric.MeasurementOption {
9678
attrs := []attribute.KeyValue{
9779
attribute.Int("blob_size", blobSize),

fibre/service.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ func (s *Service) Upload(
109109
ctx context.Context,
110110
ns libshare.Namespace,
111111
data []byte,
112+
_ *txclient.TxConfig,
112113
) (_ *appfibre.SignedPaymentPromise, err error) {
113114
start := time.Now()
114115
defer func() {
@@ -126,15 +127,11 @@ func (s *Service) Upload(
126127
log.Errorw("uploading blob", "err", err, "namespace", ns.ID())
127128
return nil, err
128129
}
130+
// TODO: add async fibre submit
129131
return promise, nil
130132
}
131133

132-
func (s *Service) Get(ctx context.Context, ns libshare.Namespace, commitment []byte) (_ *appfibre.Blob, err error) {
133-
start := time.Now()
134-
defer func() {
135-
s.metrics.observeGet(ctx, time.Since(start), err)
136-
}()
137-
134+
func (s *Service) Get(ctx context.Context, ns libshare.Namespace, commitment []byte) (*appfibre.Blob, error) {
138135
log.Debugw("getting blob", "namespace", ns.ID(), "commitment", hex.EncodeToString(commitment))
139136
if len(commitment) != appfibre.CommitmentSize {
140137
return nil, fmt.Errorf("commitment size does not match. want:%d got:%d", appfibre.CommitmentSize, len(commitment))

go.mod

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/BurntSushi/toml v1.6.0
1111
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
1212
github.com/benbjohnson/clock v1.3.5
13-
github.com/celestiaorg/celestia-app/v8 v8.0.0-20260319203113-2ec59a0a61e4
13+
github.com/celestiaorg/celestia-app/v8 v8.0.0-20260408095837-ab08b6d5e54e
1414
github.com/celestiaorg/go-fraud v0.2.3
1515
github.com/celestiaorg/go-header v0.8.5
1616
github.com/celestiaorg/go-libp2p-messenger v0.2.2
@@ -29,7 +29,7 @@ require (
2929
github.com/gogo/protobuf v1.3.3
3030
github.com/golang/mock v1.6.0
3131
github.com/grafana/otel-profiling-go v0.5.1
32-
github.com/grafana/pyroscope-go v1.2.7
32+
github.com/grafana/pyroscope-go v1.2.8
3333
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
3434
github.com/hashicorp/golang-lru/v2 v2.0.7
3535
github.com/imdario/mergo v0.3.16
@@ -78,7 +78,7 @@ require (
7878
golang.org/x/crypto v0.49.0
7979
golang.org/x/sync v0.20.0
8080
golang.org/x/text v0.35.0
81-
google.golang.org/grpc v1.79.3
81+
google.golang.org/grpc v1.80.0
8282
google.golang.org/protobuf v1.36.11
8383
)
8484

@@ -108,7 +108,7 @@ require (
108108
github.com/99designs/keyring v1.2.2 // indirect
109109
github.com/DataDog/datadog-go v4.8.3+incompatible // indirect
110110
github.com/DataDog/zstd v1.5.7 // indirect
111-
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
111+
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.31.0 // indirect
112112
github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 // indirect
113113
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.53.0 // indirect
114114
github.com/Jorropo/jsync v1.0.1 // indirect
@@ -117,24 +117,24 @@ require (
117117
github.com/RaduBerinde/axisds v0.1.0 // indirect
118118
github.com/RaduBerinde/btreemap v0.0.0-20250419174037-3d62b7205d54 // indirect
119119
github.com/aws/aws-sdk-go v1.55.5 // indirect
120-
github.com/aws/aws-sdk-go-v2 v1.41.4 // indirect
120+
github.com/aws/aws-sdk-go-v2 v1.41.5 // indirect
121121
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.8 // indirect
122-
github.com/aws/aws-sdk-go-v2/config v1.32.12 // indirect
123-
github.com/aws/aws-sdk-go-v2/credentials v1.19.12 // indirect
124-
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.20 // indirect
125-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.20 // indirect
126-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.20 // indirect
122+
github.com/aws/aws-sdk-go-v2/config v1.32.14 // indirect
123+
github.com/aws/aws-sdk-go-v2/credentials v1.19.14 // indirect
124+
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.21 // indirect
125+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.21 // indirect
126+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect
127127
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.6 // indirect
128128
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.21 // indirect
129129
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.7 // indirect
130130
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.12 // indirect
131-
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.20 // indirect
131+
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.21 // indirect
132132
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.20 // indirect
133133
github.com/aws/aws-sdk-go-v2/service/s3 v1.97.1 // indirect
134-
github.com/aws/aws-sdk-go-v2/service/signin v1.0.8 // indirect
135-
github.com/aws/aws-sdk-go-v2/service/sso v1.30.13 // indirect
136-
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.17 // indirect
137-
github.com/aws/aws-sdk-go-v2/service/sts v1.41.9 // indirect
134+
github.com/aws/aws-sdk-go-v2/service/signin v1.0.9 // indirect
135+
github.com/aws/aws-sdk-go-v2/service/sso v1.30.15 // indirect
136+
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.19 // indirect
137+
github.com/aws/aws-sdk-go-v2/service/sts v1.41.10 // indirect
138138
github.com/aws/smithy-go v1.24.2 // indirect
139139
github.com/bcp-innovations/hyperlane-cosmos v1.1.0 // indirect
140140
github.com/beorn7/perks v1.0.1 // indirect
@@ -225,7 +225,7 @@ require (
225225
github.com/google/s2a-go v0.1.9 // indirect
226226
github.com/google/uuid v1.6.0 // indirect
227227
github.com/googleapis/enterprise-certificate-proxy v0.3.14 // indirect
228-
github.com/googleapis/gax-go/v2 v2.17.0 // indirect
228+
github.com/googleapis/gax-go/v2 v2.20.0 // indirect
229229
github.com/gorilla/handlers v1.5.2 // indirect
230230
github.com/gorilla/mux v1.8.1 // indirect
231231
github.com/gorilla/websocket v1.5.3 // indirect
@@ -270,7 +270,7 @@ require (
270270
github.com/koron/go-ssdp v0.0.6 // indirect
271271
github.com/kr/pretty v0.3.1 // indirect
272272
github.com/kr/text v0.2.0 // indirect
273-
github.com/lib/pq v1.11.2 // indirect
273+
github.com/lib/pq v1.12.0 // indirect
274274
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
275275
github.com/libp2p/go-cidranger v1.1.0 // indirect
276276
github.com/libp2p/go-flow-metrics v0.3.0 // indirect
@@ -289,7 +289,7 @@ require (
289289
github.com/mattn/go-isatty v0.0.20 // indirect
290290
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
291291
github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc // indirect
292-
github.com/minio/highwayhash v1.0.3 // indirect
292+
github.com/minio/highwayhash v1.0.4 // indirect
293293
github.com/minio/minlz v1.0.1-0.20250507153514-87eb42fe8882 // indirect
294294
github.com/minio/sha256-simd v1.0.1 // indirect
295295
github.com/mr-tron/base58 v1.2.0 // indirect
@@ -305,7 +305,7 @@ require (
305305
github.com/oklog/run v1.1.0 // indirect
306306
github.com/onsi/gomega v1.36.3 // indirect
307307
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
308-
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
308+
github.com/pelletier/go-toml/v2 v2.3.0 // indirect
309309
github.com/petermattis/goid v0.0.0-20250813065127-a731cc31b4fe // indirect
310310
github.com/pion/datachannel v1.5.10 // indirect
311311
github.com/pion/dtls/v3 v3.1.2 // indirect
@@ -337,9 +337,9 @@ require (
337337
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
338338
github.com/rogpeppe/go-internal v1.14.1 // indirect
339339
github.com/ronanh/intcomp v1.1.1 // indirect
340-
github.com/rs/zerolog v1.34.0 // indirect
340+
github.com/rs/zerolog v1.35.0 // indirect
341341
github.com/sagikazarmark/locafero v0.11.0 // indirect
342-
github.com/sasha-s/go-deadlock v0.3.7 // indirect
342+
github.com/sasha-s/go-deadlock v0.3.9 // indirect
343343
github.com/sourcegraph/conc v0.3.1-0.20240121214520-5f936abd7ae8 // indirect
344344
github.com/spaolacci/murmur3 v1.1.0 // indirect
345345
github.com/spf13/afero v1.15.0 // indirect
@@ -379,10 +379,10 @@ require (
379379
golang.org/x/tools v0.43.0 // indirect
380380
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
381381
gonum.org/v1/gonum v0.17.0 // indirect
382-
google.golang.org/api v0.271.0 // indirect
383-
google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 // indirect
384-
google.golang.org/genproto/googleapis/api v0.0.0-20260226221140-a57be14db171 // indirect
385-
google.golang.org/genproto/googleapis/rpc v0.0.0-20260226221140-a57be14db171 // indirect
382+
google.golang.org/api v0.274.0 // indirect
383+
google.golang.org/genproto v0.0.0-20260319201613-d00831a3d3e7 // indirect
384+
google.golang.org/genproto/googleapis/api v0.0.0-20260401001100-f93e5f3e9f0f // indirect
385+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260319201613-d00831a3d3e7 // indirect
386386
gopkg.in/yaml.v2 v2.4.0 // indirect
387387
gopkg.in/yaml.v3 v3.0.1 // indirect
388388
gotest.tools/v3 v3.5.2 // indirect
@@ -396,7 +396,7 @@ replace (
396396
cosmossdk.io/api => github.com/celestiaorg/cosmos-sdk/api v0.7.6
397397
cosmossdk.io/log => github.com/celestiaorg/cosmos-sdk/log v1.1.1-0.20251116153902-f48fea92e627
398398
cosmossdk.io/x/upgrade => github.com/celestiaorg/cosmos-sdk/x/upgrade v0.2.0
399-
github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.40.0
399+
github.com/cometbft/cometbft => github.com/celestiaorg/celestia-core v0.40.1
400400
github.com/cosmos/cosmos-sdk => github.com/celestiaorg/cosmos-sdk v0.52.3
401401
github.com/cosmos/ibc-go/v8 => github.com/celestiaorg/ibc-go/v8 v8.7.2
402402
github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1

0 commit comments

Comments
 (0)