Skip to content

Commit dfaed99

Browse files
committed
Merge remote-tracking branch 'origin/main' into feat/ev-node-hot-backup
2 parents c76b16d + 0dc7b27 commit dfaed99

57 files changed

Lines changed: 1393 additions & 859 deletions

Some content is hidden

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

.mockery.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,15 @@ packages:
5858
dir: ./block/internal/syncing
5959
pkgname: syncing
6060
filename: syncer_mock.go
61+
github.com/evstack/ev-node/block/internal/common:
62+
interfaces:
63+
Broadcaster:
64+
config:
65+
dir: ./block/internal/common
66+
pkgname: common
67+
filename: broadcaster_mock.go
68+
p2pHandler:
69+
config:
70+
dir: ./block/internal/syncing
71+
pkgname: syncing
72+
filename: syncer_mock.go

Dockerfile.da

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN cd da/cmd/local-da && \
88
go mod tidy -compat=1.19 && \
99
CGO_ENABLED=0 go build -o /src/local-da .
1010

11-
FROM alpine:3.22.1
11+
FROM alpine:3.22.2
1212

1313
WORKDIR /root
1414

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: 2 additions & 2 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 => ../../../
@@ -148,7 +148,7 @@ require (
148148
github.com/prometheus/common v0.66.1 // indirect
149149
github.com/prometheus/procfs v0.17.0 // indirect
150150
github.com/quic-go/qpack v0.5.1 // indirect
151-
github.com/quic-go/quic-go v0.54.0 // indirect
151+
github.com/quic-go/quic-go v0.54.1 // indirect
152152
github.com/quic-go/webtransport-go v0.9.0 // indirect
153153
github.com/rivo/uniseg v0.2.0 // indirect
154154
github.com/rs/zerolog v1.34.0 // indirect

apps/evm/single/go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV
242242
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
243243
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
244244
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
245-
github.com/julienrbrt/go-header v0.0.0-20250909151551-cb11b091bf58 h1:FBGLvgA4hfRjjYHUiiya7KkGxcHQWSpdn2dRKUEDa5k=
246-
github.com/julienrbrt/go-header v0.0.0-20250909151551-cb11b091bf58/go.mod h1:eX9iTSPthVEAlEDLux40ZT/olXPGhpxHd+mEzJeDhd0=
245+
github.com/julienrbrt/go-header v0.0.0-20251008134330-747c8c192fa8 h1:F+gOiipBxG43s+Ho+ri9T8IwumjWjp1XUon4DLWjxfQ=
246+
github.com/julienrbrt/go-header v0.0.0-20251008134330-747c8c192fa8/go.mod h1:eX9iTSPthVEAlEDLux40ZT/olXPGhpxHd+mEzJeDhd0=
247247
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
248248
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
249249
github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo=
@@ -434,8 +434,8 @@ github.com/prysmaticlabs/gohashtree v0.0.4-beta h1:H/EbCuXPeTV3lpKeXGPpEV9gsUpkq
434434
github.com/prysmaticlabs/gohashtree v0.0.4-beta/go.mod h1:BFdtALS+Ffhg3lGQIHv9HDWuHS8cTvHZzrHWxwOtGOs=
435435
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
436436
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
437-
github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
438-
github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
437+
github.com/quic-go/quic-go v0.54.1 h1:4ZAWm0AhCb6+hE+l5Q1NAL0iRn/ZrMwqHRGQiFwj2eg=
438+
github.com/quic-go/quic-go v0.54.1/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
439439
github.com/quic-go/webtransport-go v0.9.0 h1:jgys+7/wm6JarGDrW+lD/r9BGqBAmqY/ssklE09bA70=
440440
github.com/quic-go/webtransport-go v0.9.0/go.mod h1:4FUYIiUc75XSsF6HShcLeXXYZJ9AGwo/xh3L8M/P1ao=
441441
github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY=

apps/grpc/single/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ require (
120120
github.com/prometheus/common v0.66.1 // indirect
121121
github.com/prometheus/procfs v0.17.0 // indirect
122122
github.com/quic-go/qpack v0.5.1 // indirect
123-
github.com/quic-go/quic-go v0.54.0 // indirect
123+
github.com/quic-go/quic-go v0.54.1 // indirect
124124
github.com/quic-go/webtransport-go v0.9.0 // indirect
125125
github.com/rs/zerolog v1.34.0 // indirect
126126
github.com/sagikazarmark/locafero v0.11.0 // indirect

apps/grpc/single/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -354,8 +354,8 @@ github.com/prometheus/procfs v0.17.0 h1:FuLQ+05u4ZI+SS/w9+BWEM2TXiHKsUQ9TADiRH7D
354354
github.com/prometheus/procfs v0.17.0/go.mod h1:oPQLaDAMRbA+u8H5Pbfq+dl3VDAvHxMUOVhe0wYB2zw=
355355
github.com/quic-go/qpack v0.5.1 h1:giqksBPnT/HDtZ6VhtFKgoLOWmlyo9Ei6u9PqzIMbhI=
356356
github.com/quic-go/qpack v0.5.1/go.mod h1:+PC4XFrEskIVkcLzpEkbLqq1uCoxPhQuvK5rH1ZgaEg=
357-
github.com/quic-go/quic-go v0.54.0 h1:6s1YB9QotYI6Ospeiguknbp2Znb/jZYjZLRXn9kMQBg=
358-
github.com/quic-go/quic-go v0.54.0/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
357+
github.com/quic-go/quic-go v0.54.1 h1:4ZAWm0AhCb6+hE+l5Q1NAL0iRn/ZrMwqHRGQiFwj2eg=
358+
github.com/quic-go/quic-go v0.54.1/go.mod h1:e68ZEaCdyviluZmy44P6Iey98v/Wfz6HCjQEm+l8zTY=
359359
github.com/quic-go/webtransport-go v0.9.0 h1:jgys+7/wm6JarGDrW+lD/r9BGqBAmqY/ssklE09bA70=
360360
github.com/quic-go/webtransport-go v0.9.0/go.mod h1:4FUYIiUc75XSsF6HShcLeXXYZJ9AGwo/xh3L8M/P1ao=
361361
github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ=

apps/testapp/cmd/rollback.go

Lines changed: 13 additions & 18 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
kvexecutor "github.com/evstack/ev-node/apps/testapp/kv"
@@ -19,9 +20,8 @@ import (
1920
// NewRollbackCmd creates a command to rollback ev-node state by one height.
2021
func NewRollbackCmd() *cobra.Command {
2122
var (
22-
height uint64
23-
skipP2PStores bool
24-
syncNode bool
23+
height uint64
24+
syncNode bool
2525
)
2626

2727
cmd := &cobra.Command{
@@ -75,10 +75,6 @@ func NewRollbackCmd() *cobra.Command {
7575
return fmt.Errorf("failed to rollback ev-node state: %w", err)
7676
}
7777

78-
if skipP2PStores {
79-
return printSuccess(height)
80-
}
81-
8278
// rollback ev-node goheader state
8379
headerStore, err := goheaderstore.NewStore[*types.SignedHeader](
8480
evolveDB,
@@ -108,31 +104,30 @@ func NewRollbackCmd() *cobra.Command {
108104
}
109105
defer dataStore.Stop(goCtx)
110106

107+
var errs error
111108
if err := headerStore.DeleteRange(goCtx, height+1, headerStore.Height()); err != nil {
112-
return fmt.Errorf("failed to rollback header sync service state: %w", err)
109+
errs = errors.Join(errs, fmt.Errorf("failed to rollback header sync service state: %w", err))
113110
}
114111

115112
if err := dataStore.DeleteRange(goCtx, height+1, dataStore.Height()); err != nil {
116-
return fmt.Errorf("failed to rollback data sync service state: %w", err)
113+
errs = errors.Join(errs, fmt.Errorf("failed to rollback data sync service state: %w", err))
117114
}
118115

119116
// rollback execution store
120117
if err := executor.Rollback(goCtx, height); err != nil {
121-
return fmt.Errorf("rollback failed: %w", err)
118+
errs = errors.Join(errs, fmt.Errorf("rollback failed: %w", err))
119+
}
120+
121+
fmt.Printf("Rolled back ev-node state to height %d\n", height)
122+
if syncNode {
123+
fmt.Println("Restart the node with the `--clear-cache` flag")
122124
}
123125

124-
return printSuccess(height)
126+
return errs
125127
},
126128
}
127129

128130
cmd.Flags().Uint64Var(&height, "height", 0, "rollback to a specific height")
129131
cmd.Flags().BoolVar(&syncNode, "sync-node", false, "sync node (no aggregator)")
130-
cmd.Flags().BoolVar(&skipP2PStores, "skip-p2p-stores", false, "skip rollback p2p stores (goheaderstore)")
131132
return cmd
132133
}
133-
134-
func printSuccess(height uint64) error {
135-
fmt.Printf("Rolled back ev-node state to height %d\n", height)
136-
fmt.Println("Restart the node with the `--clear-cache` flag")
137-
return nil
138-
}

apps/testapp/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/evstack/ev-node/apps/testapp
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 => ../../.
@@ -128,7 +128,7 @@ require (
128128
github.com/prometheus/common v0.66.1 // indirect
129129
github.com/prometheus/procfs v0.17.0 // indirect
130130
github.com/quic-go/qpack v0.5.1 // indirect
131-
github.com/quic-go/quic-go v0.54.0 // indirect
131+
github.com/quic-go/quic-go v0.54.1 // indirect
132132
github.com/quic-go/webtransport-go v0.9.0 // indirect
133133
github.com/rs/zerolog v1.34.0 // indirect
134134
github.com/sagikazarmark/locafero v0.11.0 // indirect

0 commit comments

Comments
 (0)