Skip to content

Commit ef506d5

Browse files
authored
Merge branch 'main' into marko/2392
2 parents 326a401 + ab8f8b0 commit ef506d5

11 files changed

Lines changed: 65 additions & 26 deletions

File tree

.github/workflows/semantic-pull-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ jobs:
1515
name: conventional-commit-pr-title
1616
runs-on: ubuntu-latest
1717
steps:
18-
- uses: amannn/action-semantic-pull-request@v5
18+
- uses: amannn/action-semantic-pull-request@v6
1919
env:
2020
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ docs/.vitepress/cache
2727
.temp
2828
.vite_opt_cache
2929
.vscode
30+
.claude

apps/evm/single/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ require (
8484
github.com/docker/cli-docs-tool v0.9.0 // indirect
8585
github.com/docker/compose/v2 v2.35.0 // indirect
8686
github.com/docker/distribution v2.8.3+incompatible // indirect
87-
github.com/docker/docker v28.2.2+incompatible // indirect
87+
github.com/docker/docker v28.3.3+incompatible // indirect
8888
github.com/docker/docker-credential-helpers v0.8.2 // indirect
8989
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c // indirect
9090
github.com/docker/go-connections v0.5.0 // indirect

apps/evm/single/go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ github.com/docker/compose/v2 v2.35.0/go.mod h1:S5ejUILn9KTYC6noX3IxznWu3/sb3FxdZ
216216
github.com/docker/distribution v2.7.1+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
217217
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
218218
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
219-
github.com/docker/docker v28.2.2+incompatible h1:CjwRSksz8Yo4+RmQ339Dp/D2tGO5JxwYeqtMOEe0LDw=
220-
github.com/docker/docker v28.2.2+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
219+
github.com/docker/docker v28.3.3+incompatible h1:Dypm25kh4rmk49v1eiVbsAtpAsYURjYkaKubwuBdxEI=
220+
github.com/docker/docker v28.3.3+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
221221
github.com/docker/docker-credential-helpers v0.8.2 h1:bX3YxiGzFP5sOXWc3bTPEXdEaZSeVMrFgOr3T+zrFAo=
222222
github.com/docker/docker-credential-helpers v0.8.2/go.mod h1:P3ci7E3lwkZg6XiHdRKft1KckHiO9a2rNtyFbZ/ry9M=
223223
github.com/docker/go v1.5.1-1.0.20160303222718-d30aec9fd63c h1:lzqkGL9b3znc+ZUgi7FlLnqjQhcXxkNM/quxIjBVMD0=

block/sync.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,17 @@ func (m *Manager) trySyncNextBlock(ctx context.Context, daHeight uint64) error {
149149
// set the custom verifier to ensure proper signature validation
150150
h.SetCustomVerifier(m.signaturePayloadProvider)
151151

152-
// validate the received block before applying
153-
if err := m.Validate(ctx, h, d); err != nil {
154-
return fmt.Errorf("failed to validate block: %w", err)
155-
}
156-
157152
newState, err := m.applyBlock(ctx, h.Header, d)
158153
if err != nil {
159154
return fmt.Errorf("failed to apply block: %w", err)
160155
}
161156

157+
// validate the received block after applying
158+
// a custom verification function can depend on the state of the blockchain
159+
if err := m.Validate(ctx, h, d); err != nil {
160+
return fmt.Errorf("failed to validate block: %w", err)
161+
}
162+
162163
if err = m.updateState(ctx, newState); err != nil {
163164
return fmt.Errorf("failed to save updated state: %w", err)
164165
}

node/full_node_integration_test.go

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,16 @@ func TestTxGossipingMultipleNodesNoDA(t *testing.T) {
3939
// Verify block manager is properly initialized
4040
require.NotNil(nodes[0].blockManager, "Block manager should be initialized")
4141

42+
// Add a small delay to ensure P2P services are fully ready
43+
time.Sleep(500 * time.Millisecond)
44+
4245
// Start the other nodes
4346
for i := 1; i < numNodes; i++ {
4447
startNodeInBackground(t, nodes, ctxs, &runningWg, i)
48+
// Add a small delay between starting nodes to avoid connection race
49+
if i < numNodes-1 {
50+
time.Sleep(100 * time.Millisecond)
51+
}
4552
}
4653

4754
// Inject a transaction into the sequencer's executor
@@ -88,9 +95,16 @@ func TestTxGossipingMultipleNodesDAIncluded(t *testing.T) {
8895
// Verify block manager is properly initialized
8996
require.NotNil(nodes[0].blockManager, "Block manager should be initialized")
9097

98+
// Add a small delay to ensure P2P services are fully ready
99+
time.Sleep(500 * time.Millisecond)
100+
91101
// Start the other nodes
92102
for i := 1; i < numNodes; i++ {
93103
startNodeInBackground(t, nodes, ctxs, &runningWg, i)
104+
// Add a small delay between starting nodes to avoid connection race
105+
if i < numNodes-1 {
106+
time.Sleep(100 * time.Millisecond)
107+
}
94108
}
95109

96110
// Inject a transaction into the sequencer's executor
@@ -142,6 +156,9 @@ func TestFastDASync(t *testing.T) {
142156
blocksToWaitFor := uint64(2)
143157
require.NoError(waitForAtLeastNDAIncludedHeight(nodes[0], blocksToWaitFor))
144158

159+
// Add a small delay to ensure P2P services are fully ready
160+
time.Sleep(500 * time.Millisecond)
161+
145162
// Now start the second node and time its sync
146163
startNodeInBackground(t, nodes, ctxs, &runningWg, 1)
147164
start := time.Now()
@@ -186,9 +203,16 @@ func TestSingleSequencerTwoFullNodesBlockSyncSpeed(t *testing.T) {
186203
// Wait for the sequencer to produce at first block
187204
require.NoError(waitForFirstBlock(nodes[0], Store))
188205

206+
// Add a small delay to ensure P2P services are fully ready
207+
time.Sleep(500 * time.Millisecond)
208+
189209
// Now start the other nodes
190210
for i := 1; i < numNodes; i++ {
191211
startNodeInBackground(t, nodes, ctxs, &runningWg, i)
212+
// Add a small delay between starting nodes to avoid connection race
213+
if i < numNodes-1 {
214+
time.Sleep(100 * time.Millisecond)
215+
}
192216
}
193217

194218
blocksToWaitFor := uint64(10)
@@ -274,6 +298,9 @@ func testSingleSequencerSingleFullNode(t *testing.T, source Source) {
274298
// Wait for the sequencer to produce at first block
275299
require.NoError(waitForFirstBlock(nodes[0], source))
276300

301+
// Add a small delay to ensure P2P services are fully ready
302+
time.Sleep(500 * time.Millisecond)
303+
277304
// Start the full node
278305
startNodeInBackground(t, nodes, ctxs, &runningWg, 1)
279306

@@ -312,9 +339,16 @@ func testSingleSequencerTwoFullNodes(t *testing.T, source Source) {
312339
// Wait for the sequencer to produce at first block
313340
require.NoError(waitForFirstBlock(nodes[0], source))
314341

342+
// Add a small delay to ensure P2P services are fully ready
343+
time.Sleep(500 * time.Millisecond)
344+
315345
// Start the full nodes
316346
for i := 1; i < numNodes; i++ {
317347
startNodeInBackground(t, nodes, ctxs, &runningWg, i)
348+
// Add a small delay between starting nodes to avoid connection race
349+
if i < numNodes-1 {
350+
time.Sleep(100 * time.Millisecond)
351+
}
318352
}
319353

320354
blocksToWaitFor := uint64(3)
@@ -372,6 +406,9 @@ func testSingleSequencerSingleFullNodeTrustedHash(t *testing.T, source Source) {
372406
// Set the trusted hash in the full node
373407
nodes[1].nodeConfig.Node.TrustedHash = trustedHash
374408

409+
// Add a small delay to ensure P2P services are fully ready
410+
time.Sleep(500 * time.Millisecond)
411+
375412
// Start the full node
376413
startNodeInBackground(t, nodes, ctxs, &runningWg, 1)
377414

node/single_sequencer_integration_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func (s *FullNodeTestSuite) TearDownTest() {
109109
select {
110110
case <-waitCh:
111111
// Node stopped successfully
112-
case <-time.After(5 * time.Second):
112+
case <-time.After(10 * time.Second):
113113
s.T().Log("Warning: Node did not stop gracefully within timeout")
114114
}
115115

@@ -243,7 +243,7 @@ func TestStateRecovery(t *testing.T) {
243243
select {
244244
case <-waitCh:
245245
// Node stopped successfully
246-
case <-time.After(2 * time.Second):
246+
case <-time.After(30 * time.Second):
247247
t.Fatalf("Node did not stop gracefully within timeout")
248248
}
249249

@@ -288,7 +288,7 @@ func TestMaxPendingHeadersAndData(t *testing.T) {
288288
require.LessOrEqual(height, config.Node.MaxPendingHeadersAndData)
289289

290290
// Stop the node and wait for shutdown
291-
shutdownAndWait(t, []context.CancelFunc{cancel}, &runningWg, 5*time.Second)
291+
shutdownAndWait(t, []context.CancelFunc{cancel}, &runningWg, 10*time.Second)
292292
}
293293

294294
// TestBatchQueueThrottlingWithDAFailure tests that when DA layer fails and MaxPendingHeadersAndData
@@ -400,5 +400,5 @@ func TestBatchQueueThrottlingWithDAFailure(t *testing.T) {
400400
t.Log("the batch queue would fill up and return ErrQueueFull, providing backpressure.")
401401

402402
// Shutdown
403-
shutdownAndWait(t, []context.CancelFunc{cancel}, &runningWg, 5*time.Second)
403+
shutdownAndWait(t, []context.CancelFunc{cancel}, &runningWg, 10*time.Second)
404404
}

node/single_sequencer_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestStartup(t *testing.T) {
2626
}()
2727

2828
// Allow some time for the node to start
29-
time.Sleep(100 * time.Millisecond)
29+
time.Sleep(500 * time.Millisecond)
3030

3131
// Node should be running (no error received yet)
3232
select {
@@ -44,7 +44,7 @@ func TestStartup(t *testing.T) {
4444
case err := <-errChan:
4545
// Context cancellation should result in context.Canceled error
4646
require.ErrorIs(t, err, context.Canceled)
47-
case <-time.After(500 * time.Millisecond):
47+
case <-time.After(2 * time.Second):
4848
t.Fatal("Node did not stop after context cancellation")
4949
}
5050

test/docker-e2e/docker_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func (s *DockerTestSuite) CreateDockerProvider(opts ...ConfigOption) tastoratype
6666
numValidators := 1
6767
numFullNodes := 0
6868
client, network := tastoradocker.DockerSetup(t)
69-
69+
7070
// Store client and network ID in the suite for later use
7171
s.dockerClient = client
7272
s.dockerNetworkID = network
@@ -76,11 +76,11 @@ func (s *DockerTestSuite) CreateDockerProvider(opts ...ConfigOption) tastoratype
7676
DockerClient: client,
7777
DockerNetworkID: network,
7878
ChainConfig: &tastoradocker.ChainConfig{
79-
Name: "celestia",
80-
NumValidators: &numValidators,
81-
NumFullNodes: &numFullNodes,
82-
ChainID: testChainID,
83-
Image: container.NewImage("ghcr.io/celestiaorg/celestia-app", "v4.0.0-rc6", "10001:10001"),
79+
Name: "celestia",
80+
NumValidators: &numValidators,
81+
NumFullNodes: &numFullNodes,
82+
ChainID: testChainID,
83+
Image: container.NewImage("ghcr.io/celestiaorg/celestia-app", "v4.0.0-rc6", "10001:10001"),
8484
Bin: "celestia-appd",
8585
Bech32Prefix: "celestia",
8686
Denom: "utia",
@@ -99,7 +99,7 @@ func (s *DockerTestSuite) CreateDockerProvider(opts ...ConfigOption) tastoratype
9999
},
100100
DataAvailabilityNetworkConfig: &tastoradocker.DataAvailabilityNetworkConfig{
101101
BridgeNodeCount: 1,
102-
Image: container.NewImage("ghcr.io/celestiaorg/celestia-node", "pr-4283", "10001:10001"),
102+
Image: container.NewImage("ghcr.io/celestiaorg/celestia-node", "pr-4283", "10001:10001"),
103103
},
104104
RollkitChainConfig: &tastoradocker.RollkitChainConfig{
105105
ChainID: "rollkit-test",
@@ -170,7 +170,7 @@ func (s *DockerTestSuite) CreateChain() tastoratypes.Chain {
170170
WithDockerClient(s.dockerClient).
171171
WithDockerNetworkID(s.dockerNetworkID).
172172
WithNode(tastoradocker.NewChainNodeConfigBuilder().
173-
WithNodeType(tastoradocker.ValidatorNodeType).
173+
WithNodeType(tastoratypes.NodeTypeValidator).
174174
Build()).
175175
Build(ctx)
176176

test/docker-e2e/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/evstack/ev-node/test/docker-e2e
22

33
go 1.24.2
44

5-
require github.com/celestiaorg/tastora v0.2.2
5+
require github.com/celestiaorg/tastora v0.2.3
66

77
require (
88
cosmossdk.io/x/upgrade v0.1.4 // indirect

0 commit comments

Comments
 (0)