From 285b641b12dc745e4cea4aa4edcfad56c74b2295 Mon Sep 17 00:00:00 2001 From: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Date: Mon, 6 Jul 2026 20:58:03 +0200 Subject: [PATCH 1/2] cmd/rpcdaemon, docs: default --state.cache to 128MB (Coherent) Moved from #21293: with the FCU response returning pre-commit, the version-keyed Coherent cache is what keeps a standalone daemon's reads consistent with its committed view instead of serving pre-commit state-change data against an older head. --state.cache=0 remains the no-retention escape hatch (snapshot-consistent, nothing cached). --- cmd/rpcdaemon/cli/config.go | 2 +- docs/site/docs/fundamentals/modules/rpc-daemon.md | 2 +- docs/site/static/llms-full.txt | 2 +- llms-full.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/rpcdaemon/cli/config.go b/cmd/rpcdaemon/cli/config.go index 30310d2af9a..ee66cda874d 100644 --- a/cmd/rpcdaemon/cli/config.go +++ b/cmd/rpcdaemon/cli/config.go @@ -138,7 +138,7 @@ func RootCommand() (*cobra.Command, *httpcfg.HttpCfg) { rootCmd.PersistentFlags().BoolVar(&cfg.GethCompatibility, "rpc.gethcompat", false, "Enables Geth-compatible storage iteration order for debug_storageRangeAt (sorted by keccak256 hash). Disabled by default for performance.") rootCmd.PersistentFlags().StringVar(&cfg.TxPoolApiAddr, "txpool.api.addr", "", "txpool api network address, for example: 127.0.0.1:9090 (default: use value of --private.api.addr)") - rootCmd.PersistentFlags().StringVar(&stateCacheStr, "state.cache", "0MB", "Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads") + rootCmd.PersistentFlags().StringVar(&stateCacheStr, "state.cache", "128MB", "Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads") rootCmd.PersistentFlags().BoolVar(&cfg.GRPCServerEnabled, "grpc", false, "Enable GRPC server") rootCmd.PersistentFlags().StringVar(&cfg.GRPCListenAddress, "grpc.addr", nodecfg.DefaultGRPCHost, "GRPC server listening interface") rootCmd.PersistentFlags().IntVar(&cfg.GRPCPort, "grpc.port", nodecfg.DefaultGRPCPort, "GRPC server listening port") diff --git a/docs/site/docs/fundamentals/modules/rpc-daemon.md b/docs/site/docs/fundamentals/modules/rpc-daemon.md index 019b52e0c3a..cf89ba2f4e5 100644 --- a/docs/site/docs/fundamentals/modules/rpc-daemon.md +++ b/docs/site/docs/fundamentals/modules/rpc-daemon.md @@ -117,7 +117,7 @@ Flags: --rpc.txfeecap float Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) --socket.enabled Enable IPC server --socket.url string IPC server listening url. prefix supported are tcp, unix (default "unix:///var/run/erigon.sock") - --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "0MB") + --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "128MB") --tls.cacert string CA certificate for client side TLS handshake for GRPC --tls.cert string certificate for client side TLS handshake for GRPC --tls.key string key file for client side TLS handshake for GRPC diff --git a/docs/site/static/llms-full.txt b/docs/site/static/llms-full.txt index 6f549b09bc0..2fb84ddf8d1 100644 --- a/docs/site/static/llms-full.txt +++ b/docs/site/static/llms-full.txt @@ -4121,7 +4121,7 @@ Flags: --rpc.txfeecap float Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) --socket.enabled Enable IPC server --socket.url string IPC server listening url. prefix supported are tcp, unix (default "unix:///var/run/erigon.sock") - --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "0MB") + --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "128MB") --tls.cacert string CA certificate for client side TLS handshake for GRPC --tls.cert string certificate for client side TLS handshake for GRPC --tls.key string key file for client side TLS handshake for GRPC diff --git a/llms-full.txt b/llms-full.txt index 6f549b09bc0..2fb84ddf8d1 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -4121,7 +4121,7 @@ Flags: --rpc.txfeecap float Sets a cap on transaction fee (in ether) that can be sent via the RPC APIs (0 = no cap) (default 1) --socket.enabled Enable IPC server --socket.url string IPC server listening url. prefix supported are tcp, unix (default "unix:///var/run/erigon.sock") - --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "0MB") + --state.cache string Amount of data to store in the version-keyed StateCache (an equally-sized code cache is budgeted on top). Set 0 to disable entry retention while preserving snapshot-consistent reads (default "128MB") --tls.cacert string CA certificate for client side TLS handshake for GRPC --tls.cert string certificate for client side TLS handshake for GRPC --tls.key string key file for client side TLS handshake for GRPC From 119677cae30789a86b784b21e74e3ea043309932 Mon Sep 17 00:00:00 2001 From: yperbasis Date: Mon, 6 Jul 2026 16:24:24 +0200 Subject: [PATCH 2/2] node/ethconfig, docs: enable FcuBackgroundCommit by default MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FCU responses return to the consensus client before the MDBX flush+commit lands, recovering the FCU latency regression tracked in #21008 (p50 ~+80ms vs release/3.4). Groundwork — overlay/committed read split, version-keyed rpcdaemon cache, Busy tolerance, WaitIdle races — landed separately. --- docs/site/docs/fundamentals/configuring-erigon.mdx | 4 ++-- docs/site/static/llms-full.txt | 4 ++-- llms-full.txt | 4 ++-- node/ethconfig/config.go | 10 +++++++--- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/site/docs/fundamentals/configuring-erigon.mdx b/docs/site/docs/fundamentals/configuring-erigon.mdx index d12064c9808..363bb35c514 100644 --- a/docs/site/docs/fundamentals/configuring-erigon.mdx +++ b/docs/site/docs/fundamentals/configuring-erigon.mdx @@ -417,8 +417,8 @@ Flags for configuring Fork Choice Update behavior. * Default: `1s` * `--fcu.background.prune`: Enables background pruning after FCU. * Default: `true` -* `--fcu.background.commit`: Enables background flush and commit after FCU. - * Default: `false` +* `--fcu.background.commit`: Returns the FCU response before MDBX flush+commit lands (commit runs in background; remote `rpcdaemon` `latest` stays consistent but can lag for the commit duration). + * Default: `true` ### Execution diff --git a/docs/site/static/llms-full.txt b/docs/site/static/llms-full.txt index 2fb84ddf8d1..99705faac07 100644 --- a/docs/site/static/llms-full.txt +++ b/docs/site/static/llms-full.txt @@ -2319,8 +2319,8 @@ Flags for configuring Fork Choice Update behavior. * Default: `1s` * `--fcu.background.prune`: Enables background pruning after FCU. * Default: `true` -* `--fcu.background.commit`: Enables background flush and commit after FCU. - * Default: `false` +* `--fcu.background.commit`: Returns the FCU response before MDBX flush+commit lands (commit runs in background; remote `rpcdaemon` `latest` stays consistent but can lag for the commit duration). + * Default: `true` ### Execution diff --git a/llms-full.txt b/llms-full.txt index 2fb84ddf8d1..99705faac07 100644 --- a/llms-full.txt +++ b/llms-full.txt @@ -2319,8 +2319,8 @@ Flags for configuring Fork Choice Update behavior. * Default: `1s` * `--fcu.background.prune`: Enables background pruning after FCU. * Default: `true` -* `--fcu.background.commit`: Enables background flush and commit after FCU. - * Default: `false` +* `--fcu.background.commit`: Returns the FCU response before MDBX flush+commit lands (commit runs in background; remote `rpcdaemon` `latest` stays consistent but can lag for the commit duration). + * Default: `true` ### Execution diff --git a/node/ethconfig/config.go b/node/ethconfig/config.go index 6c795df23a5..69947a3cc9b 100644 --- a/node/ethconfig/config.go +++ b/node/ethconfig/config.go @@ -111,9 +111,13 @@ var Defaults = Config{ ProduceE2: true, ProduceE3: true, }, - FcuTimeout: 1 * time.Second, - FcuBackgroundPrune: true, - FcuBackgroundCommit: false, // to enable, we need to 1) have rawdb API go via execctx and 2) revive Coherent cache for rpcdaemon + FcuTimeout: 1 * time.Second, + FcuBackgroundPrune: true, + // FcuBackgroundCommit returns the FCU response before the MDBX commit + // lands; the commit runs in a background goroutine and successive FCUs are + // serialized by the ExecModule semaphore. "Latest" state reads can lag the + // announced head by one block for the commit's duration. + FcuBackgroundCommit: true, ExperimentalBAL: false, WarmupKzgCtxOnInit: true, }