From f0f70b50daca5cc0396cec0c42514a84b3926b78 Mon Sep 17 00:00:00 2001 From: Igor Marcos Borges da Cruz Date: Wed, 10 Jun 2026 14:37:22 +0200 Subject: [PATCH] Scale DHF proposal payouts by hbd_print_rate --- libraries/chain/util/dhf_processor.cpp | 8 ++++++++ libraries/protocol/hardfork.d/1_30.hf | 20 +++++++++++++++++++ .../include/hive/protocol/hardfork_block.hpp | 1 + 3 files changed, 29 insertions(+) create mode 100644 libraries/protocol/hardfork.d/1_30.hf diff --git a/libraries/chain/util/dhf_processor.cpp b/libraries/chain/util/dhf_processor.cpp index 7e77cc2c42..205ced8b16 100644 --- a/libraries/chain/util/dhf_processor.cpp +++ b/libraries/chain/util/dhf_processor.cpp @@ -199,6 +199,14 @@ void dhf_processor::transfer_payments( const time_point_sec& head_time, HBD_asse period_pay = HBD_asset( fc::uint128_to_int64( ratio * _item.daily_pay.amount.value ) / HIVE_100_PERCENT ); } + if( db.has_hardfork( HIVE_HARDFORK_1_30_SCALE_DHF_PAYOUT_BY_HBD_PRINT_RATE ) ) + { + const auto& gpo = db.get_dynamic_global_properties(); + period_pay.amount = ( period_pay.amount * gpo.get_hbd_print_rate() ) / HIVE_100_PERCENT; + if( period_pay.amount <= 0 ) + continue; + } + if( period_pay >= maintenance_budget_limit ) { processing( _item, maintenance_budget_limit ); diff --git a/libraries/protocol/hardfork.d/1_30.hf b/libraries/protocol/hardfork.d/1_30.hf new file mode 100644 index 0000000000..4b9aaeb494 --- /dev/null +++ b/libraries/protocol/hardfork.d/1_30.hf @@ -0,0 +1,20 @@ +#ifndef HIVE_HARDFORK_1_30 +#define HIVE_HARDFORK_1_30 30 + +// Far-future default so HF30 never auto-activates on testnets that don't explicitly +// schedule it. Tests that exercise HF30 behavior must either (a) include HF30 in their +// alternate-chain-spec hardfork_schedule, or (b) use inject_hardfork() to activate it. +// 4102444800 = 2100-01-01T00:00:00Z +#define HIVE_HARDFORK_1_30_DEFAULT_TIME 4102444800L + +#ifdef USE_ALTERNATE_CHAIN_ID +#define HIVE_HARDFORK_1_30_TIME (hive::protocol::testnet_blockchain_configuration::configuration_data.get_hf_time(HIVE_HARDFORK_1_30, HIVE_HARDFORK_1_30_DEFAULT_TIME)) +#else +#define HIVE_HARDFORK_1_30_TIME HIVE_HARDFORK_1_30_DEFAULT_TIME +#endif + +#define HIVE_HARDFORK_1_30_VERSION hive::protocol::hardfork_version( 1, 30 ) + +// scale DHF proposal payouts by hbd_print_rate during HBD debt stress +#define HIVE_HARDFORK_1_30_SCALE_DHF_PAYOUT_BY_HBD_PRINT_RATE (HIVE_HARDFORK_1_30) +#endif diff --git a/libraries/protocol/include/hive/protocol/hardfork_block.hpp b/libraries/protocol/include/hive/protocol/hardfork_block.hpp index f0dfcc7a85..4ee1082770 100644 --- a/libraries/protocol/include/hive/protocol/hardfork_block.hpp +++ b/libraries/protocol/include/hive/protocol/hardfork_block.hpp @@ -29,3 +29,4 @@ #define HIVE_HARDFORK_1_27_BLOCK 69050084 #define HIVE_HARDFORK_1_28_BLOCK 101319928 #define HIVE_HARDFORK_1_29_BLOCK 150000000 +#define HIVE_HARDFORK_1_30_BLOCK 150000001