Skip to content

Commit 4d1d164

Browse files
authored
Merge pull request #3168 from input-output-hk/ctl/3098-sign-security-parameter-offset
Sign security parameter offset
2 parents 6a8101a + 606eb90 commit 4d1d164

84 files changed

Lines changed: 3356 additions & 2372 deletions

File tree

Some content is hidden

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

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/client-cardano-block/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-block"
33
description = "Mithril client cardano-block example"
4-
version = "0.1.1"
4+
version = "0.1.2"
55
authors = ["dev@iohk.io", "mithril-dev@iohk.io"]
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-block/src/main.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ pub fn log_certify_information(
9898
println!("Following Cardano blocks have been successfully certified by Mithril.");
9999
for block in verified_blocks.certified_blocks() {
100100
println!(
101-
r###"- block hash '{}', block number '{}', block slot '{}'"###,
102-
block.block_hash, block.block_number, block.slot_number
101+
r###"- block hash '{}', block number '{}', block slot '{}', block depth '{}'"###,
102+
block.block_hash,
103+
block.block_number,
104+
block.slot_number,
105+
verified_blocks.security_parameter()
103106
);
104107
}
105108
}

examples/client-cardano-transaction-v2/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "client-cardano-transaction-v2"
33
description = "Mithril client cardano-transaction-v2 example"
4-
version = "0.1.1"
4+
version = "0.1.2"
55
authors = ["dev@iohk.io", "mithril-dev@iohk.io"]
66
documentation = "https://mithril.network/doc"
77
edition = "2021"

examples/client-cardano-transaction-v2/src/main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,12 @@ pub fn log_certify_information(
106106
println!("Following Cardano transactions have been successfully certified by Mithril.");
107107
for transaction in verified_transactions.certified_transactions() {
108108
println!(
109-
r###"- transaction hash '{}', block hash '{}', block number '{}', transaction slot '{}'"###,
109+
r###"- transaction hash '{}', block hash '{}', block number '{}', transaction slot '{}', block depth '{}'"###,
110110
transaction.transaction_hash,
111111
transaction.block_hash,
112112
transaction.block_number,
113-
transaction.slot_number
113+
transaction.slot_number,
114+
verified_transactions.security_parameter()
114115
);
115116
}
116117
}

internal/mithril-aggregator-client/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-aggregator-client"
3-
version = "0.1.9"
3+
version = "0.1.10"
44
description = "Client to request data from a Mithril Aggregator"
55
authors.workspace = true
66
documentation.workspace = true

internal/mithril-aggregator-client/src/query/get/get_cardano_block_proof.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ mod tests {
7070
}),
7171
non_certified_blocks: vec![],
7272
latest_block_number: Default::default(),
73+
security_parameter: Default::default(),
7374
};
7475
let _server_mock = server.mock(|when, then| {
7576
when.path("/proof/v2/cardano-block")

internal/mithril-aggregator-client/src/query/get/get_cardano_transaction_proof_v2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ mod tests {
7070
}),
7171
non_certified_transactions: vec![],
7272
latest_block_number: Default::default(),
73+
security_parameter: Default::default(),
7374
};
7475

7576
let _server_mock = server.mock(|when, then| {

internal/mithril-persistence/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "mithril-persistence"
3-
version = "0.2.70"
3+
version = "0.2.71"
44
description = "Common types, interfaces, and utilities to persist data for Mithril nodes."
55
authors = { workspace = true }
66
edition = { workspace = true }

internal/mithril-persistence/src/database/hydrator.rs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
use serde::Deserialize;
44

55
use mithril_common::entities::{
6-
BlockNumber, CardanoDbBeacon, Epoch, SignedEntityType, SignedEntityTypeDiscriminants,
6+
BlockNumber, BlockNumberOffset, CardanoDbBeacon, Epoch, SignedEntityType,
7+
SignedEntityTypeDiscriminants,
78
};
89

910
use crate::sqlite::HydrationError;
@@ -90,6 +91,7 @@ impl Hydrator {
9091
struct CardanoBlocksTransactionsBeacon {
9192
epoch: Epoch,
9293
block_number: BlockNumber,
94+
block_number_offset: BlockNumberOffset,
9395
}
9496

9597
let beacon: CardanoBlocksTransactionsBeacon = serde_json::from_str(beacon_str)
@@ -98,7 +100,11 @@ impl Hydrator {
98100
"Invalid Beacon JSON in open_message.beacon: '{beacon_str}'. Error: {e}"
99101
))
100102
})?;
101-
SignedEntityType::CardanoBlocksTransactions(beacon.epoch, beacon.block_number)
103+
SignedEntityType::CardanoBlocksTransactions(
104+
beacon.epoch,
105+
beacon.block_number,
106+
beacon.block_number_offset,
107+
)
102108
}
103109
SignedEntityTypeDiscriminants::CardanoDatabase => {
104110
let beacon: CardanoDbBeacon = serde_json::from_str(beacon_str).map_err(|e| {
@@ -132,7 +138,11 @@ mod tests {
132138

133139
#[test]
134140
fn hydrate_cardano_blocks_transactions_signed_entity_type() {
135-
let expected = SignedEntityType::CardanoBlocksTransactions(Epoch(37), BlockNumber(79));
141+
let expected = SignedEntityType::CardanoBlocksTransactions(
142+
Epoch(37),
143+
BlockNumber(79),
144+
BlockNumberOffset(5),
145+
);
136146
let signed_entity = Hydrator::hydrate_signed_entity_type(
137147
SignedEntityTypeDiscriminants::CardanoBlocksTransactions.index(),
138148
&expected.get_json_beacon().unwrap(),

0 commit comments

Comments
 (0)