From 6c692d9211c1d579081a7f26f53049874322eb96 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Fri, 16 Jun 2023 16:00:44 +0200 Subject: [PATCH] Temp commit --- .github/workflows/ci.yml | 2 +- mithril-aggregator/src/certifier_service.rs | 5 +++-- mithril-aggregator/src/runtime/error.rs | 4 ++++ mithril-aggregator/src/runtime/runner.rs | 9 ++++++++- .../mithril-end-to-end/src/mithril/aggregator.rs | 2 +- .../mithril-end-to-end/src/mithril/signer.rs | 2 +- 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e32b94dd5a..c20f9c62435 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,7 +190,7 @@ jobs: fail-fast: false matrix: era: ${{ fromJSON(needs.build-ubuntu-X64.outputs.eras) }} - run_id: [1,2,3] + run_id: [1,2,3,4,5,6,7,8,9,10] steps: - name: Checkout sources uses: actions/checkout@v3 diff --git a/mithril-aggregator/src/certifier_service.rs b/mithril-aggregator/src/certifier_service.rs index 41dc306ce0c..804ed5ac759 100644 --- a/mithril-aggregator/src/certifier_service.rs +++ b/mithril-aggregator/src/certifier_service.rs @@ -170,8 +170,8 @@ impl MithrilCertifierService { impl CertifierService for MithrilCertifierService { async fn inform_epoch(&self, epoch: Epoch) -> StdResult<()> { debug!("CertifierService::inform_epoch(epoch: {epoch:?})"); - let nb = self.open_message_repository.clean_epoch(epoch).await?; - info!("MithrilCertifierService: Informed of a new Epoch: {epoch:?}. Cleaned {nb} open messages along with their single signatures."); + /* let nb = self.open_message_repository.clean_epoch(epoch).await?; + info!("MithrilCertifierService: Informed of a new Epoch: {epoch:?}. Cleaned {nb} open messages along with their single signatures."); */ Ok(()) } @@ -230,6 +230,7 @@ impl CertifierService for MithrilCertifierService { "CertifierService::create_open_message: created open message ID='{}'", open_message.open_message_id ); + debug!("CertifierService::create_open_message: open_message={open_message:?}'"); Ok(open_message.into()) } diff --git a/mithril-aggregator/src/runtime/error.rs b/mithril-aggregator/src/runtime/error.rs index edf6e306429..8a3832ee0b7 100644 --- a/mithril-aggregator/src/runtime/error.rs +++ b/mithril-aggregator/src/runtime/error.rs @@ -67,4 +67,8 @@ pub enum RunnerError { /// Missing protocol parameters #[error("Missing protocol parameters: '{0}'.")] MissingProtocolParameters(String), + + /// Missing next aggregate verification key + #[error("Missing next aggregate verification key: '{0}'.")] + MissingNextAggregateVerificationKey(String), } diff --git a/mithril-aggregator/src/runtime/runner.rs b/mithril-aggregator/src/runtime/runner.rs index 60f011e04b8..074320afc38 100644 --- a/mithril-aggregator/src/runtime/runner.rs +++ b/mithril-aggregator/src/runtime/runner.rs @@ -211,6 +211,8 @@ impl AggregatorRunnerTrait for AggregatorRunner { "RUNNER: get_current_non_certified_open_message_for_signed_entity_type: no open message found, a new one will be created"; "signed_entity_type" => ?signed_entity_type ); + let chain_beacon: Beacon = self.get_beacon_from_chain().await?; + self.update_beacon(&chain_beacon).await?; let protocol_message = self.compute_protocol_message(signed_entity_type).await?; Some( self.create_open_message(signed_entity_type, &protocol_message) @@ -385,6 +387,7 @@ impl AggregatorRunnerTrait for AggregatorRunner { debug!("RUNNER: update protocol parameters"; "beacon" => #?new_beacon); let protocol_parameters = self.dependencies.config.protocol_parameters.clone(); + self.update_beacon(new_beacon).await?; self.dependencies .multi_signer .write() @@ -411,7 +414,11 @@ impl AggregatorRunnerTrait for AggregatorRunner { multi_signer .compute_next_stake_distribution_aggregate_verification_key() .await? - .unwrap_or_default(), + .ok_or_else(|| { + RunnerError::MissingNextAggregateVerificationKey(format!( + "Next aggregate verification key could not be computed for signer endity type {signed_entity_type:?}" + )) + })?, ); Ok(protocol_message) diff --git a/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs b/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs index 9eca71a3fc9..4f5998f4e98 100644 --- a/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs +++ b/mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs @@ -29,7 +29,7 @@ impl Aggregator { format!(r#"{{"markers": [{{"name": "{mithril_era}", "epoch": 1}}]}}"#); let env = HashMap::from([ ("NETWORK", "devnet"), - ("RUN_INTERVAL", "400"), + ("RUN_INTERVAL", "200"), ("SERVER_IP", "0.0.0.0"), ("SERVER_PORT", &server_port_parameter), ("URL_SNAPSHOT_MANIFEST", ""), diff --git a/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs b/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs index 2ea1c1393d3..209d3410b4f 100644 --- a/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs +++ b/mithril-test-lab/mithril-end-to-end/src/mithril/signer.rs @@ -30,7 +30,7 @@ impl Signer { format!(r#"{{"markers": [{{"name": "{mithril_era}", "epoch": 1}}]}}"#); let mut env = HashMap::from([ ("NETWORK", "devnet"), - ("RUN_INTERVAL", "200"), + ("RUN_INTERVAL", "100"), ("AGGREGATOR_ENDPOINT", &aggregator_endpoint), ("DB_DIRECTORY", pool_node.db_path.to_str().unwrap()), ("DATA_STORES_DIRECTORY", &data_stores_path),