Skip to content

Commit ce90bd0

Browse files
committed
Merge remote-tracking branch 'origin/main' into fix/replace-ulid-with-uuidv7
2 parents 128a800 + e182213 commit ce90bd0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+700
-4222
lines changed

rust/cardano-blockchain-types/src/fork.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,40 @@
66
//!
77
//! Note: This fork terminology is different from fork in blockchain.
88
9+
use std::fmt;
10+
911
use crate::conversion::from_saturating;
1012

1113
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, PartialOrd)]
1214
/// Counter that is incremented every time there is a roll-back in live-chain.
1315
pub struct Fork(u64);
1416

1517
impl Fork {
18+
/// Fork for data that read from the blockchain during a backfill on initial sync
19+
pub const BACKFILL: Self = Self(1);
20+
/// Fork count for the first live block.
21+
pub const FIRST_LIVE: Self = Self(2);
22+
/// Fork for immutable data. This indicates that there is no roll-back.
23+
pub const IMMUTABLE: Self = Self(0);
24+
25+
/// Is the fork for immutable data.
26+
#[must_use]
27+
pub fn is_immutable(&self) -> bool {
28+
self == &Self::IMMUTABLE
29+
}
30+
31+
/// Is the fork for backfill data.
32+
#[must_use]
33+
pub fn is_backfill(&self) -> bool {
34+
self == &Self::BACKFILL
35+
}
36+
37+
/// Is the fork for live data.
38+
#[must_use]
39+
pub fn is_live(&self) -> bool {
40+
self >= &Self::FIRST_LIVE
41+
}
42+
1643
/// Convert an `<T>` to `Fork` (saturate if out of range).
1744
pub fn from_saturating<
1845
T: Copy
@@ -38,6 +65,17 @@ impl Fork {
3865
}
3966
}
4067

68+
impl fmt::Display for Fork {
69+
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
70+
match self.0 {
71+
0 => write!(f, "IMMUTABLE"),
72+
1 => write!(f, "BACKFILL"),
73+
// For live forks: 2 maps to LIVE:1, 3 maps to LIVE:2 etc.
74+
2..=u64::MAX => write!(f, "LIVE:{}", self.0 - 1),
75+
}
76+
}
77+
}
78+
4179
impl From<u64> for Fork {
4280
fn from(value: u64) -> Self {
4381
Self(value)

rust/cardano-blockchain-types/src/multi_era_block_data.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,12 @@ impl MultiEraBlock {
281281

282282
None
283283
}
284+
285+
/// Get the auxiliary data of the block.
286+
#[must_use]
287+
pub fn aux_data(&self) -> &BlockAuxData {
288+
&self.inner.aux_data
289+
}
284290
}
285291

286292
impl Display for MultiEraBlock {

rust/cardano-chain-follower/Cargo.toml

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ pallas = { version = "0.30.1", git = "https://github.com/input-output-hk/catalys
1515
pallas-hardano = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
1616
pallas-crypto = { version = "0.30.1", git = "https://github.com/input-output-hk/catalyst-pallas.git", rev = "9b5183c8b90b90fe2cc319d986e933e9518957b3" }
1717

18-
# mithril-client = { version = "0.10.4", git = "https://github.com/input-output-hk/mithril", rev = "c6c7ebafae0158b2c1672eb96f6ef832fd542f93", default-features = false, features = [
1918
mithril-client = { version = "0.10.4", default-features = false, features = [
2019
"full",
2120
"num-integer-backend",
2221
] }
23-
24-
rbac-registration = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.8" }
22+
cardano-blockchain-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250114-00" }
23+
catalyst-types = { version = "0.0.1", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "r20250108-00" }
2524

2625
thiserror = "1.0.69"
2726
tokio = { version = "1.42.0", features = [
@@ -37,26 +36,20 @@ url = "2.5.4"
3736
anyhow = "1.0.95"
3837
chrono = "0.4.39"
3938
async-trait = "0.1.83"
40-
dirs = "5.0.1"
4139
futures = "0.3.31"
4240
humantime = "2.1.0"
4341
crossbeam-skiplist = "0.1.3"
4442
crossbeam-channel = "0.5.14"
4543
crossbeam-epoch = "0.9.18"
4644
strum = "0.26.3"
47-
ouroboros = "0.18.4"
4845
hex = "0.4.3"
4946
rayon = "1.10.0"
5047
serde = "1.0.217"
5148
serde_json = "1.0.134"
5249
mimalloc = { version = "0.1.43", optional = true }
5350
memx = "0.1.32"
5451
fmmap = { version = "0.3.3", features = ["sync", "tokio-async"] }
55-
minicbor = { version = "0.25.1", features = ["alloc", "derive", "half"] }
5652
zstd = "0.13.2"
57-
ed25519-dalek = "2.1.1"
58-
blake2b_simd = "1.0.2"
59-
num-traits = "0.2.19"
6053
logcall = "0.1.11"
6154
tar = "0.4.43"
6255
ureq = { version = "2.12.1", features = ["native-certs"] }
@@ -65,12 +58,12 @@ hickory-resolver = { version = "0.24.2", features = ["dns-over-rustls"] }
6558
moka = { version = "0.12.9", features = ["sync"] }
6659

6760
[dev-dependencies]
68-
hex = "0.4.3"
6961
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
7062
test-log = { version = "0.2.16", default-features = false, features = [
7163
"trace",
7264
] }
7365
clap = "4.5.23"
66+
# rbac-registration = { version = "0.0.2", git = "https://github.com/input-output-hk/catalyst-libs.git", tag = "v0.0.8" }
7467

7568
# Note, these features are for support of features exposed by dependencies.
7669
[features]

0 commit comments

Comments
 (0)