@@ -63,8 +63,9 @@ pub fn generate_register_signature_message(
63
63
. collect :: < Vec < _ > > ( )
64
64
}
65
65
66
- /// Precompute all signers single signatures for the given fixture
67
- pub async fn precompute_mithril_stake_distribution_signatures (
66
+ /// Compute all signers single signatures for mithril stake distribution for the given fixture
67
+ pub async fn compute_mithril_stake_distribution_signatures (
68
+ epoch : Epoch ,
68
69
signers_fixture : & MithrilFixture ,
69
70
timeout : Duration ,
70
71
) -> StdResult < Vec < SingleSignatures > > {
@@ -75,9 +76,17 @@ pub async fn precompute_mithril_stake_distribution_signatures(
75
76
let mithril_stake_distribution_message = {
76
77
let mut message = ProtocolMessage :: new( ) ;
77
78
message. set_message_part(
78
- mithril_common:: entities:: ProtocolMessagePartKey :: NextAggregateVerificationKey ,
79
- signers_fixture. compute_and_encode_avk( ) ,
80
- ) ;
79
+ mithril_common:: entities:: ProtocolMessagePartKey :: NextAggregateVerificationKey ,
80
+ signers_fixture. compute_and_encode_avk( ) ,
81
+ ) ;
82
+ message. set_message_part(
83
+ mithril_common:: entities:: ProtocolMessagePartKey :: NextProtocolParameters ,
84
+ signers_fixture. protocol_parameters( ) . compute_hash( ) ,
85
+ ) ;
86
+ message. set_message_part(
87
+ mithril_common:: entities:: ProtocolMessagePartKey :: CurrentEpoch ,
88
+ epoch. to_string( ) ,
89
+ ) ;
81
90
82
91
message
83
92
} ;
@@ -89,12 +98,12 @@ pub async fn precompute_mithril_stake_distribution_signatures(
89
98
Ok ( signatures)
90
99
} ,
91
100
timeout,
92
- format!( "Precompute signatures for MithrilStakeDistribution signed entity" ) ,
93
- format!( "Precomputing signatures timeout after {timeout:?}" )
101
+ format!( "Compute signatures for MithrilStakeDistribution signed entity" ) ,
102
+ format!( "Computing signatures timeout after {timeout:?}" )
94
103
)
95
104
}
96
105
97
- /// Compute all signers single signatures for the given fixture
106
+ /// Compute all signers single signatures for immutable files full for the given fixture
98
107
pub async fn compute_immutable_files_signatures (
99
108
cardano_db : & DummyCardanoDb ,
100
109
epoch : Epoch ,
@@ -122,25 +131,33 @@ pub async fn compute_immutable_files_signatures(
122
131
let signers_fixture = signers_fixture. clone( ) ;
123
132
124
133
let signatures = tokio:: task:: spawn_blocking( move || -> Vec <SingleSignatures > {
125
- let mithril_stake_distribution_message = {
134
+ let cardano_immutable_files_full_message = {
126
135
let mut message = ProtocolMessage :: new( ) ;
127
136
message. set_message_part( ProtocolMessagePartKey :: SnapshotDigest , digest) ;
128
137
message. set_message_part(
129
138
ProtocolMessagePartKey :: NextAggregateVerificationKey ,
130
139
signers_fixture. compute_and_encode_avk( ) ,
131
140
) ;
141
+ message. set_message_part(
142
+ mithril_common:: entities:: ProtocolMessagePartKey :: NextProtocolParameters ,
143
+ signers_fixture. protocol_parameters( ) . compute_hash( ) ,
144
+ ) ;
145
+ message. set_message_part(
146
+ mithril_common:: entities:: ProtocolMessagePartKey :: CurrentEpoch ,
147
+ epoch. to_string( ) ,
148
+ ) ;
132
149
133
150
message
134
151
} ;
135
152
136
- signers_fixture. sign_all( & mithril_stake_distribution_message )
153
+ signers_fixture. sign_all( & cardano_immutable_files_full_message )
137
154
} )
138
155
. await ?;
139
156
140
157
Ok ( ( beacon, signatures) )
141
158
} ,
142
159
timeout,
143
- format!( "Precompute signatures for CardanoImmutableFiles signed entity" ) ,
144
- format!( "Precomputing signatures timeout after {timeout:?}" )
160
+ format!( "Compute signatures for CardanoImmutableFiles signed entity" ) ,
161
+ format!( "Computing signatures timeout after {timeout:?}" )
145
162
)
146
163
}
0 commit comments