Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
19ea929
feat(da): support fiber (not via c-node)
julienrbrt Apr 13, 2026
960146d
Merge branch 'main' into julien/fiber
julienrbrt Apr 13, 2026
ef44db2
wip
julienrbrt Apr 14, 2026
f96ab47
Merge branch 'main' into julien/fiber
julienrbrt Apr 14, 2026
f3356c6
reduce alloc
julienrbrt Apr 14, 2026
49c92d1
Merge branch 'main' into julien/fiber
julienrbrt Apr 14, 2026
7278685
lint
julienrbrt Apr 15, 2026
7109b0e
feat(da): add Go DA interface and in-memory mock for fibre (#3256)
walldiss Apr 15, 2026
4485d91
updates
julienrbrt Apr 15, 2026
6472139
wire fiber in testapp (poc)
julienrbrt Apr 20, 2026
03b4877
Merge branch 'main' into julien/fiber
julienrbrt Apr 22, 2026
da26572
tidy tool
julienrbrt Apr 22, 2026
04c70e7
updates
julienrbrt Apr 22, 2026
9e5b2ca
properly disable fi
julienrbrt Apr 22, 2026
c49fe6f
improve submission
julienrbrt Apr 22, 2026
e26879b
updates
julienrbrt Apr 22, 2026
7be668a
cleanup
julienrbrt Apr 22, 2026
a7b3859
feat(tools): celestia-node-backed Fibre DA adapter (#3279)
walldiss Apr 23, 2026
24ff04e
rm local fiber
julienrbrt Apr 23, 2026
a4a46e7
fix flags
julienrbrt Apr 23, 2026
a88b176
test(celestia-node-fiber): in-process Upload/Listen/Download showcase…
walldiss Apr 23, 2026
90a18b1
fix(celestia-node-fiber): report original payload size in BlobEvent (…
walldiss Apr 23, 2026
918acaf
cleanups
julienrbrt Apr 23, 2026
d24af8f
feat(celestia-node-fiber): Listen takes fromHeight for resume-from-he…
walldiss Apr 23, 2026
dabfe4a
updates
julienrbrt Apr 23, 2026
9c5ee4d
updates
julienrbrt Apr 23, 2026
f1c9cb8
fix flags
julienrbrt Apr 24, 2026
3c92481
wip test
julienrbrt Apr 24, 2026
e84142e
namespace hack
julienrbrt Apr 24, 2026
3dbc863
disable p2p when fiber enabled (for now)
julienrbrt Apr 24, 2026
e159db6
remove workers
julienrbrt Apr 24, 2026
4a23f89
flatten and split blobs for Fiber DA upload
julienrbrt Apr 24, 2026
dd8d2dc
Merge branch 'main' into julien/fiber
julienrbrt Apr 24, 2026
ece6de8
Initialize Fiber DA client with last known DA height
julienrbrt Apr 24, 2026
87573ae
fix run node wiring
julienrbrt Apr 24, 2026
275ea30
chore(celestia-node-fiber): bump celestia-node to feature/fibre-exper…
walldiss Apr 27, 2026
172e939
ev-node <-> fibre benchmarking (#3290)
Wondertan Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion apps/evm/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ var RunCmd = &cobra.Command{
}()
}

return rollcmd.StartNode(logger, cmd, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{})
// nil fiberClient: the EVM app doesn't wire Fibre DA. See
// tools/celestia-node-fiber for the adapter; testapp/cmd/run.go
// has the same TODO note for matching context.
return rollcmd.StartNode(logger, cmd, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{}, nil)
},
}

Expand Down
6 changes: 4 additions & 2 deletions apps/grpc/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ The execution client must implement the Evolve execution gRPC interface.`,
return err
}

// Start the node
return rollcmd.StartNode(logger, cmd, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{})
// Start the node. nil fiberClient: the gRPC app doesn't wire
// Fibre DA. See tools/celestia-node-fiber for the adapter;
// testapp/cmd/run.go has the same TODO note for context.
return rollcmd.StartNode(logger, cmd, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{}, nil)
},
}

Expand Down
7 changes: 6 additions & 1 deletion apps/testapp/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,12 @@ var RunCmd = &cobra.Command{
return err
}

return cmd.StartNode(logger, command, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{})
// nil fiberClient: testapp doesn't yet wire Fibre DA. To enable
// fiber support here, build a *cnfiber.Adapter from
// nodeConfig.DA.Fiber and pass it as the last argument. The
// adapter wiring lives in tools/celestia-node-fiber; see the
// fiber-bench tool's run.go for a working caller.
return cmd.StartNode(logger, command, executor, sequencer, nodeKey, datastore, nodeConfig, genesis, node.NodeOptions{}, nil)
},
}

Expand Down
20 changes: 18 additions & 2 deletions block/internal/cache/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,24 @@ const (
// DataDAIncludedPrefix is the store key prefix for data DA inclusion tracking.
DataDAIncludedPrefix = "cache/data-da-included/"

// DefaultTxCacheRetention is the default time to keep transaction hashes in cache.
DefaultTxCacheRetention = 24 * time.Hour
// DefaultTxCacheRetention is how long tx hashes stay in the
// seen-tx cache before CleanupOldTxs evicts them.
//
// HACK(fiber-throughput): dropped from 24h to 30s while we chase
// throughput, but the previous default was itself wrong: 24h is
// retention × tps in memory, so any rollup with meaningful TPS
// would OOM (we hit ~16 GB in under a minute at ~1.5M tx/s).
// What this should be properly:
// - Bounded by entry count, not wall time. The dedup window
// should be "the last N txs we saw", LRU-evicted, so cache
// memory is fixed regardless of throughput.
// - Or expressed in DA blocks: "drop hashes once their txs
// would have been retried out of the mempool", which is a
// property of mempool TTL × DA block time, not 24 hours.
// - 30s is a fine measurement default and a reasonable upper
// bound for pretty much any rollup; pick the right number
// when the cache structure itself is reworked.
DefaultTxCacheRetention = 30 * time.Second
)

// CacheManager provides thread-safe cache operations for tracking seen blocks
Expand Down
45 changes: 40 additions & 5 deletions block/internal/common/consts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,54 @@ package common

import "strconv"

// defaultMaxBlobSizeStr holds the string representation of the default blob
// size limit. Override at link time via:
// defaultMaxBlobSizeStr holds the string representation of the default
// blob size limit. Anchored to Fibre's actual cap: protocol MaxBlobSize
// (1 << 27 = 128 MiB) minus the 5-byte Fibre blob header (1 byte
// version + 4 byte data size). See celestia-app/v9/fibre/blob.go
// (blobHeaderLen) and fibre/protocol_params.go (MaxBlobSize).
//
// go build -ldflags "-X github.com/evstack/ev-node/block/internal/common.defaultMaxBlobSizeStr=125829120"
var defaultMaxBlobSizeStr = "5242880" // 5 MB
// HACK(fiber-throughput): this default is correct for fiber-enabled
// deployments but WRONG for the legacy JSON-RPC blob client path —
// the bridge / chain rejects blobs above its own (much smaller) cap,
// so a non-fiber node started against this default would fail to
// submit. The right shape is per-backend: fiber's cap is one number,
// blob-RPC's cap is another, and DefaultMaxBlobSize shouldn't be a
// single global. Restructure into config when the throughput-cleanup
// TODO lands; until then, non-fiber callers should override via
// ldflag or local config.
//
// MUST be a string literal: Go's `-ldflags "-X ..."` only takes effect
// on variables initialized to a string constant, NOT a function call.
// A previous version used strconv.FormatUint here, which compiled but
// silently ignored ldflag overrides.
//
// Override at link time via:
//
// go build -ldflags "-X github.com/evstack/ev-node/block/internal/common.defaultMaxBlobSizeStr=33554432"
var defaultMaxBlobSizeStr = "134217723" // 1 << 27 - 5 = 128 MiB - 5 B

// DefaultMaxBlobSize is the max blob size limit used for blob submission.
//
// TODO(throughput-cleanup): this single value is currently plugged in
// at two semantically different limits and the conflation has caused
// real bugs (a packed block marshals larger than its raw-tx total, so
// using MaxBlobSize as both input cap and output cap let blocks blow
// past the DA cap). Split into two:
//
// MaxBlobSize — chain-side ceiling on a marshaled DA blob
// MaxBlockTxBytes() — derived raw-tx budget = MaxBlobSize - per-block
// marshal overhead. Used by RetrieveBatch /
// FilterTxs.
//
// Once that derivation exists, drop the ad-hoc 2% reservation in
// executing/executor.go::RetrieveBatch and the duplicate cap in
// submitting/da_submitter.go::defaultRetryPolicy.
var DefaultMaxBlobSize uint64

func init() {
v, err := strconv.ParseUint(defaultMaxBlobSizeStr, 10, 64)
if err != nil || v == 0 {
DefaultMaxBlobSize = 5 * 1024 * 1024 // 5 MB fallback
DefaultMaxBlobSize = 134217723
return
}
DefaultMaxBlobSize = v
Expand Down
69 changes: 69 additions & 0 deletions block/internal/da/fiber/types.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
// Package fiber defines the Fiber DA backend interface and shared types.
//
// # Design Assumptions
//
// - The sequencer trusts the encoder to eventually confirm blob inclusion.
// Upload returns after the blob is uploaded and the PFF transaction is
// broadcast, NOT after on-chain confirmation. This keeps the sequencer's
// write path fast (~2s per 128 MB blob).
//
// - Callers are expected to batch/buffer their data into blobs sized for the
// protocol maximum (128 MiB - 5 byte header = 134,217,723 bytes).
// The interface accepts arbitrary sizes but the implementation may batch
// or reject oversized blobs.
//
// - Confirmation/finality is intentionally omitted from the initial API.
// The sequencer does not need it; the read path (Listen + Download) is
// sufficient for full nodes. A Status or Confirm RPC can be added later
// if needed without breaking existing callers.
//
// - Blob ordering is encoded in the blob data itself by the caller.
// The interface does not impose or guarantee ordering.
//
// - The interface is the same whether the encoder runs in-process or as an
// external gRPC service. For in-process use, call the mock or real
// implementation directly; for external use, connect via gRPC.
package fiber

import (
"context"
"time"
)

// BlobID uniquely identifies an uploaded blob (version byte + 32-byte commitment).
type BlobID []byte

// UploadResult is returned by Upload after the blob is accepted.
type UploadResult struct {
BlobID BlobID
ExpiresAt time.Time
}

// BlobEvent is delivered via Listen when a blob is confirmed on-chain.
type BlobEvent struct {
BlobID BlobID
Height uint64
DataSize uint64
}

// DA is the interface for interacting with the Fiber data availability layer.
type DA interface {
// Upload submits a blob under the given namespace to the DA network.
// Returns after the blob is uploaded and the payment transaction is broadcast.
// Does NOT wait for on-chain confirmation (see package doc for rationale).
Upload(ctx context.Context, namespace []byte, data []byte) (UploadResult, error)

// Download retrieves and reconstructs a blob by its ID.
// Returns the original data that was passed to Upload.
Download(ctx context.Context, blobID BlobID) ([]byte, error)

// Listen streams confirmed blob events for the given namespace,
// starting at fromHeight.
//
// fromHeight == 0 starts the stream from the current chain head; any
// positive value replays events from that block forward so a
// subscriber can resume after a restart without missing blobs (the
// DA backend is expected to block, not error, on future heights).
// The returned channel is closed when ctx is cancelled.
Listen(ctx context.Context, namespace []byte, fromHeight uint64) (<-chan BlobEvent, error)
}
Loading
Loading