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

PoS/test: division by zero #1556

Closed
Tracked by #2006
tzemanovic opened this issue Jun 13, 2023 · 3 comments · Fixed by #1612
Closed
Tracked by #2006

PoS/test: division by zero #1556

tzemanovic opened this issue Jun 13, 2023 · 3 comments · Fixed by #1612
Assignees
Labels
bug Something isn't working PoS testing

Comments

@tzemanovic
Copy link
Member

Trace: https://github.com/anoma/namada/actions/runs/5253847650/jobs/9491877974?pr=1549

The state machine test failure is most-like a problem with pre-conditions because get_total_consensus_stake ends up being zero.

@tzemanovic tzemanovic added bug Something isn't working testing PoS labels Jun 13, 2023
@brentstone
Copy link
Collaborator

brentstone commented Jun 13, 2023

I have a local change that somewhat fixes this issue actually. I started doing SM tests with somewhere around 8 consensus validator slots and more genesis validators. Compared to the current config of like 3 or 4 consensus validators, we run into this issue MUCH less frequently (i.e. I never have yet).

At one point I tried to rigorously avoid this issue, but it ended up being tricky, so I abandoned that in favor of this hack.

@brentstone
Copy link
Collaborator

@tzemanovic Are we still concerned with this enough to keep the issue open? Haven't encountered this in a while but don't recall if we've explicitly solved it.

@tzemanovic
Copy link
Member Author

we have a fix for this in #1612 where we account for enqueued slashes in the pre-condition (

// Find the number of enqueued slashes to unique validators
let num_of_enquequed_slashes = state
.enqueued_slashes
.iter()
// find all validators with any enqueued slashes
.fold(BTreeSet::new(), |mut acc, (&epoch, slashes)| {
if epoch > current_epoch {
acc.extend(slashes.keys().cloned());
}
acc
})
.len();
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working PoS testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants