Skip to content

Commit 9994d0e

Browse files
committed
Merge branch 'main' into alex/adr023_ha-failover_raft2
* main: feat(store)!: add batching for atomicity (#2746) refactor(apps): rollback cmd updates (#2744) chore: add makefile for tools (#2743) chore: fix markdown lint (#2742) build(deps): Bump the all-go group across 5 directories with 6 updates (#2738) refactor(block): improve cancellation (#2741) chore: make the prompt go oriented (#2739) perf(block): use `sync/atomic` instead of mutexes (#2735)
2 parents f8db26f + 1ff30ea commit 9994d0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1213
-1213
lines changed

.github/workflows/claude-code-review.yml

Lines changed: 49 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,59 @@ jobs:
3636
uses: anthropics/claude-code-action@v1
3737
with:
3838
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
track_progress: true
40+
use_sticky_comment: true
3941
prompt: |
40-
Please review this pull request and provide feedback on:
41-
- Code quality and best practices
42-
- Potential bugs or issues
43-
- Performance considerations
44-
- Security concerns
45-
- Test coverage
42+
Perform a comprehensive code review with the following focus areas:
43+
44+
1. **Code Quality & Architecture**
45+
- Verify adherence to idiomatic Go style (effective-go, golangci-lint compliance, naming conventions).
46+
- Assess package structure for clarity and modularity (avoid cyclic dependencies, promote clean boundaries).
47+
- Ensure interfaces are used appropriately — not over-abstracted but testable.
48+
- Review concurrency patterns (goroutines, channels, sync primitives) for correctness and deadlock safety.
49+
- Check configuration management (flags, environment variables, config files) for clarity and consistency.
50+
- Validate that logging, error propagation, and context handling (context.Context) are consistent and properly implemented.
51+
52+
2. **Error Handling & Resilience**
53+
- Verify consistent error wrapping and context (use of %w, errors.Join, or fmt.Errorf).
54+
- Ensure external dependencies (network, file I/O, DB connections) have proper retry, timeout, and cancellation logic.
55+
- Confirm panics are avoided or safely recovered from in long-running goroutines.
56+
- Assess logging for meaningful messages while avoiding sensitive data exposure.
57+
58+
3. **Security**
59+
- Review authentication/authorization logic and credential management.
60+
- Check input validation and sanitization for APIs, CLI, or device message payloads.
61+
- Ensure secrets are not hard-coded or logged.
62+
- Confirm secure handling of TLS, tokens, and crypto functions where applicable.
63+
- Validate dependencies for known vulnerabilities and verify minimal privilege access patterns.
64+
65+
4. **Performance & Resource Efficiency**
66+
- Inspect hot paths for unnecessary allocations or blocking operations.
67+
- Check for proper use of connection pools, goroutine lifecycle management, and cleanup.
68+
- Review memory and CPU usage in concurrent loops, background workers, and I/O pipelines.
69+
- Evaluate database or cache query efficiency and connection reuse.
4670
47-
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
4871
49-
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
72+
5. **Testing & Reliability**
73+
- Verify presence and adequacy of unit, integration, and end-to-end tests.
74+
- Check test naming, isolation, and reproducibility.
75+
- Ensure key edge cases (timeouts, partial failures, concurrent access) are covered.
76+
- Review use of mocks/fakes for external dependencies.
77+
- Confirm go test and CI workflows run cleanly and consistently.
78+
79+
80+
6. **Documentation & Developer Experience**
81+
- Confirm code comments and docstrings clearly describe public APIs, exported structs, and interfaces.
82+
- Review README.md, setup scripts, and examples for developer onboarding.
83+
- Ensure configuration and runtime parameters are documented.
84+
- Check generated API documentation (if applicable) for completeness and alignment with implementation.
85+
86+
87+
Feedback Guidelines
88+
• Use inline comments for file- or line-specific issues and improvements.
89+
• Use top-level comments for architectural observations, general patterns, or praise.
90+
• Prioritize clarity, robustness, and production readiness in all feedback.
5091
5192
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5293
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
5394
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
54-
use_sticky_comment: true

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ include ./scripts/test.mk
33
include ./scripts/proto.mk
44
include ./scripts/utils.mk
55
include ./scripts/run.mk
6+
include ./tools/tools.mk
67

78
# Sets the default make target to `build`.
89
# Requires GNU Make >= v3.81.

apps/evm/single/cmd/rollback.go

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67

78
ds "github.com/ipfs/go-datastore"
@@ -18,9 +19,8 @@ import (
1819
// NewRollbackCmd creates a command to rollback ev-node state by one height.
1920
func NewRollbackCmd() *cobra.Command {
2021
var (
21-
height uint64
22-
skipP2PStores bool
23-
syncNode bool
22+
height uint64
23+
syncNode bool
2424
)
2525

2626
cmd := &cobra.Command{
@@ -69,10 +69,6 @@ func NewRollbackCmd() *cobra.Command {
6969
return fmt.Errorf("failed to rollback ev-node state: %w", err)
7070
}
7171

72-
if skipP2PStores {
73-
return printSuccess(height)
74-
}
75-
7672
// rollback ev-node goheader state
7773
headerStore, err := goheaderstore.NewStore[*types.SignedHeader](
7874
evolveDB,
@@ -102,27 +98,26 @@ func NewRollbackCmd() *cobra.Command {
10298
}
10399
defer dataStore.Stop(goCtx)
104100

101+
var errs error
105102
if err := headerStore.DeleteRange(goCtx, height+1, headerStore.Height()); err != nil {
106-
return fmt.Errorf("failed to rollback header sync service state: %w", err)
103+
errs = errors.Join(errs, fmt.Errorf("failed to rollback header sync service state: %w", err))
107104
}
108105

109106
if err := dataStore.DeleteRange(goCtx, height+1, dataStore.Height()); err != nil {
110-
return fmt.Errorf("failed to rollback data sync service state: %w", err)
107+
errs = errors.Join(errs, fmt.Errorf("failed to rollback data sync service state: %w", err))
108+
}
109+
110+
fmt.Printf("Rolled back ev-node state to height %d\n", height)
111+
if syncNode {
112+
fmt.Println("Restart the node with the `--clear-cache` flag")
111113
}
112114

113-
return printSuccess(height)
115+
return errs
114116
},
115117
}
116118

117119
cmd.Flags().Uint64Var(&height, "height", 0, "rollback to a specific height")
118120
cmd.Flags().BoolVar(&syncNode, "sync-node", false, "sync node (no aggregator)")
119-
cmd.Flags().BoolVar(&skipP2PStores, "skip-p2p-stores", false, "skip rollback p2p stores (goheaderstore)")
120121

121122
return cmd
122123
}
123-
124-
func printSuccess(height uint64) error {
125-
fmt.Printf("Rolled back ev-node state to height %d\n", height)
126-
fmt.Println("Restart the node with the `--clear-cache` flag")
127-
return nil
128-
}

apps/evm/single/go.mod

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/evstack/ev-node/apps/evm/single
22

33
go 1.24.6
44

5-
replace github.com/celestiaorg/go-header => github.com/julienrbrt/go-header v0.0.0-20250909151551-cb11b091bf58 // TODO: to remove after https://github.com/celestiaorg/go-header/pull/347
5+
replace github.com/celestiaorg/go-header => github.com/julienrbrt/go-header v0.0.0-20251008134330-747c8c192fa8 // TODO: to remove after https://github.com/celestiaorg/go-header/pull/347
66

77
replace (
88
github.com/evstack/ev-node => ../../../
@@ -14,7 +14,7 @@ replace (
1414
require (
1515
github.com/celestiaorg/go-header v0.7.3
1616
github.com/ethereum/go-ethereum v1.16.4
17-
github.com/evstack/ev-node v1.0.0-beta.5
17+
github.com/evstack/ev-node v1.0.0-beta.6
1818
github.com/evstack/ev-node/core v1.0.0-beta.3
1919
github.com/evstack/ev-node/da v0.0.0-20250317130407-e9e0a1b0485e
2020
github.com/evstack/ev-node/execution/evm v0.0.0-00010101000000-000000000000
@@ -34,7 +34,7 @@ require (
3434
github.com/bits-and-blooms/bitset v1.20.0 // indirect
3535
github.com/boltdb/bolt v1.3.1 // indirect
3636
github.com/celestiaorg/go-libp2p-messenger v0.2.2 // indirect
37-
github.com/celestiaorg/go-square/v3 v3.0.1 // indirect
37+
github.com/celestiaorg/go-square/v3 v3.0.2 // indirect
3838
github.com/cespare/xxhash/v2 v2.3.0 // indirect
3939
github.com/consensys/gnark-crypto v0.18.0 // indirect
4040
github.com/crate-crypto/go-eth-kzg v1.4.0 // indirect
@@ -82,10 +82,10 @@ require (
8282
github.com/holiman/uint256 v1.3.2 // indirect
8383
github.com/huin/goupnp v1.3.0 // indirect
8484
github.com/inconshreveable/mousetrap v1.1.0 // indirect
85-
github.com/ipfs/boxo v0.33.1 // indirect
85+
github.com/ipfs/boxo v0.35.0 // indirect
8686
github.com/ipfs/go-cid v0.5.0 // indirect
8787
github.com/ipfs/go-ds-badger4 v0.1.8 // indirect
88-
github.com/ipfs/go-log/v2 v2.8.0 // indirect
88+
github.com/ipfs/go-log/v2 v2.8.1 // indirect
8989
github.com/ipld/go-ipld-prime v0.21.0 // indirect
9090
github.com/jackpal/go-nat-pmp v1.0.2 // indirect
9191
github.com/jbenet/go-temp-err-catcher v0.1.0 // indirect
@@ -97,8 +97,8 @@ require (
9797
github.com/libp2p/go-flow-metrics v0.3.0 // indirect
9898
github.com/libp2p/go-libp2p v0.43.0 // indirect
9999
github.com/libp2p/go-libp2p-asn-util v0.4.1 // indirect
100-
github.com/libp2p/go-libp2p-kad-dht v0.34.0 // indirect
101-
github.com/libp2p/go-libp2p-kbucket v0.7.0 // indirect
100+
github.com/libp2p/go-libp2p-kad-dht v0.35.1 // indirect
101+
github.com/libp2p/go-libp2p-kbucket v0.8.0 // indirect
102102
github.com/libp2p/go-libp2p-pubsub v0.15.0 // indirect
103103
github.com/libp2p/go-libp2p-record v0.3.1 // indirect
104104
github.com/libp2p/go-libp2p-routing-helpers v0.7.5 // indirect
@@ -125,7 +125,7 @@ require (
125125
github.com/multiformats/go-multicodec v0.9.2 // indirect
126126
github.com/multiformats/go-multihash v0.2.3 // indirect
127127
github.com/multiformats/go-multistream v0.6.1 // indirect
128-
github.com/multiformats/go-varint v0.0.7 // indirect
128+
github.com/multiformats/go-varint v0.1.0 // indirect
129129
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
130130
github.com/olekukonko/tablewriter v0.0.5 // indirect
131131
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
@@ -178,7 +178,7 @@ require (
178178
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
179179
github.com/wlynxg/anet v0.0.5 // indirect
180180
go.opencensus.io v0.24.0 // indirect
181-
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
181+
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
182182
go.opentelemetry.io/otel v1.38.0 // indirect
183183
go.opentelemetry.io/otel/metric v1.38.0 // indirect
184184
go.opentelemetry.io/otel/trace v1.38.0 // indirect
@@ -187,20 +187,21 @@ require (
187187
go.uber.org/mock v0.5.2 // indirect
188188
go.uber.org/multierr v1.11.0 // indirect
189189
go.uber.org/zap v1.27.0 // indirect
190-
go.yaml.in/yaml/v2 v2.4.2 // indirect
190+
go.yaml.in/yaml/v2 v2.4.3 // indirect
191191
go.yaml.in/yaml/v3 v3.0.4 // indirect
192192
golang.org/x/crypto v0.42.0 // indirect
193-
golang.org/x/exp v0.0.0-20250811191247-51f88131bc50 // indirect
194-
golang.org/x/mod v0.27.0 // indirect
193+
golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect
194+
golang.org/x/mod v0.28.0 // indirect
195195
golang.org/x/net v0.44.0 // indirect
196196
golang.org/x/sync v0.17.0 // indirect
197197
golang.org/x/sys v0.36.0 // indirect
198+
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect
198199
golang.org/x/text v0.29.0 // indirect
199200
golang.org/x/time v0.12.0 // indirect
200-
golang.org/x/tools v0.36.0 // indirect
201+
golang.org/x/tools v0.37.0 // indirect
201202
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
202203
gonum.org/v1/gonum v0.16.0 // indirect
203-
google.golang.org/protobuf v1.36.9 // indirect
204+
google.golang.org/protobuf v1.36.10 // indirect
204205
gopkg.in/yaml.v2 v2.4.0 // indirect
205206
gopkg.in/yaml.v3 v3.0.1 // indirect
206207
lukechampine.com/blake3 v1.4.1 // indirect

0 commit comments

Comments
 (0)