-
Notifications
You must be signed in to change notification settings - Fork 100
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
Faucet has a chain listener #2410
base: main
Are you sure you want to change the base?
Conversation
42e5b5f
to
71aea89
Compare
CLI.md
Outdated
@@ -100,7 +100,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp | |||
* `--recv-timeout-ms <RECV_TIMEOUT>` — Timeout for receiving responses (milliseconds) | |||
|
|||
Default value: `4000` | |||
* `--max-pending-message-bundles <MAX_PENDING_MESSAGE_BUNDLES>` — The maximum number of incoming message bundles to include in a block proposal |
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.
Is this an accidental regression?
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.
Ah good catch. I think I may need a rebase.
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.
@christos-h: You can run:
cargo run --locked --bin linera help-markdown > CLI.md
(That will probably just revert the file, but it makes sure it's in sync with the code.)
let faucet_client = net.make_client().await; | ||
faucet_client.wallet_init(&[], FaucetOption::None).await?; | ||
|
||
let faucet_chain = client | ||
.open_and_assign(&faucet_client, Amount::from_tokens(1_000u128)) | ||
.await?; | ||
|
||
let mut faucet_service = faucet_client | ||
.run_faucet(None, faucet_chain, Amount::from_tokens(2)) | ||
.await?; | ||
|
||
faucet_service.ensure_is_running()?; | ||
|
||
let faucet = faucet_service.instance(); | ||
|
||
assert_eq!(faucet.current_validators().await?.len(), 4); | ||
|
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.
The reconfiguration test is already extremely complicated. Does it have to be part of it?
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.
I didn't want to add another test and increase CI time. Not sure there is a correct answer here.
linera-client/src/chain_clients.rs
Outdated
|
||
pub async fn from_clients(chains: impl IntoIterator<Item = ChainClient<P, S>>) -> Self { | ||
let chain_clients = Self(Default::default()); | ||
for chain_client in chains.into_iter() { |
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.
for chain_client in chains.into_iter() { | |
for chain_client in chains { |
@@ -81,6 +81,14 @@ pub trait ClientContext { | |||
&mut self, | |||
client: &ChainClient<Self::ValidatorNodeProvider, Self::Storage>, | |||
) -> Result<(), Error>; | |||
|
|||
fn clients(&self) -> Vec<ChainClient<Self::ValidatorNodeProvider, Self::Storage>> { |
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.
Maybe make_clients
, to make it clearer that this isn't a (cheap) getter.
CLI.md
Outdated
@@ -100,7 +100,7 @@ A Byzantine-fault tolerant sidechain with low-latency finality and high throughp | |||
* `--recv-timeout-ms <RECV_TIMEOUT>` — Timeout for receiving responses (milliseconds) | |||
|
|||
Default value: `4000` | |||
* `--max-pending-message-bundles <MAX_PENDING_MESSAGE_BUNDLES>` — The maximum number of incoming message bundles to include in a block proposal |
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.
@christos-h: You can run:
cargo run --locked --bin linera help-markdown > CLI.md
(That will probably just revert the file, but it makes sure it's in sync with the code.)
2771957
to
6d6a13b
Compare
Motivation
We would like the faucet to listen for notifications from the admin change, especially for reconfigurations so that it can automatically update epoch.
Proposal
Add a chain listener to the faucet service. This will work with #2303 so that the faucet only listens for messages from the admin chain.