Skip to content

Commit 3b6557b

Browse files
authored
Merge pull request #1852 from input-output-hk/jpraynaud/1836-fix-chain-reader-stuck-error
fix: `ChainReader` fails on `find_intersect_point` without agency
2 parents 0e21965 + 8f88564 commit 3b6557b

File tree

3 files changed

+21
-4
lines changed

3 files changed

+21
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ As a minor extension, we have adopted a slightly different versioning convention
1111

1212
- `mithril-aggregator` node produces artifact for different signed entity types in parallel.
1313

14+
- Fix `Agency is theirs` error in the `ChainReader` when the underlying `Chain sync` client does not have agency.
15+
1416
- **UNSTABLE** Cardano transactions certification:
1517

1618
- Make Cardano transaction signing settings configurable via the CD.

mithril-common/src/chain_reader/pallas_chain_reader.rs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ impl PallasChainReader {
5454
let client = self.get_client().await?;
5555
let chainsync = client.chainsync();
5656

57-
chainsync
58-
.find_intersect(vec![point.to_owned().into()])
59-
.await?;
57+
if chainsync.has_agency() {
58+
chainsync
59+
.find_intersect(vec![point.to_owned().into()])
60+
.await?;
61+
}
6062

6163
Ok(())
6264
}
@@ -327,6 +329,19 @@ mod tests {
327329
let client = chain_reader.get_client().await.unwrap();
328330
client.chainsync().request_next().await.unwrap();
329331

332+
// make sure that the chainsync client returns an error when attempting to find intersection without agency
333+
client
334+
.chainsync()
335+
.find_intersect(vec![known_point.clone()])
336+
.await
337+
.expect_err("chainsync find_intersect without agency should fail");
338+
339+
// make sure that setting the chain point is harmless when the chainsync client does not have agency
340+
chain_reader
341+
.set_chain_point(&ChainPoint::from(known_point.clone()))
342+
.await
343+
.unwrap();
344+
330345
chain_reader.get_next_chain_block().await.unwrap().unwrap()
331346
});
332347

mithril-test-lab/mithril-end-to-end/src/mithril/aggregator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl Aggregator {
8989
("CARDANO_TRANSACTIONS_DATABASE_CONNECTION_POOL_SIZE", "5"),
9090
(
9191
"CARDANO_TRANSACTIONS_SIGNING_CONFIG__SECURITY_PARAMETER",
92-
"15",
92+
"1",
9393
),
9494
("CARDANO_TRANSACTIONS_SIGNING_CONFIG__STEP", "15"),
9595
]);

0 commit comments

Comments
 (0)