-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Extend reconfig test; sync on wallet init; fix blob fetching.
#4437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ use chrono::Utc; | |
| use colored::Colorize; | ||
| use futures::{lock::Mutex, FutureExt as _, StreamExt}; | ||
| use linera_base::{ | ||
| crypto::{InMemorySigner, Signer}, | ||
| crypto::{AccountPublicKey, InMemorySigner, Signer}, | ||
| data_types::{ApplicationPermissions, Timestamp}, | ||
| identifiers::{AccountOwner, ChainId}, | ||
| listen_for_shutdown_signals, | ||
|
|
@@ -1610,6 +1610,43 @@ impl Runnable for Job { | |
| ); | ||
| } | ||
|
|
||
| Wallet(WalletCommand::Init { faucet, .. }) => { | ||
| let Some(faucet_url) = faucet else { | ||
| return Ok(()); | ||
| }; | ||
| let Some(network_description) = storage.read_network_description().await? else { | ||
| anyhow::bail!("Missing network description"); | ||
| }; | ||
| let context = ClientContext::new( | ||
| storage, | ||
| options.context_options.clone(), | ||
| wallet, | ||
| signer.into_value(), | ||
| ); | ||
| let faucet = cli_wrappers::Faucet::new(faucet_url); | ||
| let validators = faucet.current_validators().await?; | ||
| let chain_client = context.make_chain_client(network_description.admin_chain_id); | ||
| // TODO(#4434): This is a quick workaround with an equal-weight committee. Instead, | ||
| // the faucet should provide the full committee including weights. | ||
| let committee = Committee::new( | ||
| validators | ||
| .into_iter() | ||
| .map(|(pub_key, network_address)| { | ||
| let state = ValidatorState { | ||
| network_address, | ||
| votes: 100, | ||
| account_public_key: AccountPublicKey::from_slice(&[0; 33]).unwrap(), | ||
| }; | ||
| (pub_key, state) | ||
| }) | ||
| .collect(), | ||
| Default::default(), // unused | ||
| ); | ||
| chain_client | ||
| .synchronize_chain_state_from_committee(committee) | ||
| .await?; | ||
|
Comment on lines
+1645
to
+1647
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is for the CLI only, what about other clients? Are they all supposed to do that manually?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, also on initialization.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (But this is still a hack; needs a proper solution, but I hope this can already unblock us.) |
||
| } | ||
|
|
||
| Wallet(WalletCommand::FollowChain { | ||
| chain_id, | ||
| sync: true, | ||
|
|
@@ -2431,6 +2468,7 @@ Make sure to use a Linera client compatible with this network. | |
| keystore.persist().await?; | ||
| options.create_wallet(genesis_config)?.persist().await?; | ||
| options.initialize_storage().boxed().await?; | ||
| options.run_with_storage(Job(options.clone())).await??; | ||
| info!( | ||
| "Wallet initialized in {} ms", | ||
| start_time.elapsed().as_millis() | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, b/c the blobs in
blob_idscan only come from thecertificate(otherwise it would have been the "unexpected blob" error)?