Skip to content

Commit b452c36

Browse files
authored
Synchronize before applying changes to the committee. (#4854)
## Motivation At the moment it would probably not commit anything, but in the future it might become dangerous to use `change-validators` (or `set-validator` or `remove-validator`) without first using `sync`: It would take an outdated committee, apply the modifications, and then use the result as the new committee. ## Proposal Synchronize the admin chain before getting the committee. ## Test Plan This is just a safeguard so that we don't introduce a footgun in the future, if we modify the client to automatically and silently fetch the missing blocks inside `execute_operations`. ## Release Plan - These changes should be backported to `testnet_conway`, then - be released in a new SDK. ## Links - Related: #4833 - [reviewer checklist](https://github.com/linera-io/linera-protocol/blob/main/CONTRIBUTING.md#reviewer-checklist)
1 parent 19d84f4 commit b452c36

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

linera-service/src/cli/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,11 @@ impl Runnable for Job {
667667
}
668668
_ => {}
669669
}
670-
let chain_client = context.make_chain_client(context.wallet.genesis_admin_chain());
670+
let admin_id = context.wallet.genesis_admin_chain();
671+
let chain_client = context.make_chain_client(admin_id);
672+
// Synchronize the chain state to make sure we're applying the changes to the
673+
// latest committee.
674+
chain_client.synchronize_chain_state(admin_id).await?;
671675
let maybe_certificate = context
672676
.apply_client_command(&chain_client, |chain_client| {
673677
let chain_client = chain_client.clone();

0 commit comments

Comments
 (0)