Skip to content
Closed
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
6 changes: 3 additions & 3 deletions block/components.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/evstack/ev-node/types"
)

// Components represents the block-related components
// Components represents the block-related components.
type Components struct {
Executor *executing.Executor
Pruner *pruner.Pruner
Expand All @@ -41,7 +41,7 @@ type Components struct {
}

// Start starts all components and monitors for critical errors.
// It is blocking and returns when the context is cancelled or an error occurs
// It is blocking and returns when the context is cancelled or an error occurs.
func (bc *Components) Start(ctx context.Context) error {
ctxWithCancel, cancel := context.WithCancel(ctx)

Expand Down Expand Up @@ -95,7 +95,7 @@ func (bc *Components) Start(ctx context.Context) error {
}
}

// Stop stops all components
// Stop stops all components.
func (bc *Components) Stop() error {
var errs error
if bc.Executor != nil {
Expand Down
2 changes: 1 addition & 1 deletion block/components_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/evstack/ev-node/types"
)

// noopDAHintAppender is a no-op implementation of DAHintAppender for testing
// noopDAHintAppender is a no-op implementation of DAHintAppender for testing.
type noopDAHintAppender struct{}

func (n noopDAHintAppender) AppendDAHint(ctx context.Context, daHeight uint64, heights ...uint64) error {
Expand Down
4 changes: 2 additions & 2 deletions block/internal/syncing/da_retriever_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/evstack/ev-node/types"
)

// newTestDARetriever creates a DA retriever for testing with the given DA implementation
// newTestDARetriever creates a DA retriever for testing with the given DA implementation.
func newTestDARetriever(t *testing.T, mockClient *mocks.MockClient, cfg config.Config, gen genesis.Genesis) *daRetriever {
t.Helper()
if cfg.DA.Namespace == "" {
Expand Down Expand Up @@ -55,7 +55,7 @@ func newTestDARetriever(t *testing.T, mockClient *mocks.MockClient, cfg config.C
return NewDARetriever(mockClient, cm, gen, zerolog.Nop())
}

// makeSignedDataBytes builds SignedData containing the provided Data and returns its binary encoding
// makeSignedDataBytes builds SignedData containing the provided Data and returns its binary encoding.
func makeSignedDataBytes(t *testing.T, chainID string, height uint64, proposer []byte, pub crypto.PubKey, signer signerpkg.Signer, txs int) ([]byte, *types.SignedData) {
return makeSignedDataBytesWithTime(t, chainID, height, proposer, pub, signer, txs, uint64(time.Now().UnixNano()))
}
Expand Down
14 changes: 7 additions & 7 deletions block/internal/syncing/raft_retriever.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import (
"github.com/evstack/ev-node/types"
)

// raftStatePreProcessor is called before processing a raft block state
// raftStatePreProcessor is called before processing a raft block state.
type raftStatePreProcessor func(ctx context.Context, state *raft.RaftBlockState) error

// raftRetriever retrieves raft blocks and feeds them into the eventProcessor
// raftRetriever retrieves raft blocks and feeds them into the eventProcessor.
type raftRetriever struct {
raftNode common.RaftNode
wg sync.WaitGroup
Expand All @@ -30,7 +30,7 @@ type raftRetriever struct {
cancel context.CancelFunc
}

// newRaftRetriever constructor
// newRaftRetriever is the constructor.
func newRaftRetriever(
raftNode common.RaftNode,
genesis genesis.Genesis,
Expand All @@ -47,7 +47,7 @@ func newRaftRetriever(
}
}

// Start begins the syncing component
// Start begins the syncing component.
func (r *raftRetriever) Start(ctx context.Context) error {
r.mtx.Lock()
defer r.mtx.Unlock()
Expand All @@ -64,7 +64,7 @@ func (r *raftRetriever) Start(ctx context.Context) error {
return nil
}

// Stop gracefully shuts down the raft retriever
// Stop gracefully shuts down the raft retriever.
func (r *raftRetriever) Stop() {
r.mtx.Lock()
if r.cancel != nil {
Expand All @@ -77,7 +77,7 @@ func (r *raftRetriever) Stop() {
r.raftNode.SetApplyCallback(nil)
}

// raftApplyLoop processes blocks received from raft
// raftApplyLoop processes blocks received from raft.
func (r *raftRetriever) raftApplyLoop(ctx context.Context, applyCh <-chan raft.RaftApplyMsg) {
r.logger.Info().Msg("starting raft apply loop")
defer r.logger.Info().Msg("raft apply loop stopped")
Expand All @@ -94,7 +94,7 @@ func (r *raftRetriever) raftApplyLoop(ctx context.Context, applyCh <-chan raft.R
}
}

// consumeRaftBlock applies a block received from raft consensus
// consumeRaftBlock applies a block received from raft consensus.
func (r *raftRetriever) consumeRaftBlock(ctx context.Context, state *raft.RaftBlockState) error {
r.logger.Debug().
Uint64("height", state.Height).
Expand Down
4 changes: 2 additions & 2 deletions block/internal/syncing/syncer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (s *stubRaftNode) recordedCallbacks() []chan<- raft.RaftApplyMsg {
return out
}

// helper to create a signer, pubkey and address for tests
// buildSyncTestSigner is a helper to create a signer, pubkey and address for tests.
func buildSyncTestSigner(tb testing.TB) (addr []byte, pub crypto.PubKey, signer signerpkg.Signer) {
tb.Helper()
priv, _, err := crypto.GenerateEd25519Key(crand.Reader)
Expand All @@ -74,7 +74,7 @@ func buildSyncTestSigner(tb testing.TB) (addr []byte, pub crypto.PubKey, signer
return a, p, n
}

// makeSignedHeaderBytes builds a valid SignedHeader and returns its binary encoding and the object
// makeSignedHeaderBytes builds a valid SignedHeader and returns its binary encoding and the object.
func makeSignedHeaderBytes(
tb testing.TB,
chainID string,
Expand Down
2 changes: 1 addition & 1 deletion core/execution/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
// DummyExecutor
//---------------------

// DummyExecutor is a dummy implementation of the Executor interface for testing
// DummyExecutor is a dummy implementation of Executor for testing.
type DummyExecutor struct {
mu sync.RWMutex // Add mutex for thread safety
stateRoot []byte
Expand Down
2 changes: 1 addition & 1 deletion core/sequencer/dummy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

var _ Sequencer = (*DummySequencer)(nil)

// DummySequencer is a dummy implementation of the Sequencer interface for testing
// DummySequencer is a dummy implementation of Sequencer for testing.
type DummySequencer struct {
mu sync.RWMutex
batches map[string][]*Batch
Expand Down
2 changes: 1 addition & 1 deletion pkg/cmd/run_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/evstack/ev-node/pkg/telemetry"
)

// ParseConfig is a helper that loads the node configuration and validates it.
// ParseConfig is a helper function that loads the node configuration and validates it.
func ParseConfig(cmd *cobra.Command) (rollconf.Config, error) {
nodeConfig, err := rollconf.Load(cmd)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/raft/election_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func TestDynamicLeaderElectionRun(t *testing.T) {
}
}

// Helper to quickly build a Config with very short timeouts for tests
// testCfg is a helper to quickly build a Config with very short timeouts for tests.
func testCfg() Config {
return Config{SendTimeout: 2 * time.Millisecond}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/rpc/server/tracing.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ func (t *tracedP2PServer) GetNetInfo(
return res, nil
}

// tracedConfigServer decorates a ConfigServiceHandler with OpenTelemetry spans.
// tracedConfigServer decorates the config service handler with OpenTelemetry spans.
type tracedConfigServer struct {
inner v1connect.ConfigServiceHandler
tracer trace.Tracer
Expand Down
2 changes: 1 addition & 1 deletion pkg/sequencers/single/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ func (bq *BatchQueue) Load(ctx context.Context) error {
var legacyItems []queuedItem
for result := range results.Next() {
if result.Error != nil {
// a datastore read failure means the WAL cannot be trusted as
// A datastore read failure means the WAL cannot be trusted as
// loaded — fail startup rather than silently dropping txs.
return fmt.Errorf("failed to read WAL entry from datastore: %w", result.Error)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/service/baseservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/rs/zerolog"
)

// dummyService is a simple implementation of the Service interface for testing purposes.
// dummyService is a simple implementation of Service for testing purposes.
type dummyService struct {
*BaseService
runCalled bool
Expand Down
Loading