Skip to content

Conversation

@konnov
Copy link

@konnov konnov commented May 6, 2025

I believe that 3sf-mini has a rounding issue:

# If 2/3 voted for the same new valid hash to justify
if count == (2 * state.config.num_validators) // 3:

For instance, if state.config.num_validators == 4, then the above condition evaluates to true on count == 2. This is due to the fact that distributed computing literature often refers to thresholds in rational numbers, e.g., $\frac{2n}{3}$, whereas integer division sometimes gives us a smaller threshold. As a result, if a faulty staker sends different blocks to different peers, the network may get partitioned. I have introduced such a proposer in a fork. Indeed, it keeps growing two and sometimes three chains. I've also noticed scenarios in the simulations, in which validators were forgetting finalized blocks:

image

This PR proposes a fix that avoids integer division:

        if 3 * count > 2 * state.config.num_validators:

With this fix in place, the simulation seems to work fine, even in the presence of a faulty proposer.

@konnov
Copy link
Author

konnov commented May 7, 2025

This is related to the post Simplifying the L1 by @vbuterin

@Arkeo35
Copy link

Arkeo35 commented Jul 10, 2025

good work

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.

2 participants