Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove some TODOs #3810

Merged
merged 3 commits into from
Oct 17, 2024
Merged
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: 0 additions & 1 deletion nodebuilder/da/da.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Internal struct {
MaxBlobSize func(ctx context.Context) (uint64, error) `perm:"read"`
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/das/das.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Internal struct {
SamplingStats func(ctx context.Context) (das.SamplingStats, error) `perm:"read"`
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/fraud/fraud.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Internal struct {
Subscribe func(context.Context, fraud.ProofType) (<-chan *Proof, error) `perm:"read"`
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/header/header.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Internal struct {
LocalHead func(context.Context) (*header.ExtendedHeader, error) `perm:"read"`
Expand Down
2 changes: 0 additions & 2 deletions nodebuilder/header/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ func (s *Service) GetByHeight(ctx context.Context, height uint64) (*header.Exten
"networkHeight: %d, requestedHeight: %d", head.Height(), height)
}

// TODO(vgonkivs): remove after https://github.com/celestiaorg/go-header/issues/32 is
// implemented and fetch header from HeaderEx if missing locally
head, err = s.store.Head(ctx)
switch {
case err != nil:
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ func (m *module) PubSubTopics(_ context.Context) ([]string, error) {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
//
//nolint:dupl
type API struct {
Expand Down
5 changes: 2 additions & 3 deletions nodebuilder/share/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ const (
defaultBlockstoreCacheSize = 128
)

// TODO: some params are pointers and other are not, Let's fix this.
type Config struct {
// EDSStoreParams sets eds store configuration parameters
EDSStoreParams *store.Parameters
Expand All @@ -28,9 +27,9 @@ type Config struct {
// ShrExNDParams sets shrexnd client and server configuration parameters
ShrExNDParams *shrexnd.Parameters
// PeerManagerParams sets peer-manager configuration parameters
PeerManagerParams peers.Parameters
PeerManagerParams *peers.Parameters

LightAvailability light.Parameters `toml:",omitempty"`
LightAvailability *light.Parameters `toml:",omitempty"`
Discovery *discovery.Parameters
}

Expand Down
4 changes: 2 additions & 2 deletions nodebuilder/share/p2p_constructors.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func fullDiscoveryAndPeerManager(tp node.Type, cfg *Config) fx.Option {
}

fullManager, err := peers.NewManager(
cfg.PeerManagerParams,
*cfg.PeerManagerParams,
host,
connGater,
fullNodesTag,
Expand Down Expand Up @@ -114,7 +114,7 @@ func archivalDiscoveryAndPeerManager(tp node.Type, cfg *Config) fx.Option {
gater *conngater.BasicConnectionGater,
) (map[string]*peers.Manager, []*discovery.Discovery, error) {
archivalPeerManager, err := peers.NewManager(
cfg.PeerManagerParams,
*cfg.PeerManagerParams,
h,
gater,
archivalNodesTag,
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/share/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
type API struct {
Internal struct {
SharesAvailable func(context.Context, *header.ExtendedHeader) error `perm:"read"`
Expand Down
1 change: 0 additions & 1 deletion nodebuilder/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ type Module interface {
}

// API is a wrapper around Module for the RPC.
// TODO(@distractedm1nd): These structs need to be autogenerated.
//
//nolint:dupl
type API struct {
Expand Down
2 changes: 1 addition & 1 deletion share/availability/light/availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func NewShareAvailability(
ds datastore.Batching,
opts ...Option,
) *ShareAvailability {
params := DefaultParameters()
params := *DefaultParameters()
ds = namespace.Wrap(ds, cacheAvailabilityPrefix)
autoDS := autobatch.NewAutoBatching(ds, writeBatchSize)

Expand Down
4 changes: 2 additions & 2 deletions share/availability/light/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ type Option func(*Parameters)

// DefaultParameters returns the default Parameters' configuration values
// for the light availability implementation
func DefaultParameters() Parameters {
return Parameters{
func DefaultParameters() *Parameters {
return &Parameters{
SampleAmount: DefaultSampleAmount,
}
}
Expand Down
3 changes: 1 addition & 2 deletions share/share.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package share

import (
"crypto/sha256"
"fmt"

"github.com/celestiaorg/celestia-app/v2/pkg/appconsts"
Expand Down Expand Up @@ -69,7 +68,7 @@ func (s *ShareWithProof) Validate(rootHash []byte, x, y, edsSize int) bool {
namespace = GetNamespace(s.Share)
}
return s.Proof.VerifyInclusion(
sha256.New(), // TODO(@Wondertan): This should be defined somewhere globally
NewSHA256Hasher(),
namespace.ToNMT(),
[][]byte{s.Share},
rootHash,
Expand Down
4 changes: 2 additions & 2 deletions share/shwap/p2p/shrex/peers/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ func TestIntegration(t *testing.T) {
connGater, err := conngater.NewBasicConnectionGater(dssync.MutexWrap(datastore.NewMapDatastore()))
require.NoError(t, err)
fnPeerManager, err := NewManager(
DefaultParameters(),
*DefaultParameters(),
nil,
connGater,
"test",
Expand Down Expand Up @@ -477,7 +477,7 @@ func testManager(ctx context.Context, headerSub libhead.Subscriber[*header.Exten
return nil, err
}
manager, err := NewManager(
DefaultParameters(),
*DefaultParameters(),
host,
connGater,
"test",
Expand Down
4 changes: 2 additions & 2 deletions share/shwap/p2p/shrex/peers/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ func (p *Parameters) Validate() error {
}

// DefaultParameters returns the default configuration values for the peer manager parameters
func DefaultParameters() Parameters {
return Parameters{
func DefaultParameters() *Parameters {
return &Parameters{
// PoolValidationTimeout's default value is based on the default daser sampling timeout of 1 minute.
// If a received datahash has not tried to be sampled within these two minutes, the pool will be
// removed.
Expand Down
2 changes: 1 addition & 1 deletion share/shwap/p2p/shrex/shrex_getter/shrex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func testManager(
return nil, err
}
manager, err := peers.NewManager(
peers.DefaultParameters(),
*peers.DefaultParameters(),
host,
connGater,
"test",
Expand Down
Loading