Skip to content

Commit

Permalink
GH-2057 Remove unneeded hs_dpos_irreversible_blocknum
Browse files Browse the repository at this point in the history
  • Loading branch information
heifner committed Mar 12, 2024
1 parent 118a401 commit fae1142
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ using signer_callback_type = std::function<std::vector<signature_type>(const dig

struct block_header_state_legacy;

// totem for dpos_irreversible_blocknum after hotstuff is activated
// This value implicitly means that fork_database will prefer hotstuff blocks over dpos blocks
constexpr uint32_t hs_dpos_irreversible_blocknum = std::numeric_limits<uint32_t>::max();

namespace detail {
struct block_header_state_legacy_common {
uint32_t block_num = 0;
Expand Down Expand Up @@ -83,7 +79,7 @@ struct pending_block_header_state_legacy : public detail::block_header_state_leg
/**
* @struct block_header_state
*
* Algorithm for producer schedule change (pre-hostuff)
* Algorithm for producer schedule change (pre-savanna)
* privileged contract -> set_proposed_producers(producers) ->
* global_property_object.proposed_schedule_block_num = current_block_num
* global_property_object.proposed_schedule = producers
Expand Down
4 changes: 2 additions & 2 deletions plugins/producer_plugin/producer_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1898,8 +1898,8 @@ producer_plugin_impl::start_block_result producer_plugin_impl::start_block() {
try {
uint16_t blocks_to_confirm = 0;

auto block_state = chain.head_block_state_legacy(); // null means if is active
if (in_producing_mode() && block_state && block_state->dpos_irreversible_blocknum != hs_dpos_irreversible_blocknum) { // only if hotstuff not enabled
auto block_state = chain.head_block_state_legacy(); // null means savanna is active
if (in_producing_mode() && block_state) { // only if savanna not enabled
// determine how many blocks this producer can confirm
// 1) if it is not a producer from this node, assume no confirmations (we will discard this block anyway)
// 2) if it is a producer on this node that has never produced, the conservative approach is to assume no
Expand Down

0 comments on commit fae1142

Please sign in to comment.