Skip to content

Commit 56b5321

Browse files
authored
Merge branch 'main' into julien/go-header-clean
2 parents f74fcda + c2afe0c commit 56b5321

28 files changed

+1346
-304
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [Unreleased]
1111

12+
## v1.0.0-rc.3
13+
1214
### Added
1315

1416
- Add DA Hints for P2P transactions. This allows a catching up node to be on sync with both DA and P2P. ([#2891](https://github.com/evstack/ev-node/pull/2891))
@@ -17,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1719

1820
- Improve `cache.NumPendingData` to not return empty data. Automatically bumps `LastSubmittedHeight` to reflect that. ([#3046](https://github.com/evstack/ev-node/pull/3046))
1921
- **BREAKING** Make pending events cache and tx cache fully ephemeral. Those will be re-fetched on restart. DA Inclusion cache persists until cleared up after DA inclusion has been processed. Persist accross restart using store metadata. ([#3047](https://github.com/evstack/ev-node/pull/3047))
22+
- Replace LRU cache by standard mem cache with manual eviction in `store_adapter`. When P2P blocks were fetched too fast, they would be evicted before being executed [#3051](https://github.com/evstack/ev-node/pull/3051)
23+
- Fix replay logic leading to app hashes by verifying against the wrong block [#3053](https://github.com/evstack/ev-node/pull/3053).
2024

2125
## v1.0.0-rc.2
2226

@@ -25,12 +29,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2529
- Improve cache handling when there is a significant backlog of pending headers and data. ([#3030](https://github.com/evstack/ev-node/pull/3030))
2630
- Decrease MaxBytesSize to `5MB` to increase compatibility with public nodes. ([#3030](https://github.com/evstack/ev-node/pull/3030))
2731
- Proper counting of `DASubmitterPendingBlobs` metrics. [#3038](https://github.com/evstack/ev-node/pull/3038)
28-
- Replace `go-header` store by `ev-node` store. This avoid duplication of all blocks in `go-header` and `ev-node` store. Thanks to the cached store from #3030, this should improve p2p performance as well.
32+
- Replace `go-header` store by `ev-node` store. This avoid duplication of all blocks in `go-header` and `ev-node` store. Thanks to the cached store from #3030, this should improve p2p performance as well. [#3036](https://github.com/evstack/ev-node/pull/3036)
2933

3034
## v1.0.0-rc.1
3135

3236
### Added
3337

38+
- Added OpenTelemetry tracing support with OTLP export for distributed tracing across ev-node components including block production, syncing, DA submission/retrieval, sequencer, store operations, and RPC layer. Configurable via `instrumentation.tracing`, `instrumentation.tracing_endpoint`, `instrumentation.tracing_service_name`, and `instrumentation.tracing_sample_rate` settings. ([#2956](https://github.com/evstack/ev-node/issues/2956))
3439
- **BREAKING:** Implement forced inclusion and batch sequencing ([#2797](https://github.com/evstack/ev-node/pull/2797))
3540
**This change requires adding a `da_epoch_forced_inclusion` field to the node's `genesis.json` file.** The recommended value is `100`.
3641
Full support for this feature will be available in a future release.

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/evm/go.mod

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

33
go 1.25.6
44

5-
replace (
6-
github.com/evstack/ev-node => ../../
7-
github.com/evstack/ev-node/execution/evm => ../../execution/evm
8-
)
5+
//replace (
6+
// github.com/evstack/ev-node => ../../
7+
// github.com/evstack/ev-node/execution/evm => ../../execution/evm
8+
//)
99

1010
require (
1111
github.com/ethereum/go-ethereum v1.16.8
12-
github.com/evstack/ev-node v1.0.0-rc.2
12+
github.com/evstack/ev-node v1.0.0-rc.3
1313
github.com/evstack/ev-node/core v1.0.0-rc.1
1414
github.com/evstack/ev-node/execution/evm v1.0.0-rc.2
1515
github.com/ipfs/go-datastore v0.9.0

apps/evm/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,12 @@ github.com/ethereum/go-ethereum v1.16.8 h1:LLLfkZWijhR5m6yrAXbdlTeXoqontH+Ga2f9i
411411
github.com/ethereum/go-ethereum v1.16.8/go.mod h1:Fs6QebQbavneQTYcA39PEKv2+zIjX7rPUZ14DER46wk=
412412
github.com/ethereum/go-verkle v0.2.2 h1:I2W0WjnrFUIzzVPwm8ykY+7pL2d4VhlsePn4j7cnFk8=
413413
github.com/ethereum/go-verkle v0.2.2/go.mod h1:M3b90YRnzqKyyzBEWJGqj8Qff4IDeXnzFw0P9bFw3uk=
414+
github.com/evstack/ev-node v1.0.0-rc.3 h1:hphJBI0b1TgGN9wajB1twouMVMjhyHXXrS9QaG1XwvQ=
415+
github.com/evstack/ev-node v1.0.0-rc.3/go.mod h1:5Cf3SauhgIV+seQKBJavv3f8ZZw+YTnH5DRJcI4Ooj0=
414416
github.com/evstack/ev-node/core v1.0.0-rc.1 h1:Dic2PMUMAYUl5JW6DkDj6HXDEWYzorVJQuuUJOV0FjE=
415417
github.com/evstack/ev-node/core v1.0.0-rc.1/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
418+
github.com/evstack/ev-node/execution/evm v1.0.0-rc.2 h1:t7os7ksmPhf2rWY2psVBowyc+iuneMDPwBGQaxSckus=
419+
github.com/evstack/ev-node/execution/evm v1.0.0-rc.2/go.mod h1:ahxKQfPlJ5C7g15Eq9Mjn2tQnn59T0kIm9B10zDhcTI=
416420
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
417421
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
418422
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=

apps/grpc/go.mod

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ module github.com/evstack/ev-node/apps/grpc
22

33
go 1.25.6
44

5-
replace (
6-
github.com/evstack/ev-node => ../../
7-
github.com/evstack/ev-node/execution/grpc => ../../execution/grpc
8-
)
5+
//replace (
6+
// github.com/evstack/ev-node => ../../
7+
// github.com/evstack/ev-node/execution/grpc => ../../execution/grpc
8+
//)
99

1010
require (
11-
github.com/evstack/ev-node v1.0.0-rc.2
11+
github.com/evstack/ev-node v1.0.0-rc.3
1212
github.com/evstack/ev-node/core v1.0.0-rc.1
1313
github.com/evstack/ev-node/execution/grpc v1.0.0-rc.1
1414
github.com/ipfs/go-datastore v0.9.0

apps/grpc/go.sum

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,12 @@ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6Ni
367367
github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
368368
github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs=
369369
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
370+
github.com/evstack/ev-node v1.0.0-rc.3 h1:hphJBI0b1TgGN9wajB1twouMVMjhyHXXrS9QaG1XwvQ=
371+
github.com/evstack/ev-node v1.0.0-rc.3/go.mod h1:5Cf3SauhgIV+seQKBJavv3f8ZZw+YTnH5DRJcI4Ooj0=
370372
github.com/evstack/ev-node/core v1.0.0-rc.1 h1:Dic2PMUMAYUl5JW6DkDj6HXDEWYzorVJQuuUJOV0FjE=
371373
github.com/evstack/ev-node/core v1.0.0-rc.1/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
374+
github.com/evstack/ev-node/execution/grpc v1.0.0-rc.1 h1:OzrWLDDY6/9+LWx0XmUqPzxs/CHZRJICOwQ0Me/i6dY=
375+
github.com/evstack/ev-node/execution/grpc v1.0.0-rc.1/go.mod h1:Pr/sF6Zx8am9ZeWFcoz1jYPs0kXmf+OmL8Tz2Gyq7E4=
372376
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
373377
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
374378
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=

apps/testapp/go.mod

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@ module github.com/evstack/ev-node/apps/testapp
22

33
go 1.25.6
44

5+
//replace (
6+
// github.com/evstack/ev-node => ../../
7+
//)
8+
59
require (
6-
github.com/evstack/ev-node v1.0.0-rc.2
10+
github.com/evstack/ev-node v1.0.0-rc.3
711
github.com/evstack/ev-node/core v1.0.0-rc.1
812
github.com/ipfs/go-datastore v0.9.0
913
github.com/rs/zerolog v1.34.0

apps/testapp/go.sum

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ github.com/envoyproxy/protoc-gen-validate v0.10.0/go.mod h1:DRjgyB0I43LtJapqN6Ni
367367
github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss=
368368
github.com/envoyproxy/protoc-gen-validate v1.0.1/go.mod h1:0vj8bNkYbSTNS2PIyH87KZaeN4x9zpL9Qt8fQC7d+vs=
369369
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
370-
github.com/evstack/ev-node v1.0.0-rc.2 h1:gUQzLTkCj6D751exm/FIR/yw2aXWiW2aEREEwtxMvw0=
371-
github.com/evstack/ev-node v1.0.0-rc.2/go.mod h1:Qa2nN1D6PJQRU2tiarv6X5Der5OZg/+2QGY/K2mA760=
370+
github.com/evstack/ev-node v1.0.0-rc.3 h1:hphJBI0b1TgGN9wajB1twouMVMjhyHXXrS9QaG1XwvQ=
371+
github.com/evstack/ev-node v1.0.0-rc.3/go.mod h1:5Cf3SauhgIV+seQKBJavv3f8ZZw+YTnH5DRJcI4Ooj0=
372372
github.com/evstack/ev-node/core v1.0.0-rc.1 h1:Dic2PMUMAYUl5JW6DkDj6HXDEWYzorVJQuuUJOV0FjE=
373373
github.com/evstack/ev-node/core v1.0.0-rc.1/go.mod h1:n2w/LhYQTPsi48m6lMj16YiIqsaQw6gxwjyJvR+B3sY=
374374
github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM=
@@ -586,8 +586,9 @@ github.com/hashicorp/go-msgpack v0.5.5/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iP
586586
github.com/hashicorp/go-msgpack/v2 v2.1.2 h1:4Ee8FTp834e+ewB71RDrQ0VKpyFdrKOjvYtnQ/ltVj0=
587587
github.com/hashicorp/go-msgpack/v2 v2.1.2/go.mod h1:upybraOAblm4S7rx0+jeNy+CWWhzywQsSRV5033mMu4=
588588
github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs=
589-
github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM=
590589
github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
590+
github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE=
591+
github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro=
591592
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
592593
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
593594
github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c=

block/internal/cache/generic_cache.go

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import (
44
"context"
55
"encoding/binary"
66
"fmt"
7+
"strings"
78
"sync"
89

910
"sync/atomic"
1011

1112
lru "github.com/hashicorp/golang-lru/v2"
13+
"github.com/rs/zerolog/log"
1214

1315
"github.com/evstack/ev-node/pkg/store"
1416
)
@@ -215,32 +217,40 @@ func (c *Cache[T]) deleteAllForHeight(height uint64) {
215217

216218
// RestoreFromStore loads DA inclusion data from the store into the in-memory cache.
217219
// This should be called during initialization to restore persisted state.
218-
// It iterates through store metadata keys with the cache's prefix and populates the LRU cache.
219-
func (c *Cache[T]) RestoreFromStore(ctx context.Context, hashes []string) error {
220-
if c.store == nil {
221-
return nil // No store configured, nothing to restore
220+
// It directly queries store metadata keys with the cache's prefix, avoiding iteration through all blocks.
221+
func (c *Cache[T]) RestoreFromStore(ctx context.Context) error {
222+
if c.store == nil || c.storeKeyPrefix == "" {
223+
return nil // No store configured or no prefix, nothing to restore
222224
}
223225

224-
for _, hash := range hashes {
225-
value, err := c.store.GetMetadata(ctx, c.storeKey(hash))
226-
if err != nil {
227-
// Key not found is not an error - the hash may not have been DA included yet
226+
// Query all metadata entries with our prefix directly
227+
entries, err := c.store.GetMetadataByPrefix(ctx, c.storeKeyPrefix)
228+
if err != nil {
229+
return fmt.Errorf("failed to query metadata by prefix %q: %w", c.storeKeyPrefix, err)
230+
}
231+
232+
for _, entry := range entries {
233+
// Extract the hash from the key by removing the prefix
234+
hash := strings.TrimPrefix(entry.Key, c.storeKeyPrefix)
235+
if hash == entry.Key || hash == "" {
236+
// Prefix not found or empty hash - skip invalid entry
228237
continue
229238
}
230239

231-
daHeight, blockHeight, ok := decodeDAInclusion(value)
240+
daHeight, blockHeight, ok := decodeDAInclusion(entry.Value)
232241
if !ok {
233-
continue // Invalid data, skip
242+
log.Warn().
243+
Str("key", entry.Key).
244+
Int("value_len", len(entry.Value)).
245+
Msg("skipping invalid DA inclusion entry during cache restore")
246+
continue
234247
}
235248

236249
c.daIncluded.Add(hash, daHeight)
237250
c.hashByHeight.Add(blockHeight, hash)
238251

239252
// Update max DA height
240-
current := c.maxDAHeight.Load()
241-
if daHeight > current {
242-
c.maxDAHeight.Store(daHeight)
243-
}
253+
c.setMaxDAHeight(daHeight)
244254
}
245255

246256
return nil

block/internal/cache/generic_cache_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ func TestCache_MaxDAHeight_WithStore(t *testing.T) {
6767
// Create new cache and restore from store
6868
c2 := NewCache[testItem](st, "test/da-included/")
6969

70-
// Restore with the known hashes
71-
err = c2.RestoreFromStore(ctx, []string{"hash1", "hash2", "hash3"})
70+
err = c2.RestoreFromStore(ctx)
7271
require.NoError(t, err)
7372

7473
if got := c2.daHeight(); got != 200 {
@@ -106,7 +105,7 @@ func TestCache_WithStorePersistence(t *testing.T) {
106105
// Create new cache with same store and restore
107106
c2 := NewCache[testItem](st, "test/")
108107

109-
err = c2.RestoreFromStore(ctx, []string{"hash1", "hash2", "hash3"})
108+
err = c2.RestoreFromStore(ctx)
110109
require.NoError(t, err)
111110

112111
// hash1 and hash2 should be restored, hash3 should not exist
@@ -263,7 +262,7 @@ func TestCache_SaveToStore(t *testing.T) {
263262
// Verify data is in store by creating new cache and restoring
264263
c2 := NewCache[testItem](st, "save-test/")
265264

266-
err = c2.RestoreFromStore(ctx, []string{"hash1", "hash2"})
265+
err = c2.RestoreFromStore(ctx)
267266
require.NoError(t, err)
268267

269268
daHeight, ok := c2.getDAIncluded("hash1")

0 commit comments

Comments
 (0)