Apply inverted chain worker TTL fix to the compiled code path; remove actor.rs.#6000
Merged
Merged
Conversation
The port of linera-io#5991 to testnet_conway (linera-io#5992) modified `linera-core/src/chain_worker/actor.rs`, but actor.rs is an orphan file with no `mod actor` declaration in `chain_worker/mod.rs`, so it is not part of the build and the TTL inversion was never actually fixed on this branch. Apply the same swap to `handle.rs::create_chain_worker`, which is the code path that is actually compiled, and delete the stale `actor.rs` file so this cannot happen again. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ndr-ds
approved these changes
Apr 14, 2026
bart-linera
approved these changes
Apr 14, 2026
pull Bot
pushed a commit
to Spencerx/linera-protocol
that referenced
this pull request
Apr 29, 2026
…inera-io#6167) ## Motivation PR linera-io#5991 fixed an inverted TTL assignment in `create_chain_worker`, swapping the branches so tracked chains use the long `config.ttl` and sender chains use the short `config.sender_chain_ttl`. Correct for clients (PM workers, wallets) where `chain_modes=Some(...)` distinguishes tracked from sender chains. Validators construct WorkerState with `chain_modes=None` (linera-service/src/server.rs:113) and have no tracked-vs-sender distinction. With `chain_modes=None`, `is_tracked` is always false, so post-linera-io#5991 every chain on a validator routes through `config.sender_chain_ttl`. The validator binary has no `--sender-chain-worker-ttl-ms` CLI flag, so `sender_chain_ttl` stays at the `ChainWorkerConfig::default()` value of `None`. Result: `spawn_keep_alive` is never called for any chain worker on a validator. The `Arc<ChainWorker>` drops the moment the in-flight request finishes, taking the per-chain `LruCachingStore` with it. Every subsequent request reloads chain state from Scylla. Empirical from testnet_conway V4 (running the post-linera-io#5991 no-actor code) vs V1-V3 (still running pre-fix actor.rs on testnet_conway_debug, where `is_tracked=false` correctly routes to `config.ttl=30s`): - `read_value` LRU cache hit rate: V4 2.66% vs V1-V3 75% - `find_keys_by_prefix` cache hit rate: V4 1.81% vs V1-V3 48% - `read_multi_value` rate to Scylla: V4 ~691/s vs V1-V3 ~75/s (9.2x) - p99 Scylla read latency: V4 42ms vs V1-V3 19-22ms; 30x worse stddev ## Proposal Treat `chain_modes=None` as "tracking every chain this node serves" — the validator natural semantic, since validators have no tracked-vs-sender split. For clients, behavior is unchanged: `chain_modes=Some(map)` still computes `is_tracked` from map membership and Full listening mode. One-line change: `chain_modes.as_ref().is_some_and(...)` becomes `is_none_or`. Inner `ListeningMode::is_full` check preserved unchanged. Restores the actor-model property (validators routed through `config.ttl`) without re-inverting the branches that linera-io#5991 correctly fixed for clients. ## Test Plan CI ## Release Plan - These changes should be backported to the latest testnet branch. ## Links - linera-io#5991, linera-io#5992, linera-io#6000 (the inversion fix this complements for validators) - linera-io#6160 (companion helm change adding `--chain-worker-ttl-ms` to validator chart)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
In #5790 I must have forgotten to remove (or brought back in a merge attempt)
actor.rs.The port of #5991 to testnet_conway (#5992) modified
linera-core/src/chain_worker/actor.rs, but actor.rs is an orphan file with nomod actordeclaration inchain_worker/mod.rs, so it is not part of the build and the TTL inversion was never actually fixed on this branch.Proposal
Apply the same swap to
handle.rs::create_chain_worker, which is the code path that is actually compiled, and delete the staleactor.rsfile so this cannot happen again.Test Plan
CI
Release Plan
Links
actor.rs: Remove chain actors (#5502, #5687) #5790