From 6d5044cb6ad742fd8539dbb19949a458b3704441 Mon Sep 17 00:00:00 2001 From: colinaumaty Date: Thu, 24 Sep 2026 17:35:22 +0800 Subject: [PATCH 1/2] chore: minor improvement for docs Signed-off-by: colinaumaty --- pkg/cmd/run_node.go | 2 +- pkg/raft/election_test.go | 2 +- pkg/rpc/server/tracing.go | 2 +- pkg/sequencers/single/queue.go | 2 +- pkg/service/baseservice_test.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/cmd/run_node.go b/pkg/cmd/run_node.go index a5f667bee1..b6bdeb64b9 100644 --- a/pkg/cmd/run_node.go +++ b/pkg/cmd/run_node.go @@ -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 { diff --git a/pkg/raft/election_test.go b/pkg/raft/election_test.go index 5510b29819..4f0c947933 100644 --- a/pkg/raft/election_test.go +++ b/pkg/raft/election_test.go @@ -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} } diff --git a/pkg/rpc/server/tracing.go b/pkg/rpc/server/tracing.go index 8448285e0a..0f6f2eb444 100644 --- a/pkg/rpc/server/tracing.go +++ b/pkg/rpc/server/tracing.go @@ -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 diff --git a/pkg/sequencers/single/queue.go b/pkg/sequencers/single/queue.go index 57ada8ab38..b767ec7fc2 100644 --- a/pkg/sequencers/single/queue.go +++ b/pkg/sequencers/single/queue.go @@ -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) } diff --git a/pkg/service/baseservice_test.go b/pkg/service/baseservice_test.go index e48afd326c..3524ef72c8 100644 --- a/pkg/service/baseservice_test.go +++ b/pkg/service/baseservice_test.go @@ -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 From 9d24f4f9b565e692e865605c7f936f666b2258a1 Mon Sep 17 00:00:00 2001 From: zjubiology Date: Sun, 27 Sep 2026 07:32:37 +0800 Subject: [PATCH 2/2] fix(evm): clear omitted payload optionals and fix some comments Signed-off-by: zjubiology --- block/components.go | 6 +++--- block/components_test.go | 2 +- block/internal/syncing/da_retriever_test.go | 4 ++-- block/internal/syncing/raft_retriever.go | 14 +++++++------- block/internal/syncing/syncer_test.go | 4 ++-- core/execution/dummy.go | 2 +- core/sequencer/dummy.go | 2 +- 7 files changed, 17 insertions(+), 17 deletions(-) diff --git a/block/components.go b/block/components.go index 5eb5855d28..54a60b1c4c 100644 --- a/block/components.go +++ b/block/components.go @@ -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 @@ -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) @@ -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 { diff --git a/block/components_test.go b/block/components_test.go index d8ddc53ba2..a438a6a65d 100644 --- a/block/components_test.go +++ b/block/components_test.go @@ -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 { diff --git a/block/internal/syncing/da_retriever_test.go b/block/internal/syncing/da_retriever_test.go index 2feb4577aa..6bd90e4e38 100644 --- a/block/internal/syncing/da_retriever_test.go +++ b/block/internal/syncing/da_retriever_test.go @@ -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 == "" { @@ -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())) } diff --git a/block/internal/syncing/raft_retriever.go b/block/internal/syncing/raft_retriever.go index a0a527f208..a9a3ea664a 100644 --- a/block/internal/syncing/raft_retriever.go +++ b/block/internal/syncing/raft_retriever.go @@ -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 @@ -30,7 +30,7 @@ type raftRetriever struct { cancel context.CancelFunc } -// newRaftRetriever constructor +// newRaftRetriever is the constructor. func newRaftRetriever( raftNode common.RaftNode, genesis genesis.Genesis, @@ -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() @@ -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 { @@ -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") @@ -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). diff --git a/block/internal/syncing/syncer_test.go b/block/internal/syncing/syncer_test.go index e78a8771c6..e594276dce 100644 --- a/block/internal/syncing/syncer_test.go +++ b/block/internal/syncing/syncer_test.go @@ -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) @@ -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, diff --git a/core/execution/dummy.go b/core/execution/dummy.go index 8953ded2a7..6dce34a3fb 100644 --- a/core/execution/dummy.go +++ b/core/execution/dummy.go @@ -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 diff --git a/core/sequencer/dummy.go b/core/sequencer/dummy.go index ef614173a8..99bbcd0ebf 100644 --- a/core/sequencer/dummy.go +++ b/core/sequencer/dummy.go @@ -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