Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0-beta4 -> main] Remove last_final_block_timestamp from fork choice rule #445

Merged
merged 3 commits into from
Jul 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions libraries/chain/fork_database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ namespace eosio::chain {

std::string log_fork_comparison(const block_state& bs) {
std::string r;
r += "[ last_final_block_timestamp: " + bs.last_final_block_timestamp().to_time_point().to_iso_string() + ", ";
r += "latest_qc_block_timestamp: " + bs.latest_qc_block_timestamp().to_time_point().to_iso_string() + ", ";
r += "[ latest_qc_block_timestamp: " + bs.latest_qc_block_timestamp().to_time_point().to_iso_string() + ", ";
r += "timestamp: " + bs.timestamp().to_time_point().to_iso_string();
r += "id: " + bs.id().str();
r += " ]";
Expand Down Expand Up @@ -69,11 +68,10 @@ namespace eosio::chain {
using by_best_branch_if_t = ordered_unique<
tag<by_best_branch>,
composite_key<block_state,
const_mem_fun<block_state, block_timestamp_type, &block_state::last_final_block_timestamp>,
const_mem_fun<block_state, block_timestamp_type, &block_state::latest_qc_block_timestamp>,
const_mem_fun<block_state, block_timestamp_type, &block_state::timestamp>,
const_mem_fun<block_state, const block_id_type&, &block_state::id>>,
composite_key_compare<std::greater<block_timestamp_type>, std::greater<block_timestamp_type>,
composite_key_compare<std::greater<block_timestamp_type>,
std::greater<block_timestamp_type>, std::greater<block_id_type>>>;

using by_best_branch_t = std::conditional_t<std::is_same_v<bs_t, block_state>,
Expand Down