diff --git a/CHANGELOG.md b/CHANGELOG.md index 04c0facdc79..56e5ff636c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ As a minor extension, we have adopted a slightly different versioning convention - `mithril-aggregator` node produces artifact for different signed entity types in parallel. +- Fix `Agency is theirs` error in the `ChainReader` when the underlying `Chain sync` client does not have agency. + - **UNSTABLE** Cardano transactions certification: - Make Cardano transaction signing settings configurable via the CD. diff --git a/Cargo.lock b/Cargo.lock index b8b5ffc69f8..08391fbac62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3703,7 +3703,7 @@ dependencies = [ [[package]] name = "mithril-common" -version = "0.4.34" +version = "0.4.35" dependencies = [ "anyhow", "async-trait", diff --git a/mithril-common/Cargo.toml b/mithril-common/Cargo.toml index d25094cb163..08f8b3f4216 100644 --- a/mithril-common/Cargo.toml +++ b/mithril-common/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mithril-common" -version = "0.4.34" +version = "0.4.35" description = "Common types, interfaces, and utilities for Mithril nodes." authors = { workspace = true } edition = { workspace = true } diff --git a/mithril-common/src/chain_reader/pallas_chain_reader.rs b/mithril-common/src/chain_reader/pallas_chain_reader.rs index 3a96434bef7..e41c3893274 100644 --- a/mithril-common/src/chain_reader/pallas_chain_reader.rs +++ b/mithril-common/src/chain_reader/pallas_chain_reader.rs @@ -54,9 +54,11 @@ impl PallasChainReader { let client = self.get_client().await?; let chainsync = client.chainsync(); - chainsync - .find_intersect(vec![point.to_owned().into()]) - .await?; + if chainsync.has_agency() { + chainsync + .find_intersect(vec![point.to_owned().into()]) + .await?; + } Ok(()) } @@ -327,6 +329,19 @@ mod tests { let client = chain_reader.get_client().await.unwrap(); client.chainsync().request_next().await.unwrap(); + // make sure that the chainsync client returns an error when attempting to find intersection without agency + client + .chainsync() + .find_intersect(vec![known_point.clone()]) + .await + .expect_err("chainsync find_intersect without agency should fail"); + + // make sure that setting the chain point is harmless when the chainsync client does not have agency + chain_reader + .set_chain_point(&ChainPoint::from(known_point.clone())) + .await + .unwrap(); + chain_reader.get_next_chain_block().await.unwrap().unwrap() }); 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 1f5d236da6d..0649ce9d49f 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 @@ -89,7 +89,7 @@ impl Aggregator { ("CARDANO_TRANSACTIONS_DATABASE_CONNECTION_POOL_SIZE", "5"), ( "CARDANO_TRANSACTIONS_SIGNING_CONFIG__SECURITY_PARAMETER", - "15", + "1", ), ("CARDANO_TRANSACTIONS_SIGNING_CONFIG__STEP", "15"), ]);