Skip to content

Commit 48945d5

Browse files
authored
Set default fallback duration to MAX. (#3905)
## Motivation The validators are not currently expected to start client processes automatically. So chains that enter fallback mode are effectively bricked. ## Proposal Set the default fallback timeout to `MAX`, so validators will never sign a fallback timeout certificate. ## Test Plan (Only a default chain config change.) ## Release Plan - Nothing to do / These changes follow the usual release cycle. ## Links - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 961fe22 commit 48945d5

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

linera-base/src/identifiers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ mod tests {
10181018
);
10191019
assert_eq!(
10201020
description.id().to_string(),
1021-
"f8c2f02adc0ac763ffd74a32d02aa37490d869605c356a2da55e1d09e7d253bf"
1021+
"0e94923a8f72ef1d0e69e6958e655002f2b1883bac9a67a4704d2f4125825217"
10221022
);
10231023
}
10241024

linera-base/src/ownership.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ impl Default for TimeoutConfig {
4141
fast_round_duration: None,
4242
base_timeout: TimeDelta::from_secs(10),
4343
timeout_increment: TimeDelta::from_secs(1),
44-
fallback_duration: TimeDelta::from_secs(60 * 60 * 24),
44+
// This is `MAX` because the validators are not currently expected to start clients for
45+
// every chain with an old tracked message in the inbox.
46+
fallback_duration: TimeDelta::MAX,
4547
}
4648
}
4749
}

linera-core/src/unit_tests/worker_tests.rs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,22 @@ where
184184
index: u32,
185185
owner: AccountOwner,
186186
balance: Amount,
187+
) -> ChainDescription {
188+
self.add_root_chain_with_ownership(index, balance, ChainOwnership::single(owner))
189+
.await
190+
}
191+
192+
async fn add_root_chain_with_ownership(
193+
&mut self,
194+
index: u32,
195+
balance: Amount,
196+
ownership: ChainOwnership,
187197
) -> ChainDescription {
188198
let origin = ChainOrigin::Root(index);
189199
let config = InitialChainConfig {
190200
admin_id: Some(self.admin_id()),
191201
epoch: self.admin_description.config().epoch,
192-
ownership: ChainOwnership::single(owner),
202+
ownership,
193203
committees: self.admin_description.config().committees.clone(),
194204
balance,
195205
application_permissions: Default::default(),
@@ -3560,7 +3570,12 @@ where
35603570
let public_key = signer.generate_new();
35613571
let mut env = TestEnvironment::new(storage, false, false).await;
35623572
let balance = Amount::from_tokens(5);
3563-
let chain_1_desc = env.add_root_chain(1, public_key.into(), balance).await;
3573+
let mut ownership = ChainOwnership::single(public_key.into());
3574+
// Configure a fallback duration. (The default is `MAX`, i.e. never.)
3575+
ownership.timeout_config.fallback_duration = TimeDelta::from_secs(5);
3576+
let chain_1_desc = env
3577+
.add_root_chain_with_ownership(1, balance, ownership)
3578+
.await;
35643579
let chain_id = chain_1_desc.id();
35653580

35663581
// At time 0 we don't vote for fallback mode.

0 commit comments

Comments
 (0)