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.2] Don't assume that claimed block is in fork_db. #788

Merged
merged 39 commits into from
Oct 2, 2024
Merged

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Sep 16, 2024

Resolves #778.

Update fork_db_validated_block_exists to lookup parents instead of just claimed block.

Also updated the validated member in both block_state_legacy and block_state to be copyable_atomic<bool> instead of bool, which allowed to make the set_valid() and is_valid() members public, and thus eliminate a couple of friend declarations.

libraries/chain/fork_database.cpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Outdated Show resolved Hide resolved
libraries/chain/controller.cpp Show resolved Hide resolved
@greg7mdp greg7mdp changed the base branch from main to release/1.0 September 16, 2024 22:58
@ericpassmore ericpassmore added the bug The product is not working as was intended. label Sep 17, 2024
@ericpassmore
Copy link
Contributor

ericpassmore commented Sep 17, 2024

Note:start
category: Other
component: Internal
summary: Take into account that a claimed block may already be irreversible in consider_voting.
Note:end

unittests/fork_db_tests.cpp Show resolved Hide resolved
unittests/fork_db_tests.cpp Outdated Show resolved Hide resolved
unittests/fork_db_tests.cpp Show resolved Hide resolved
unittests/fork_db_tests.cpp Show resolved Hide resolved
unittests/fork_db_tests.cpp Show resolved Hide resolved
libraries/chain/fork_database.cpp Show resolved Hide resolved
@heifner heifner changed the title Don't assume that claimed block is in fork_db. [1.0.2] Don't assume that claimed block is in fork_db. Sep 24, 2024
arhag
arhag previously requested changes Sep 25, 2024
Copy link
Member

@arhag arhag left a comment

Choose a reason for hiding this comment

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

@greg7mdp:

See #751 (comment) for the test case that works for both #751 and #778.

I think that test should be added here to demonstrate that this PR does in fact resolve the bug reported in #778 properly.

@greg7mdp
Copy link
Contributor Author

greg7mdp commented Oct 1, 2024

I think that test should be added here to demonstrate that this PR does in fact resolve the bug reported in #778 properly.

done.

@greg7mdp
Copy link
Contributor Author

greg7mdp commented Oct 2, 2024

@arhag got two new approvals from Lin and Kevin. Time to merge?

@arhag arhag dismissed their stale review October 2, 2024 04:16

Free to merge

@greg7mdp greg7mdp merged commit 35a9bae into release/1.0 Oct 2, 2024
36 checks passed
@greg7mdp greg7mdp deleted the gh_778 branch October 2, 2024 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The product is not working as was intended.
Projects
None yet
5 participants