dusk-network / dips

Dusk Improvement Proposals
0 stars 1 forks source link

Proposal: Change "Accepted" block label definition #8

Open herr-seppia opened 8 months ago

herr-seppia commented 8 months ago

1. Preamble

2. Abstract

Flag block accepted after executing fallback to "Accepted" instead of apply "Instant Finality" define here https://github.com/dusk-network/rusk/issues/1118

3. Motivation

Until the proper "Rolling Finality" is implemented, there is the need to avoid stalled fork. Currently, due to the naive implementation of rolling finality implemented by https://github.com/dusk-network/rusk/pull/1211, there is an edge case when a node N is marking a block as final, while the rest of the network is marking another chain as final too. Example: Block #80 - Accepted at iteration=1 with NoQuorum for iteration=0 Block #81..#99 -> Attested While the network is accepting block #100 (marking it final for any reason) a very slow node N can receive block #80 at iteration=0 and executing the fallback properly.

This lead the node N to an inconsistent state where it's not able to sync with the current network.

Changing the local applied finality to "Accepted" for the first accepted block after a fallback, will allow the node to revert to last finalized state

4. Technical Specification

In addition to what specified above, the out-of-sync detection should be changed to revert to last finalized block when idle and receiving blocks with height greater than RollingFinalityThreshold that are not able to be accepted due to "invalid previous block hash" error.

5. Rationale

Discussion on the decision-making process and trade-offs considered. TBD

6. Backwards Compatibility

Analysis of how the proposal interacts with existing features or might affect backward compatibility. TBD

Test Cases

Practical examples and test cases for validating the proposed changes. TBD

8. Implementation

Reference to the implementation code; this may include links to PRs in external repositories. TBD

9. Security Considerations

Assessment of potential security implications and how they are addressed. TBD

10. References

https://github.com/dusk-network/rusk/issues/1118 https://github.com/dusk-network/rusk/pull/1211

11. Updates (Optional)

Documenting significant changes or updates to the proposal post-acceptance. TBD

autholykos commented 8 months ago

TBC, does this mean that this DIP proposal would modify the definition of finality as follows?

A node marks a block as final when either:

  • the node accepts the block candidate at iteration 0, the previous block is marked as final, and this is not the first block accepted after a fallback OR
  • the node accepts the block candidate at an iteration N, all N-1 previous iterations have a Quorum, the previous block is marked as final, and this is not the the first block accepted after a fallback OR
  • the node accepts the block candidate in accordance to the rules of the rolling finality, and this is not the first block accepted after a fallback
herr-seppia commented 8 months ago

I would collapse the first 2 using the concept of ATTESTED blocks defined by https://github.com/dusk-network/rusk/issues/1158

Anyway, the result is the same, it just change where we want to introduce exceptions into the definitions

I believe that If from fallback: then always mark Accepted; otherwise do everything as it is right now is the more concise way

autholykos commented 7 months ago

Fair point

fed-franz commented 7 months ago

I think this is superseded by #11