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

IF: Update fork database fork-choice rule #2273

Merged
merged 45 commits into from
Mar 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
472b1d4
GH-2125 Optimize fetch_block_branch
heifner Feb 8, 2024
7c19670
GH-2125 Update best fork logic of fork_database.
heifner Feb 13, 2024
8101af0
GH-2125 Update fork_database on strong vote
heifner Feb 13, 2024
5d2a839
GH-2125 Make last_qc_block_num non-optional
heifner Feb 14, 2024
29ddf49
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Feb 14, 2024
57371bd
GH-2125 Move get_activated_protocol_features to block_header_state[_l…
heifner Feb 14, 2024
6ab1146
GH-2125 Remove fork database adaptors and use fork database accessors…
heifner Feb 14, 2024
f8828ac
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Feb 15, 2024
d0f7bf7
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Feb 23, 2024
970528c
GH-2125 Add updated_core and most_recent_ancestor_with_qc to block_st…
heifner Feb 26, 2024
9e0a226
GH-2125 Revert unneeded changes
heifner Feb 26, 2024
17274e2
GH-2125 Potentially switch forks before beginning to produce a block
heifner Feb 27, 2024
842ed6c
GH-2125 Can't have pending block when applying a block
heifner Feb 27, 2024
37a7a17
GH-2125 Use vector instead of deque
heifner Feb 27, 2024
042ffde
GH-2125 Return current state even on error
heifner Feb 27, 2024
1eda923
GH-2125 Rename method to make more clear
heifner Feb 27, 2024
2767821
GH-2125 Use descriptive types
heifner Feb 27, 2024
bc5d464
GH-2125 Change order of eval
heifner Feb 27, 2024
c3847eb
GH-2125 Improve logging
heifner Feb 27, 2024
6a45921
GH-2125 Use descriptive enums instead of bools
heifner Feb 27, 2024
69373f4
GH-2125 Revert unneeded change
heifner Feb 27, 2024
f9dd443
GH-2125 Remove duplicate
heifner Feb 27, 2024
772d74e
GH-2125 Rename most_recent_ancestor_with_qc to best_qc_claim
heifner Feb 27, 2024
2153ba2
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Feb 27, 2024
39b3d3f
GH-2125 Only update best qc on state changes
heifner Feb 27, 2024
3ec3d79
GH-2125 Fix update_best_qc logic for processing descendants
heifner Feb 28, 2024
d9c1b87
GH-2125 use a counter instead of time to ensure unique
heifner Feb 28, 2024
e2f0d4d
GH-2125 Add some comments
heifner Feb 28, 2024
bbe24e7
Merge remote-tracking branch 'origin/hotstuff_integration' into GH-21…
heifner Feb 29, 2024
1471adc
GH-2125 Use simpler fork-choice rule that doesn't change with votes. …
heifner Feb 29, 2024
0f521d4
GH-2125 Advance LIB on producer since producer does not receive its o…
heifner Feb 29, 2024
48f2253
GH-2125 Update tests now that votes do not advance LIB
heifner Feb 29, 2024
cdb5381
GH-2125 trx can become irreversible much quicker than in non-IF
heifner Feb 29, 2024
f9fa56b
GH-2125 Improve test implementation
heifner Feb 29, 2024
7f18b5b
GH-2125 Used claimed final_on_strong_qc_block_num
heifner Feb 29, 2024
c88d6e3
GH-2125 Add search_on_head_branch
heifner Feb 29, 2024
14b04b0
GH-2125 Normalize types
heifner Mar 1, 2024
93a7fee
GH-2125 Add fork_comparison for logging
heifner Mar 1, 2024
04dcfeb
GH-2125 Additional type normalization
heifner Mar 1, 2024
fab0bbe
Use separate `by_best_branch` index definitions.
greg7mdp Mar 1, 2024
31da03f
GH-2125 Remove unneeded bs acccessor methods. Use log_fork_comparison…
heifner Mar 1, 2024
bc827ec
GH-2125 Rename to make more descriptive
heifner Mar 1, 2024
ee5291f
GH-2125 Search on correct branch
heifner Mar 1, 2024
e3059bf
GH-2125 Fix compile error and some more type name changes
heifner Mar 1, 2024
2a2a5da
GH-2125 Simplify search_on_head_branch_impl and add new test cases
heifner Mar 1, 2024
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
3 changes: 2 additions & 1 deletion libraries/chain/controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2807,7 +2807,8 @@ struct controller_impl {
assert(bsp->header_exts.count(if_ext_id) > 0); // in all instant_finality block headers
const auto& if_ext = std::get<instant_finality_extension>(bsp->header_exts.lower_bound(if_ext_id)->second);
if (if_ext.qc_claim.is_strong_qc) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a comment here saying the claim has already been verified before.

auto claimed = forkdb.search_on_head_branch(if_ext.qc_claim.block_num);
// claim has already been verified
auto claimed = forkdb.search_branch(bsp->id(), if_ext.qc_claim.block_num);
linh2931 marked this conversation as resolved.
Show resolved Hide resolved
if (claimed) {
set_if_irreversible_block_num(claimed->core.final_on_strong_qc_block_num);
}
linh2931 marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading