Skip to content

Commit 7ed3921

Browse files
authored
Merge branch 'main' into refactor/rbac-validation-logic
2 parents f6cd370 + 3032539 commit 7ed3921

File tree

18 files changed

+157
-135
lines changed

18 files changed

+157
-135
lines changed

Earthfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.5.17 AS mdlint-ci
4-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.5.17 AS cspell-ci
5-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.5.17 AS python-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/mdlint:v3.5.26 AS mdlint-ci
4+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cspell:v3.5.26 AS cspell-ci
5+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/python:v3.5.26 AS python-ci
66
IMPORT github.com/input-output-hk/catalyst-ci:v3.5.17 AS cat-ci
77

88
FROM debian:stable-slim

docs/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.5.17 AS docs-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/docs:v3.5.26 AS docs-ci
44

55
IMPORT .. AS repo
66

docs/src/architecture/08_concepts/catalyst_voting/cddl/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.17 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.26 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

docs/src/architecture/08_concepts/immutable_ledger/cddl/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.17 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.26 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

docs/src/architecture/08_concepts/signed_doc/cddl/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.17 AS cddl-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/cddl:v3.5.26 AS cddl-ci
44

55
check-cddl:
66
FROM cddl-ci+cddl-base

rust/Earthfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
VERSION 0.8
22

3-
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.5.17 AS rust-ci
3+
IMPORT github.com/input-output-hk/catalyst-ci/earthly/rust:v3.5.26 AS rust-ci
44
IMPORT ../ AS repo-ci
55

66
COPY_SRC:

rust/cardano-chain-follower/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cardano-chain-follower"
3-
version = "0.0.17"
3+
version = "0.0.18"
44
edition.workspace = true
55
authors.workspace = true
66
homepage.workspace = true
@@ -16,8 +16,8 @@ mithril-client = { version = "=0.12.2", default-features = false, features = [
1616
"num-integer-backend",
1717
] }
1818

19-
cardano-blockchain-types = { version = "0.0.7", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-blockchain-types/v0.0.7" }
20-
catalyst-types = { version = "0.0.9", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.9" }
19+
cardano-blockchain-types = { version = "0.0.8", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "cardano-blockchain-types/v0.0.8" }
20+
catalyst-types = { version = "0.0.10", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "catalyst-types/v0.0.10" }
2121

2222
thiserror = "1.0.69"
2323
tokio = { version = "1.45.0", features = [
@@ -60,7 +60,7 @@ test-log = { version = "0.2.16", default-features = false, features = [
6060
"trace",
6161
] }
6262
clap = "4.5.23"
63-
rbac-registration = { version = "0.0.12", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration/v0.0.12" }
63+
rbac-registration = { version = "0.0.14", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "rbac-registration/v0.0.14" }
6464
minicbor = { version = "2.0.0", features = ["alloc", "half"] }
6565

6666
# Note, these features are for support of features exposed by dependencies.

rust/cardano-chain-follower/examples/follow_chains.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ use tracing_subscriber::EnvFilter;
3131
fn process_argument() -> (Vec<Network>, ArgMatches) {
3232
let matches = Command::new("follow_chains")
3333
.args(&[
34+
arg!(--devnet "Follow Devnet network").action(ArgAction::SetTrue),
3435
arg!(--preprod "Follow Preprod network").action(ArgAction::SetTrue),
3536
arg!(--preview "Follow Preview network").action(ArgAction::SetTrue),
3637
arg!(--mainnet "Follow Mainnet network").action(ArgAction::SetTrue),
@@ -90,6 +91,23 @@ fn process_argument() -> (Vec<Network>, ArgMatches) {
9091
if matches.get_flag("mainnet") || matches.get_flag("all") {
9192
networks.push(Network::Mainnet);
9293
}
94+
if matches.get_flag("devnet") || matches.get_flag("all") {
95+
networks.push(Network::Devnet {
96+
genesis_key: "5b33322c3235332c3138362c3230312c3137372c31312c3131372c3133352c3138372c3136372c3138312c3138382c32322c35392c3230362c3130352c3233312c3135302c3231352c33302c37382c3231322c37362c31362c3235322c3138302c37322c3133342c3133372c3234372c3136312c36385d".to_string(),
97+
magic: 42,
98+
network_id: 42,
99+
byron_epoch_length: 100_000,
100+
byron_slot_length: 1000,
101+
byron_known_slot: 0,
102+
byron_known_hash: "8f8602837f7c6f8b8867dd1cbc1842cf51a27eaed2c70ef48325d00f8efb320f".to_string(),
103+
byron_known_time: 1_564_010_416,
104+
shelley_epoch_length: 100,
105+
shelley_slot_length: 1,
106+
shelley_known_slot: 1_598_400,
107+
shelley_known_hash: "02b1c561715da9e540411123a6135ee319b02f60b9a11a603d3305556c04329f".to_string(),
108+
shelley_known_time: 1_595_967_616,
109+
});
110+
}
93111

94112
(networks, matches)
95113
}

rust/cardano-chain-follower/src/turbo_downloader/mod.rs

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -359,15 +359,20 @@ impl ParallelDownloadProcessorInner {
359359
.set(RANGE.as_str(), &range_header)
360360
.call()
361361
.context("GET ranged request failed")?;
362+
362363
// let addr = get_range_response.remote_addr();
363364
// debug!("Chunk {chunk} from {addr:?}");
364-
if get_range_response.status() != StatusCode::PARTIAL_CONTENT {
365-
bail!(
366-
"Response to range request has an unexpected status code (expected {}, found {})",
367-
StatusCode::PARTIAL_CONTENT,
368-
get_range_response.status()
369-
)
370-
}
365+
anyhow::ensure!(
366+
(get_range_response.status() == StatusCode::PARTIAL_CONTENT)
367+
|| (get_range_response.status() == StatusCode::OK),
368+
"Response to range request has an unexpected status code (expected [{}], found {})",
369+
[
370+
StatusCode::PARTIAL_CONTENT.to_string(),
371+
StatusCode::OK.to_string()
372+
]
373+
.join(","),
374+
get_range_response.status()
375+
);
371376

372377
let range_size = range_end_inclusive
373378
.saturating_sub(range_start)
@@ -508,6 +513,8 @@ impl ParallelDownloadProcessor {
508513
work_queue: &crossbeam_channel::Receiver<DlWorkOrder>,
509514
chain: &Network,
510515
) {
516+
const GET_RANGE_NUM_OF_TRIES: u8 = 5;
517+
511518
debug!("Worker {worker_id} started");
512519

513520
// Each worker has its own http_client, so there is no cross worker pathology
@@ -531,23 +538,23 @@ impl ParallelDownloadProcessor {
531538
error!("Next chunk delay overflow");
532539
}
533540
}
534-
let mut retries = 0u8;
535-
let mut block;
541+
let mut block = None;
536542
// debug!("Worker {worker_id} DL chunk {next_chunk}");
537-
loop {
543+
for attempt in 1u8..=GET_RANGE_NUM_OF_TRIES {
538544
block = match params.get_range(&http_agent, next_chunk) {
539545
Ok(block) => Some(block),
540546
Err(error) => {
541-
error!("Error getting chunk: {:?}, error: {:?}", next_chunk, error);
547+
error!(
548+
"Error getting chunk: {next_chunk:?}, error: {error:?}, attempt: {attempt}",
549+
);
542550
None
543551
},
544552
};
545553

546554
// Quickly retry on error, in case its transient.
547-
if block.is_some() || retries > 3 {
555+
if block.is_some() {
548556
break;
549557
}
550-
retries = retries.saturating_add(1);
551558
}
552559
// debug!("Worker {worker_id} DL chunk done {next_chunk}: {retries}");
553560

rust/deny.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ allow-git = [
6363
"https://github.com/input-output-hk/mithril",
6464
# Maintained fork of an archived crates-io version.
6565
"https://github.com/dariusc93/rust-ipfs",
66+
# TODO(dt-iohk): remove this when changes from forked flutter_rust_bridge are merged into the official version
67+
"https://github.com/input-output-hk/catalyst_flutter_rust_bridge",
6668
]
6769

6870
[licenses]
@@ -109,7 +111,6 @@ crate = "ring"
109111
expression = "MIT"
110112
license-files = [{ path = "LICENSE", hash = 0xbd0eed23 }]
111113

112-
113114
# SPDX considers OpenSSL to encompass both the OpenSSL and SSLeay licenses
114115
# https://spdx.org/licenses/OpenSSL.html
115116
# ISC - Both BoringSSL and ring use this for their new files

0 commit comments

Comments
 (0)