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: Bring back is_needed to avoid adding redundant QCs to blocks; enforce sensible finalizer policy in setfinalizers host function #2137

Merged
merged 3 commits into from
Jan 25, 2024

Conversation

linh2931
Copy link
Member

@linh2931 linh2931 commented Jan 25, 2024

  • If the QC claim in the to-be-assembled block is the same (same block number and strong/weak status) as the QC claim in the previous block, then the QC should not be included in the block extension. is_needed was removed by IF: Simplify code path when validating a received block. #2111 due to test failure. There was actually a bug in the original use of is_needed. It should have been used against parent block. This PR brings back is_needed and fixes the bug.

  • If the sum of weights is less than threshold, the quorum will never be met. This PR asserts that the sum of the weights is greater than or equal to the threshold within the setfinalizers host function,

Resolved #2136

@heifner
Copy link
Member

heifner commented Jan 25, 2024

Seems we need AntelopeIO/reference-contracts#41

/__w/leap/leap/reference-contracts/tests/main.cpp(19): fatal error: in "eosio_bios_if_tests/set_1_finalizer": Caught Unexpected Exception
3070002 wasm_execution_error: Runtime Error Processing WASM
Finalizer policy threshold (4) cannot be met by finalizer weights (3)
    {"t":4,"w":3}

Before libtester tests will pass.

@heifner
Copy link
Member

heifner commented Jan 25, 2024

This does seem to fix the test failures I was seeing, here is a run of #2124 with this PR merged into it: https://github.com/AntelopeIO/leap/actions/runs/7649477360

@linh2931 linh2931 changed the title IF: Avoid adding redundant QCs to blocks; enforce sensible finalizer policy in setfinalizers host function IF: Bring back is_needed to avoid adding redundant QCs to blocks; enforce sensible finalizer policy in setfinalizers host function Jan 25, 2024
@linh2931 linh2931 merged commit 9071262 into hotstuff_integration Jan 25, 2024
26 checks passed
@linh2931 linh2931 deleted the qc_is_needed branch January 25, 2024 19:14
@ericpassmore
Copy link
Contributor

Note:start
group: IF
category: INTERNALS
summary: Avoid adding redundant QCs to blocks, by bringing back is_needed
Note: end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants