@@ -5,14 +5,13 @@ use acropolis_common::{
55 epoch_snapshot:: SnapshotsContainer ,
66 ledger_state:: SPOState ,
77 snapshot:: {
8- protocol_parameters:: ProtocolParameters ,
98 streaming_snapshot:: { AccountsCallback , GovernanceProtocolParametersCallback } ,
109 utxo:: UtxoEntry ,
1110 AccountState , DRepCallback , EpochCallback , GovernanceProposal , PoolCallback ,
1211 ProposalCallback , SnapshotCallbacks , SnapshotMetadata , SnapshotsCallback ,
1312 StreamingSnapshotParser , UtxoCallback ,
1413 } ,
15- DRepCredential , NetworkId , PoolRegistration ,
14+ DRepCredential , NetworkId , PoolRegistration , ProtocolParamUpdate , RewardParams ,
1615} ;
1716use anyhow:: Result ;
1817use std:: collections:: HashMap ;
@@ -39,9 +38,9 @@ struct CountingCallbacks {
3938 sample_accounts : Vec < AccountState > ,
4039 sample_dreps : Vec < ( DRepCredential , DRepRecord ) > ,
4140 sample_proposals : Vec < GovernanceProposal > ,
42- gs_previous_params : Option < ProtocolParameters > ,
43- gs_current_params : Option < ProtocolParameters > ,
44- gs_future_params : Option < ProtocolParameters > ,
41+ previous_reward_params : Option < RewardParams > ,
42+ current_reward_params : Option < RewardParams > ,
43+ params : Option < ProtocolParamUpdate > ,
4544}
4645
4746impl UtxoCallback for CountingCallbacks {
@@ -200,106 +199,138 @@ impl GovernanceProtocolParametersCallback for CountingCallbacks {
200199 fn on_gs_protocol_parameters (
201200 & mut self ,
202201 epoch : u64 ,
203- gs_previous_params : ProtocolParameters ,
204- gs_current_params : ProtocolParameters ,
205- gs_future_params : ProtocolParameters ,
202+ previous_reward_params : RewardParams ,
203+ current_reward_params : RewardParams ,
204+ params : ProtocolParamUpdate ,
206205 ) -> Result < ( ) > {
207206 eprintln ! ( "\n === Governance Protocol Parameters for epoch {epoch} ===\n " ) ;
208207
209- eprintln ! ( "Previous Protocol Parameters:" ) ;
208+ eprintln ! ( "Previous Reward Parameters:" ) ;
209+ eprintln ! ( " Expansion rate {}" , previous_reward_params. expansion_rate) ;
210210 eprintln ! (
211- " Protocol Version: {}. {}" ,
212- gs_previous_params . protocol_version . major , gs_previous_params . protocol_version . minor
211+ " Treasury growth rate {}" ,
212+ previous_reward_params . treasury_growth_rate
213213 ) ;
214- eprintln ! ( " Min Fee A: {}" , gs_previous_params. min_fee_a) ;
215- eprintln ! ( " Min Fee B: {}" , gs_previous_params. min_fee_b) ;
216214 eprintln ! (
217- " Max Block Body Size : {}" ,
218- gs_previous_params . max_block_body_size
215+ " Desired number of pools : {}" ,
216+ previous_reward_params . desired_number_of_stake_pools
219217 ) ;
220218 eprintln ! (
221- " Max Transaction Size : {}" ,
222- gs_previous_params . max_transaction_size
219+ " Pledge influence : {}" ,
220+ previous_reward_params . pool_pledge_influence
223221 ) ;
222+ eprintln ! ( " Min pool cost: {}" , previous_reward_params. min_pool_cost) ;
223+
224+ eprintln ! ( "\n Current Reward Parameters:" ) ;
225+ eprintln ! ( " Expansion rate: {}" , current_reward_params. expansion_rate) ;
224226 eprintln ! (
225- " Max Block Header Size : {}" ,
226- gs_previous_params . max_block_header_size
227+ " Treasury growth rate : {}" ,
228+ current_reward_params . treasury_growth_rate
227229 ) ;
228230 eprintln ! (
229- " Stake Pool Deposit : {}" ,
230- gs_previous_params . stake_pool_deposit
231+ " Desired number of pools : {}" ,
232+ current_reward_params . desired_number_of_stake_pools
231233 ) ;
232234 eprintln ! (
233- " Stake Credential Deposit : {}" ,
234- gs_previous_params . stake_credential_deposit
235+ " Pledge influence : {}" ,
236+ current_reward_params . pool_pledge_influence
235237 ) ;
236- eprintln ! ( " Min Pool Cost: {}" , gs_previous_params. min_pool_cost) ;
238+ eprintln ! ( " Min pool cost: {}" , current_reward_params. min_pool_cost) ;
239+
240+ eprintln ! ( "\n Bootstrap Parameters:" ) ;
241+ eprintln ! ( " Min fee a: {}" , params. minfee_a. unwrap( ) ) ;
242+ eprintln ! ( " Min fee b: {}" , params. minfee_b. unwrap( ) ) ;
237243 eprintln ! (
238- " Monetary Expansion: {}/{}" ,
239- gs_previous_params. monetary_expansion_rate. numerator,
240- gs_previous_params. monetary_expansion_rate. denominator
244+ " Max block body size: {}" ,
245+ params. max_block_body_size. unwrap( )
241246 ) ;
242247 eprintln ! (
243- " Treasury Expansion: {}/{}" ,
244- gs_previous_params. treasury_expansion_rate. numerator,
245- gs_previous_params. treasury_expansion_rate. denominator
248+ " Max transaction size: {}" ,
249+ params. max_transaction_size. unwrap( )
246250 ) ;
247-
248- eprintln ! ( "\n Current Protocol Parameters:" ) ;
249251 eprintln ! (
250- " Protocol Version: {}. {}" ,
251- gs_current_params . protocol_version . major , gs_current_params . protocol_version . minor
252+ " Max block header size: {}" ,
253+ params . max_block_header_size . unwrap ( )
252254 ) ;
253- eprintln ! ( " Min Fee A: {}" , gs_current_params. min_fee_a) ;
254- eprintln ! ( " Min Fee B: {}" , gs_current_params. min_fee_b) ;
255+ eprintln ! ( " Key deposit: {}" , params. key_deposit. unwrap( ) ) ;
256+ eprintln ! ( " Pool deposit: {}" , params. pool_deposit. unwrap( ) ) ;
257+ eprintln ! ( " Pool max retire epoch: {}" , params. maximum_epoch. unwrap( ) ) ;
255258 eprintln ! (
256- " Max Block Body Size : {}" ,
257- gs_current_params . max_block_body_size
259+ " Desired number of stake pools : {}" ,
260+ params . desired_number_of_stake_pools . unwrap ( )
258261 ) ;
259262 eprintln ! (
260- " Max Transaction Size : {}" ,
261- gs_current_params . max_transaction_size
263+ " Pool pledge influence : {}" ,
264+ params . pool_pledge_influence . clone ( ) . unwrap ( )
262265 ) ;
263266 eprintln ! (
264- " Max Block Header Size : {}" ,
265- gs_current_params . max_block_header_size
267+ " Monetary expansion rate : {}" ,
268+ params . expansion_rate . clone ( ) . unwrap ( )
266269 ) ;
267270 eprintln ! (
268- " Stake Pool Deposit : {}" ,
269- gs_current_params . stake_pool_deposit
271+ " Treasury growth rate : {}" ,
272+ params . treasury_growth_rate . clone ( ) . unwrap ( )
270273 ) ;
274+ eprintln ! ( " Min pool cost: {}" , params. min_pool_cost. unwrap( ) ) ;
271275 eprintln ! (
272- " Stake Credential Deposit : {}" ,
273- gs_current_params . stake_credential_deposit
276+ " Execution prices : {:? }" ,
277+ params . execution_costs . clone ( ) . unwrap ( )
274278 ) ;
275- eprintln ! ( " Min Pool Cost: {}" , gs_current_params. min_pool_cost) ;
276279 eprintln ! (
277- " Monetary Expansion: {}/{}" ,
278- gs_current_params. monetary_expansion_rate. numerator,
279- gs_current_params. monetary_expansion_rate. denominator
280+ " Max execution units: {:?}" ,
281+ params. max_block_ex_units. unwrap( )
280282 ) ;
283+ eprintln ! ( " Max value size: {:?}" , params. max_value_size. unwrap( ) ) ;
281284 eprintln ! (
282- " Treasury Expansion: {}/{}" ,
283- gs_current_params. treasury_expansion_rate. numerator,
284- gs_current_params. treasury_expansion_rate. denominator
285+ " Collateral percentage: {:?}" ,
286+ params. collateral_percentage. unwrap( )
287+ ) ;
288+ eprintln ! (
289+ " Max collateral inputs: {:?}" ,
290+ params. max_collateral_inputs. unwrap( )
291+ ) ;
292+ eprintln ! (
293+ " Coins per UTxO byte: {:?}" ,
294+ params. coins_per_utxo_byte. unwrap( )
295+ ) ;
296+ eprintln ! (
297+ " Min committee size: {:?}" ,
298+ params. min_committee_size. unwrap( )
299+ ) ;
300+ eprintln ! (
301+ " Max committee term limit: {:?}" ,
302+ params. committee_term_limit. unwrap( )
303+ ) ;
304+ eprintln ! (
305+ " Governance action validity period: {:?}" ,
306+ params. governance_action_validity_period. unwrap( )
307+ ) ;
308+ eprintln ! (
309+ " Governance action deposit: {:?}" ,
310+ params. governance_action_deposit. unwrap( )
311+ ) ;
312+ eprintln ! ( " DRep deposit: {:?}" , params. drep_deposit. unwrap( ) ) ;
313+ eprintln ! (
314+ " DRep inactivity period: {:?}" ,
315+ params. drep_inactivity_period. unwrap( )
316+ ) ;
317+ eprintln ! (
318+ " Min fee refscript cost per byte: {:?}" ,
319+ params. minfee_refscript_cost_per_byte. clone( ) . unwrap( )
285320 ) ;
286-
287- eprintln ! ( "\n Future Protocol Parameters:" ) ;
288321 eprintln ! (
289- " Protocol Version : {}.{ }" ,
290- gs_future_params . protocol_version . major , gs_future_params . protocol_version . minor
322+ " Decentralization constant : {:? }" ,
323+ params . decentralisation_constant . clone ( ) . unwrap ( )
291324 ) ;
292- eprintln ! ( " Min Fee A: {}" , gs_future_params. min_fee_a) ;
293- eprintln ! ( " Min Fee B: {}" , gs_future_params. min_fee_b) ;
294325 eprintln ! (
295- " Max Block Body Size : {}" ,
296- gs_future_params . max_block_body_size
326+ " Protocol version : {:? }" ,
327+ params . protocol_version . clone ( ) . unwrap ( )
297328 ) ;
298329
299330 // Store for later display
300- self . gs_previous_params = Some ( gs_previous_params ) ;
301- self . gs_current_params = Some ( gs_current_params ) ;
302- self . gs_future_params = Some ( gs_future_params ) ;
331+ self . previous_reward_params = Some ( previous_reward_params ) ;
332+ self . current_reward_params = Some ( current_reward_params ) ;
333+ self . params = Some ( params ) ;
303334
304335 eprintln ! ( "\n === End Protocol Parameters ===\n " ) ;
305336 Ok ( ( ) )
0 commit comments