Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ vendor
coverage.txt
go.work
go.work.sum
.gocache/
72 changes: 36 additions & 36 deletions docs/adr/adr-009-public-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ GetByHeight(ctx context.Context, height uint64) (*header.ExtendedHeader, error)
// by the node's header store or until context deadline is exceeded.
WaitForHeight(ctx context.Context, height uint64) (*header.ExtendedHeader, error)
// GetRangeByHeight returns the given range (from:to) of ExtendedHeaders
// from the node's header store and verifies that the returned headers are
// from the node's header store and verifies that the returned headers are
// adjacent to each other.
GetRangeByHeight(ctx context.Context, from, to uint64) ([]*ExtendedHeader, error)
// Subscribe creates long-living Subscription for newly validated
// Subscribe creates long-living Subscription for newly validated
// ExtendedHeaders. Multiple Subscriptions can be created.
Subscribe(context.Context) (<-chan *header.ExtendedHeader, error)
// SyncState returns the current state of the header Syncer.
// SyncState returns the current state of the header Syncer.
SyncState(context.Context) (sync.State, error)
// SyncWait blocks until the header Syncer is synced to network head.
// SyncWait blocks until the header Syncer is synced to network head.
SyncWait(ctx context.Context) error
// NetworkHead provides the Syncer's view of the current network head.
NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
Expand All @@ -130,11 +130,11 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
// Shares are returned in a row-by-row order if the namespace spans multiple rows.
GetSharesByNamespace(
ctx context.Context,
root *Root,
nID namespace.ID,
root *Root,
nID namespace.ID,
) (share.NamespacedShares, error)
// SharesAvailable subjectively validates if Shares committed to the given data
// Root are available on the network.
// Root are available on the network.
SharesAvailable(ctx context.Context, root *Root) error
// ProbabilityOfAvailability calculates the probability of the data square
// being available based on the number of samples collected.
Expand All @@ -153,17 +153,17 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
// PeerInfo returns a small slice of information Peerstore has on the
// given peer.
PeerInfo(context.Context, peer.ID) (peer.AddrInfo, error)

// Connect ensures there is a connection between this host and the peer with
// given peer.
Connect(ctx context.Context, pi peer.AddrInfo) error
// ClosePeer closes the connection to a given peer.
// ClosePeer closes the connection to a given peer.
ClosePeer(ctx context.Context, id peer.ID) error
// Connectedness returns a state signaling connection capabilities.
Connectedness(ctx context.Context, id peer.ID) network.Connectedness
// NATStatus returns the current NAT status.
NATStatus(context.Context) network.Reachability

// BlockPeer adds a peer to the set of blocked peers.
BlockPeer(ctx context.Context, p peer.ID) error
// UnblockPeer removes a peer from the set of blocked peers.
Expand All @@ -182,22 +182,22 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
MutualRm(ctx context.Context, id peer.ID, tag string) bool
// IsMutual returns whether the given peer is a mutual peer.
IsMutual(ctx context.Context, id peer.ID, tag string) bool

// BandwidthStats returns a Stats struct with bandwidth metrics for all
// data sent/received by the local peer, regardless of protocol or remote
// data sent/received by the local peer, regardless of protocol or remote
// peer IDs.
BandwidthStats(context.Context) Stats
// BandwidthForPeer returns a Stats struct with bandwidth metrics associated
// with the given peer.ID. The metrics returned include all traffic sent /
// received for the peer, regardless of protocol.
BandwidthForPeer(ctx context.Context, id peer.ID) Stats
// BandwidthForProtocol returns a Stats struct with bandwidth metrics
// BandwidthForProtocol returns a Stats struct with bandwidth metrics
// associated with the given protocol.ID.
BandwidthForProtocol(ctx context.Context, proto protocol.ID) Stats

// ResourceState returns the state of the resource manager.
ResourceState(context.Context) rcmgr.ResourceManagerStat

