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] Add new testcase where finality advances on alternate branch with lesser lib #782

Merged
merged 9 commits into from
Sep 18, 2024

Conversation

greg7mdp
Copy link
Contributor

@greg7mdp greg7mdp commented Sep 13, 2024

Add a testcase where finalizers cannot vote on a block from a different branch because they are locked on a block from their own branch.

/* -----------------------------------------------------------------------------------------------------
            Finality advancing past block claimed on alternate branch
            =========================================================

Time:        t1      t2      t3      t4      t5      t6      t7   
Blocks:
    B0 <---  B1 <--- B2 <--- B3 <-|- B4 <--- B5
                                  |
                                  \----------------- B6 <--- B7
QC claim:
           Strong          Strong  Strong  Strong  Strong   No QC
             B0              B1      B3      B4      B2     achieved

Vote:                      Strong  Strong   Strong  Weak     -

                                                     ^
                                                     |
                                                 validating those weak votes on b2
                                                 would fail if nodes have received b4 and b5
                                                 which advanced lib to b3

    - Node D is isolated and has not seen B3, B4, and B5
    - it received B3 via push_block, (so it can make it its head and produce a child of B3), but has not
      received votes on b3 (only on b2), so b6 includes a strong QC on b2.
    - when b6 is pushed to A, B and C, finalizers of A, B, and C are unable to vote on it, because they
      are locked on B4,
          -> liveness check fails because: `B6' s core.latest_qc_block_timestamp() <  fsi.lock.timestamp`
             because `B2 timestamp < B4 timestamp`.
          -> safety check fails because `B6` does not extend `B4`.
--------------------------------------------------------------------------------------------------------*/

After voting on B5 (which makes B3 final), the finalizers who voted on B5 are locked on B4, and therefore cannot vote on B6:

  • liveness check fails because: B6' s core.latest_qc_block_timestamp() < fsi.lock.timestamp because
    B2 timestamp < B4 timestamp.
  • safety check fails because B6 does not extend B4.

As a result, this testcase reproduces the scenario described above, and verifies that we lack votes to form a QC on B6.

Although until issue #778 is addressed, the problem described in issue #778 is the cause of the lack of votes, and decide_vote is not even called.

@greg7mdp greg7mdp changed the base branch from main to release/1.0 September 13, 2024 19:21
@ericpassmore
Copy link
Contributor

Note:start
category: Tests
component: Internal
summary: New test case where finality advances on lesser LIB.
Note:end

@heifner heifner changed the title Add new testcase where finality advances on alternate branch with lesser lib [1.0.2] Add new testcase where finality advances on alternate branch with lesser lib Sep 18, 2024
unittests/savanna_cluster.hpp Outdated Show resolved Hide resolved
unittests/savanna_misc_tests.cpp Outdated Show resolved Hide resolved
unittests/savanna_misc_tests.cpp Outdated Show resolved Hide resolved
@greg7mdp greg7mdp merged commit 91931e6 into release/1.0 Sep 18, 2024
36 checks passed
@greg7mdp greg7mdp deleted the gh_751 branch September 18, 2024 19:58
@arhag arhag added this to the Spring v1.0.2 milestone Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants