Skip to content
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

Fix end to end test flakiness in CI #1486

Merged
merged 28 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
332b184
fix: first launch protocol parameters setup in e2e test
jpraynaud Feb 2, 2024
2d1d85a
fix: record one more epoch at first launch protocol in e2e test
jpraynaud Feb 2, 2024
b08d23a
refactor: get rid of 'ProtocolParametersStore' in aggregator
jpraynaud Feb 19, 2024
3bbd11b
fix: enhance protocol parameters bootstrap on first launch
jpraynaud Feb 19, 2024
7d0b944
fix: enhance protocol parameters discrepancies handling
jpraynaud Feb 21, 2024
ba649f8
feat: Mithril node run interval is configurable in e2e
jpraynaud Feb 2, 2024
9e071ae
fix: tail more logs from nodes to see full panic stack trace in e2e test
jpraynaud Feb 16, 2024
28d8abe
fix: incorrect network topology for full nodes in 'devnet'
jpraynaud Feb 7, 2024
a5270fa
fix: bootstrap era reader adapter starts at epoch 0
jpraynaud Feb 8, 2024
e65ef39
fix: update security param in devnet
jpraynaud Feb 15, 2024
9498a85
fix: update active slots coeff in devnet
jpraynaud Feb 16, 2024
32a0657
refactor: replace full nodes with SPO nodes in e2e test
jpraynaud Feb 16, 2024
4daba5f
feat: add passive relays in e2e test
jpraynaud Feb 19, 2024
dc32a7f
feat: make passive relays use optional in e2e
jpraynaud Feb 21, 2024
99a5ccd
fix: update idle connection timeout in P2P swarm config of relay
jpraynaud Feb 20, 2024
91a9975
fix: update e2e protocol parameters
jpraynaud Feb 20, 2024
0eb05c4
chore: debug signature message sent by relay to aggregator
jpraynaud Feb 20, 2024
fd9b453
fix: extend wait for transaction confirmation in devnet
jpraynaud Feb 20, 2024
784dc0f
fix: add retry for relay posting signatures to aggregator
jpraynaud Feb 20, 2024
864728b
fix: add retry for Mithril era markers transactions in devnet
jpraynaud Feb 21, 2024
d9ae053
make E2E clap check a min number of pool nodes
Alenar Feb 22, 2024
604a196
Refactor E2E `infrastructure::start` to split it in manageable parts
Alenar Feb 22, 2024
05cf028
Remove Bft nodes from `mithril-end-to-end` crate
Alenar Feb 22, 2024
1dd6a16
fix: clap check of minimum number of pool nodes is too strict
jpraynaud Feb 23, 2024
4c67508
fix: make payments script resilient to roll-backs in 'devnet'
jpraynaud Feb 23, 2024
8789d08
fix: transfer funds earlier in the e2e test
jpraynaud Feb 23, 2024
4e264fe
fix: force number of BFT nodes to 0 in e2e 'devnet'
jpraynaud Feb 23, 2024
fa5e910
chore: bump crates versions
jpraynaud Feb 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mithril-aggregator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mithril-aggregator"
version = "0.4.39"
version = "0.4.40"
description = "A Mithril Aggregator server"
authors = { workspace = true }
edition = { workspace = true }
Expand Down
80 changes: 26 additions & 54 deletions mithril-aggregator/src/dependency_injection/builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use anyhow::Context;
use semver::Version;
use slog::Logger;
use slog_scope::debug;
use sqlite::Connection;
use std::sync::Arc;
use tokio::{
Expand Down Expand Up @@ -536,10 +535,34 @@ impl DependenciesBuilder {
async fn build_protocol_parameters_store(
&mut self,
) -> Result<Arc<dyn ProtocolParametersStorer>> {
Ok(Arc::new(EpochSettingStore::new(
let protocol_parameters_store = EpochSettingStore::new(
self.get_sqlite_connection().await?,
self.configuration.safe_epoch_retention_limit(),
)))
);
let current_epoch = self
.get_chain_observer()
.await?
.get_current_epoch()
.await
.map_err(|e| DependenciesBuilderError::Initialization {
message: "cannot create aggregator runner: failed to retrieve current epoch."
.to_string(),
error: Some(e.into()),
})?
.ok_or(DependenciesBuilderError::Initialization {
message: "cannot build aggregator runner: no epoch returned.".to_string(),
error: None,
})?;

protocol_parameters_store
.handle_discrepancies_at_startup(current_epoch, &self.configuration.protocol_parameters)
.await
.map_err(|e| DependenciesBuilderError::Initialization {
message: "can not create aggregator runner".to_string(),
error: Some(e),
})?;

Ok(Arc::new(protocol_parameters_store))
}

/// Get a configured [ProtocolParametersStorer].
Expand Down Expand Up @@ -1214,57 +1237,6 @@ impl DependenciesBuilder {

/// Create the AggregatorRunner
pub async fn create_aggregator_runner(&mut self) -> Result<AggregatorRuntime> {
// initialize ProtocolParameters store if needed
{
let current_epoch = self
.get_chain_observer()
.await?
.get_current_epoch()
.await
.map_err(|e| DependenciesBuilderError::Initialization {
message: "cannot create aggregator runner: failed to retrieve current epoch."
.to_string(),
error: Some(e.into()),
})?
.ok_or(DependenciesBuilderError::Initialization {
message: "cannot build aggregator runner: no epoch returned.".to_string(),
error: None,
})?;
let (work_epoch, epoch_to_sign, next_epoch_to_sign) = match current_epoch {
Epoch(0) => (Epoch(0), Epoch(1), Epoch(2)),
epoch => (
epoch.offset_to_signer_retrieval_epoch().unwrap(),
epoch.offset_to_next_signer_retrieval_epoch(),
epoch.offset_to_next_signer_retrieval_epoch().next(),
),
};
let protocol_parameters_store = self.get_protocol_parameters_store().await?;

if protocol_parameters_store
.get_protocol_parameters(work_epoch)
.await
.map_err(|e| DependenciesBuilderError::Initialization {
message: "can not create aggregator runner".to_string(),
error: Some(e),
})?
.is_none()
{
debug!("First launch, will use the configured protocol parameters for the current and next epoch certificate");

for epoch in [work_epoch, epoch_to_sign, next_epoch_to_sign] {
protocol_parameters_store
.save_protocol_parameters(
epoch,
self.configuration.protocol_parameters.clone(),
)
.await
.map_err(|e| DependenciesBuilderError::Initialization {
message: "can not create aggregator runner".to_string(),
error: Some(e),
})?;
}
}
}
let dependency_container = Arc::new(self.build_dependency_container().await?);

let config = AggregatorConfig::new(
Expand Down
3 changes: 1 addition & 2 deletions mithril-aggregator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ pub use snapshotter::{
SnapshotterCompressionAlgorithm,
};
pub use store::{
CertificatePendingStore, ProtocolParametersStore, ProtocolParametersStorer,
VerificationKeyStore, VerificationKeyStorer,
CertificatePendingStore, ProtocolParametersStorer, VerificationKeyStore, VerificationKeyStorer,
};
pub use tools::{
CExplorerSignerRetriever, SignersImporter, SignersImporterPersister, SignersImporterRetriever,
Expand Down
35 changes: 15 additions & 20 deletions mithril-aggregator/src/services/epoch_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,8 @@ mod tests {
use std::collections::{BTreeSet, HashMap};

use crate::services::epoch_service::tests::ServiceBuilderParameters::WithFutureProtocolParameters;
use crate::{ProtocolParametersStore, VerificationKeyStore};
use crate::store::FakeProtocolParametersStorer;
use crate::VerificationKeyStore;

use super::*;

Expand Down Expand Up @@ -558,26 +559,20 @@ mod tests {
}
}

let protocol_parameters_store = ProtocolParametersStore::new(
Box::new(
MemoryAdapter::new(Some(vec![
(
signer_retrieval_epoch,
current_epoch_fixture.protocol_parameters(),
),
(
next_signer_retrieval_epoch,
next_epoch_fixture.protocol_parameters(),
),
(
next_signer_retrieval_epoch.next(),
upcoming_protocol_parameters.clone(),
),
]))
.unwrap(),
let protocol_parameters_store = FakeProtocolParametersStorer::new(vec![
(
signer_retrieval_epoch,
current_epoch_fixture.protocol_parameters(),
),
None,
);
(
next_signer_retrieval_epoch,
next_epoch_fixture.protocol_parameters(),
),
(
next_signer_retrieval_epoch.next(),
upcoming_protocol_parameters.clone(),
),
]);
let vkey_store = VerificationKeyStore::new(Box::new(
MemoryAdapter::new(Some(vec![
(
Expand Down
4 changes: 3 additions & 1 deletion mithril-aggregator/src/store/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ mod protocol_parameters_store;
mod verification_key_store;

pub use pending_certificate_store::CertificatePendingStore;
pub use protocol_parameters_store::{ProtocolParametersStore, ProtocolParametersStorer};
pub use protocol_parameters_store::ProtocolParametersStorer;
pub use verification_key_store::{VerificationKeyStore, VerificationKeyStorer};

#[cfg(test)]
pub use protocol_parameters_store::FakeProtocolParametersStorer;
#[cfg(test)]
pub use verification_key_store::test_suite as verification_key_store_test_suite;
#[cfg(test)]
Expand Down
Loading
Loading