// PubSubPeers returns the peer IDs of the peers joined on
// the given topic.
PubSubPeers(ctx context.Context, topic string) ([]peer.ID, error)
Expand All @@ -211,7 +211,7 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
type NodeModule interface {
// Info returns administrative information about the node.
Info(context.Context) (Info, error)

// LogLevelSet sets the given component log level to the given level.
LogLevelSet(ctx context.Context, name, level string) error

Expand All @@ -220,7 +220,7 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
// AuthNew signs and returns a new token with the given permissions.
AuthNew(ctx context.Context, perms []auth.Permission) ([]byte, error)
}

```

#### DAS
Expand All @@ -241,7 +241,7 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
// Balance retrieves the Celestia coin balance for the node's account/signer
// and verifies it against the corresponding block's AppHash.
Balance(ctx context.Context) (*state.Balance, error)
// BalanceForAddress retrieves the Celestia coin balance for the given
// BalanceForAddress retrieves the Celestia coin balance for the given
// address and verifies the returned balance against the corresponding
// block's AppHash.
BalanceForAddress(ctx context.Context, addr state.Address) (*state.Balance, error)
Expand All @@ -250,15 +250,15 @@ NetworkHead(ctx context.Context) (*header.ExtendedHeader, error)
SubmitTx(ctx context.Context, tx state.Tx) (*state.TxResponse, error)
// SubmitPayForBlob builds, signs and submits a PayForBlob transaction.
SubmitPayForBlob(
ctx context.Context,
nID namespace.ID,
ctx context.Context,
nID namespace.ID,
data []byte,
config *state.TxConfig,
) (*state.TxResponse, error)
// Transfer sends the given amount of coins from default wallet of the node
// Transfer sends the given amount of coins from default wallet of the node
// to the given account address.
Transfer(
ctx context.Context,
ctx context.Context,
to types.Address,
amount types.Int,
config *state.TxConfig,
Expand All @@ -279,8 +279,8 @@ yet.
type StakingModule interface {
// Delegate sends a user's liquid tokens to a validator for delegation.
Delegate(
ctx context.Context,
delAddr state.ValAddress,
ctx context.Context,
delAddr state.ValAddress,
amount state.Int,
config *state.TxConfig,
) (*state.TxResponse, error)
Expand All @@ -290,18 +290,18 @@ yet.
srcValAddr,
dstValAddr state.ValAddress,
amount state.Int,
config *state.TxConfig,
config *state.TxConfig,
) (*state.TxResponse, error)
// Undelegate undelegates a user's delegated tokens, unbonding them from the
// current validator.
Undelegate(
ctx context.Context,
ctx context.Context,
delAddr state.ValAddress,
amount state.Int,
config *state.TxConfig,
) (*state.TxResponse, error)

// CancelUnbondingDelegation cancels a user's pending undelegation from a
// CancelUnbondingDelegation cancels a user's pending undelegation from a
// validator.
CancelUnbondingDelegation(
ctx context.Context,
Expand All @@ -314,8 +314,8 @@ yet.
// QueryDelegation retrieves the delegation information between a delegator
// and a validator.
QueryDelegation(
ctx context.Context,
valAddr state.ValAddress,
ctx context.Context,
valAddr state.ValAddress,
) (*types.QueryDelegationResponse, error)
// QueryRedelegations retrieves the status of the redelegations between a
// delegator and a validator.
Expand Down Expand Up @@ -354,11 +354,11 @@ yet.
type MetricsModule interface {
// List shows all the registered meters.
List(ctx) (string[], error)

// Enable turns on the specific meter.
Enable(string) error
Disable(string) error

// ExportTo sets the endpoint the metrics should be exported to
ExportTo(string)
}
Expand All @@ -376,7 +376,7 @@ Eventually, it would be nice to break up `StateModule` into `StateModule`,
```go
type StateModule interface {
// QueryABCI proxies a generic ABCI query to the core endpoint.
QueryABCI(ctx context.Context, request abci.RequestQuery)
QueryABCI(ctx context.Context, request abci.RequestQuery)
(*coretypes.ResultABCIQuery, error)
// SubmitTx submits the given transaction/message to the Celestia network
// and blocks until the tx is included in a block.
Expand All @@ -391,17 +391,17 @@ type BankModule interface {
// Balance retrieves the Celestia coin balance for the node's account/signer
// and verifies it against the corresponding block's AppHash.
Balance(ctx context.Context) (*state.Balance, error)
// BalanceForAddress retrieves the Celestia coin balance for the given
// BalanceForAddress retrieves the Celestia coin balance for the given
// address and verifies the returned balance against the corresponding
// block's AppHash.
BalanceForAddress(ctx context.Context, addr state.Address) (*state.Balance, error)
// SubmitPayForBlob builds, signs and submits a PayForBlob transaction.
SubmitPayForBlob(
ctx context.Context,
blobs []*state.Blob,
config *state.TxConfig,
config *state.TxConfig,
) (*state.TxResponse, error)
// Transfer sends the given amount of coins from default wallet of the node
// Transfer sends the given amount of coins from default wallet of the node
// to the given account address.
Transfer(
ctx context.Context,
Expand All @@ -420,7 +420,7 @@ type BankModule interface {
Redelegate
Unbond
CancelUnbond

QueryDelegation
QueryRedelegation
QueryUnbondingDelegation
Expand Down
41 changes: 21 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ require (
github.com/BurntSushi/toml v1.5.0
github.com/alecthomas/jsonschema v0.0.0-20220216202328-9eeeec9d044b
github.com/benbjohnson/clock v1.3.5
github.com/celestiaorg/celestia-app/v6 v6.0.5-mocha
github.com/celestiaorg/celestia-app/v6 v6.0.6-rc0.0.20251002130659-8025e182ffee
github.com/celestiaorg/go-fraud v0.2.3
github.com/celestiaorg/go-header v0.7.3
github.com/celestiaorg/go-libp2p-messenger v0.2.2
github.com/celestiaorg/go-square/merkle v0.0.0-20240117232118-fd78256df076
github.com/celestiaorg/go-square/v3 v3.0.1
github.com/celestiaorg/nmt v0.24.1
github.com/celestiaorg/rsmt2d v0.15.0
github.com/celestiaorg/go-square/v3 v3.0.2
github.com/celestiaorg/nmt v0.24.2
github.com/celestiaorg/rsmt2d v0.15.1
github.com/cometbft/cometbft v0.38.17
github.com/cosmos/cosmos-sdk v0.50.13
github.com/cristalhq/jwt/v5 v5.4.0
Expand Down Expand Up @@ -73,9 +73,9 @@ require (
go.opentelemetry.io/proto/otlp v1.7.0
go.uber.org/fx v1.24.0
go.uber.org/zap v1.27.0
golang.org/x/crypto v0.41.0
golang.org/x/crypto v0.42.0
golang.org/x/sync v0.17.0
golang.org/x/text v0.28.0
golang.org/x/text v0.29.0
google.golang.org/grpc v1.75.1
google.golang.org/protobuf v1.36.9
)
Expand Down Expand Up @@ -110,20 +110,20 @@ require (
github.com/Jorropo/jsync v1.0.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/aws/aws-sdk-go v1.55.5 // indirect
github.com/aws/aws-sdk-go-v2 v1.39.0 // indirect
github.com/aws/aws-sdk-go-v2 v1.39.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.1 // indirect
github.com/aws/aws-sdk-go-v2/config v1.31.8 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.18.12 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.7 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.9 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.7 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.7 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.8.9 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.88.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.29.3 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.34.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.38.4 // indirect
Expand Down Expand Up @@ -356,14 +356,15 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/arch v0.15.0 // indirect
golang.org/x/exp v0.0.0-20250813145105-42675adae3e6 // indirect
golang.org/x/mod v0.27.0 // indirect
golang.org/x/net v0.43.0 // indirect
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/mod v0.28.0 // indirect
golang.org/x/net v0.44.0 // indirect
golang.org/x/oauth2 v0.31.0 // indirect
golang.org/x/sys v0.35.0 // indirect
golang.org/x/term v0.34.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect
golang.org/x/term v0.35.0 // indirect
golang.org/x/time v0.12.0 // indirect
golang.org/x/tools v0.36.0 // indirect
golang.org/x/tools v0.37.0 // indirect
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
gonum.org/v1/gonum v0.16.0 // indirect
google.golang.org/api v0.247.0 // indirect
Expand Down
Loading
Loading