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

Thv/fix rollback issue #147

Merged
merged 13 commits into from
May 10, 2024
Merged

Thv/fix rollback issue #147

merged 13 commits into from
May 10, 2024

Commits on May 10, 2024

  1. Remove WARN log from function testing block's PoW validity

    This logging disturbs the test-output. And the caller's to this function
    already log correctly if appropriate.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    c5ce76b View commit details
    Browse the repository at this point in the history
  2. feat(archival_state): Add method to get parent block of tip

    We want to use this functionality when we set a new tip header since
    we are going to new the previous block's mutator set.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    99abbdc View commit details
    Browse the repository at this point in the history
  3. archival-state: Always set stored block as tip

    Always set the new block we are storing to disk and indexing in the
    database as the tip. Previously, we would check if this block exceeded
    the proof of work family number of the current tip but this
    responsibility is now delegated to the caller.
    
    This is needed to fix a bug in `store_block_internal_worker` where the
    value `previous_ms_accumulator` is set incorrectly whenever there is a
    fork, i.e. whenever `store_block_internal_worker` receives a block that
    is not the child of what the block currently considers the tip. In order
    to set `previous_ms_accumulator`, we need to know that the block we are
    storing now is considered the tip (by the `ArchivalState`) *and* we need
    a method to fetch the parent of the tip after this function
    `write_block_as_tip` has been called.
    
    Cf. #143.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    09b7f19 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    348748b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4e0e75d View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d8d9298 View commit details
    Browse the repository at this point in the history
  7. Always consider newly added block as tip

    When the global state is updated with a new block, that new block is
    always considered the new tip. This change is reflected in a new name
    for this function also. This allows us to correctly handle state updates
    in the case of forks. Since the block is no longer carrying around the
    previous state of the mutator set accumulator, we have to get that state
    from somewhere else. We elect to get it from the archival state which
    can identify the parent of the current tip.
    
    Cf. #143
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    45c73b5 View commit details
    Browse the repository at this point in the history
  8. refactor(test): Update state through GlobalState's `set_new_tip_int…

    …ernal`
    
    Previously tests had their own helper functions for updating the global
    state. With this commit, most tests now go through the same state
    updater function as the main code. This shortens multiple tests and make
    us more likely to catch errors, like the one in #143.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    c64b790 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8ef7eb5 View commit details
    Browse the repository at this point in the history
  10. Fix tests after redefining behavior of set_new_tip

    After redefining the behavior of the `set_new_tip` to update global state
    with a new block, the function formerly known as `store_block`,  we need
    to rearrange the order in which blocks are added in a few tests. With these
    changes, all tests pass, and #143 is closed.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    b2928eb View commit details
    Browse the repository at this point in the history
  11. fix(test): Fix flaky timelock test

    The timelock test was flaky since it often overflowed on the addition of
    two `BfieldElement`'s.
    
    This closes #148.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    0a540f8 View commit details
    Browse the repository at this point in the history
  12. docs(tip-updater): Elaborate on comments in method to update tip

    Also changes the fn name of the internal worker to match that of the
    outer methods.
    Sword-Smith committed May 10, 2024
    Configuration menu
    Copy the full SHA
    65b283c View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    0b212d1 View commit details
    Browse the repository at this point in the history