Skip to content

Apply inverted chain worker TTL fix to the compiled code path; remove actor.rs.#6000

Merged
afck merged 1 commit into
linera-io:testnet_conwayfrom
afck:conway-fix-ttl
Apr 14, 2026
Merged

Apply inverted chain worker TTL fix to the compiled code path; remove actor.rs.#6000
afck merged 1 commit into
linera-io:testnet_conwayfrom
afck:conway-fix-ttl

Conversation

@afck
Copy link
Copy Markdown
Contributor

@afck afck commented Apr 14, 2026

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 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.

Proposal

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.

Test Plan

CI

Release Plan

  • Release SDK.
  • Validator hotfix.

Links

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>
@afck afck requested review from deuszx, ma2bd and ndr-ds April 14, 2026 13:07
@afck afck merged commit 5f5778d into linera-io:testnet_conway Apr 14, 2026
33 of 34 checks passed
@afck afck deleted the conway-fix-ttl branch April 14, 2026 13:56
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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants