Auto-detect blockchain block time from RPC endpoint
I maintainer di solito rispondono entro 2 giorni
@sbackend123 ci sta già lavorando.
Dal 2/9/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Summary
Automatically detect and calculate the average block time from the blockchain RPC endpoint instead of requiring manual configuration via the --block-time flag. When a node connects to an RPC endpoint, it would sample recent block timestamps (e.g., last 1000 blocks) to determine the actual average block time of the connected chain, eliminating the need for operators to manually configure this parameter when deploying across different EVM chains with varying block times.
Motivation
Problem: The --block-time flag currently defaults to 5 seconds (configured for Gnosis Chain). When operators deploy Bee nodes on different EVM chains or testnets with different block times, they must manually configure this parameter. Incorrect block time configuration causes timing issues in the storage incentives redistribution game, potentially causing nodes to miss commit/reveal/claim phase windows.
Use cases:
- Multi-chain deployment: Different EVM chains have different block times (Gnosis ~5s, Sepolia ~12s). Auto-detection eliminates configuration errors.
- Network upgrades: If the underlying blockchain changes its block time due to consensus upgrades, nodes adapt automatically without reconfiguration.
- Testnet/mainnet parity: Developers can use the same configuration across environments with different block characteristics.
- Reduced operator burden: One less parameter to configure and maintain across deployments.
Implementation
Approach:
When --blockchain-rpc-endpoint is provided and chain backend is enabled:
- Calculate average block time by sampling recent blocks:
currentBlock := backend.BlockNumber(ctx) pastBlock := currentBlock - 1000 currentHeader := backend.HeaderByNumber(ctx, big.NewInt(currentBlock)) pastHeader := backend.HeaderByNumber(ctx, big.NewInt(pastBlock)) avgBlockTime := time.Duration((currentHeader.Time - pastHeader.Time) / 1000) * time.Second - Update strategy: Calculate once on startup and log the detected value. Optionally support periodic recalculation (configurable interval).
- Fallback hierarchy:
- Auto-detected from RPC (priority)
- Manual --block-time flag (fallback/override)
- Default 5 seconds (last resort)
- Preserve --block-time flag for:
- Ultra-Light nodes (without RPC endpoint)
- Manual override capability
- Backwards compatibility
Note: For ultra-light nodes (without RPC), verify if block-time is actually required.
Drawbacks
- Additional RPC calls on startup: Requires 2 extra RPC calls (BlockNumber and HeaderByNumber) to calculate block time.
- Network variability: Short-term network issues or anomalies could affect the calculation. Mitigated by using a large sample size (1000 blocks provides stable average over ~1.4 hours on Gnosis).
- Breaking changes for misconfigured nodes: Nodes currently running with incorrect --block-time values would suddenly behave differently. Mitigation: log both detected and configured values, allow override via flag.
- Complexity: Adds logic and state management for block time detection and updates, increasing code complexity slightly.
- Lingua principale
- Go
- Stelle
- 1.5k
- Fork
- 390
- Merge medio
- 2g 11h
- PR unite (30g)
- 23
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ethersphere/bee
-
Chequebook deployment uses a fixed 175,000 gas limit; it needs about 630,000 under Glamsterdam (live on Sepolia since 2026-10-06)Forse già presa @sbackend123 l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
ethersphere/bee#5650 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Add a transaction inbox for outbound chain transactionsForse già presa @sbackend123 l’ha presa 1 giorno fa. Apertaseen
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
ethersphere/bee#5660 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
ethersphere/bee#5659 ·
I maintainer di solito rispondono entro 2 giorni
-
accepted seen
Difficoltà 4/5 3-5 giorni Idoneità per principianti 40/100
ethersphere/bee#5648 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
pusher: chunksWorker deadlocks on a deferred chunk that fails IdentityAddress (send on nil op.Err), halting all push-syncForse già presa @sbackend123 l’ha presa 9 giorni fa. Apertaseen
Difficoltà 3/5 1-2 giorni Idoneità per principianti 75/100
ethersphere/bee#5641 · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di ethersphere/bee
Issue simili
-
perf(translator): Claude→Responses stream re-validates the whole request body on every SSE chunkAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
router-for-me/CLIProxyAPI#6665 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
superplanehq/superplane#8557 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
copilot-api domain:platform go
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skillForse già presa @MatiasOlivera l’ha presa oggi. Apertaenhancement
Difficoltà 2/5 Mezza giornata Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno