Skip to content

Commit

Permalink
Merge pull request #1852 from input-output-hk/jpraynaud/1836-fix-chai…
Browse files Browse the repository at this point in the history
…n-reader-stuck-error

fix: `ChainReader` fails on `find_intersect_point` without agency
  • Loading branch information
jpraynaud authored Jul 24, 2024
2 parents 0e21965 + 8f88564 commit 3b6557b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
21 changes: 18 additions & 3 deletions mithril-common/src/chain_reader/pallas_chain_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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()
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
]);
Expand Down

0 comments on commit 3b6557b

Please sign in to comment.