pub struct InlineFallbackBackend { /* private fields */ }Expand description
Default backend used when no external DA layer (EigenDA / Celestia / Avail)
is configured. Stores submitted payloads in an in-memory DashMap keyed by
a synthetic locator fallback:<sha256_hex> and round-trips them through
fetch. This keeps the receipt-offload path functional pre-mainnet so the
rest of the system (commitments, indices, RPC) can be exercised end-to-end
without standing up a real DA layer.
Optionally takes a crate::kv::KvStore handle (with_storage) so the
fallback DashMap is backed by CF_METADATA under the da_fallback:
prefix. Without storage the cache is in-process only and submissions do
not survive a restart — fine for tests and unit work, not fine for
any persisted receipt that needs to round-trip through fetch after a
process restart. Node startup and RocksDbChannelStorage wire in the
shared RocksDbStore so consensus-relevant offloaded payloads survive
restarts even before EigenDA / Celestia / Avail land.
Operators see inline_fallback in tenzro_getDaBackends and know external
availability is not guaranteed (no signed attestations, no cross-node
replication). Production deployments swap this out for a real backend
behind the matching feature flag.
Implementations§
Source§impl InlineFallbackBackend
impl InlineFallbackBackend
pub fn new() -> Self
Sourcepub fn with_storage(self, storage: Arc<dyn KvStore>) -> Self
pub fn with_storage(self, storage: Arc<dyn KvStore>) -> Self
Wire a durable KvStore so submitted payloads survive process
restarts under CF_METADATA / da_fallback:<locator>.
pub fn arc() -> Arc<dyn DaBackend>
Sourcepub fn submit_sync(&self, namespace: &[u8], payload: &[u8]) -> DaPointer
pub fn submit_sync(&self, namespace: &[u8], payload: &[u8]) -> DaPointer
Synchronous submit helper for callers in non-async contexts.
Mirrors DaBackend::submit but without the async wrapper — the
inline fallback does pure in-memory work, so there is nothing to
suspend on. Used by sync persistence paths (channel storage, etc.)
that wrap their payloads in a ReceiptEnvelope without taking a
&dyn DaBackend dependency.
When backed by a crate::kv::KvStore (via with_storage) the
payload is also mirror-written under CF_METADATA /
da_fallback:<locator> for cross-restart durability. Storage write
failures are downgraded to a tracing::warn — the in-memory cache
is still populated, so the same-process round-trip stays
functional.
Sourcepub fn fetch_sync(&self, pointer: &DaPointer) -> Result<Vec<u8>>
pub fn fetch_sync(&self, pointer: &DaPointer) -> Result<Vec<u8>>
Synchronous fetch helper. See Self::submit_sync.
Looks up the in-memory cache first; on miss, falls back to the
configured KvStore (re-populating the cache on hit) so submissions
from a previous process incarnation are still resolvable.