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

x/simulation: the liveness matrix no longer affects simulation #17912

Closed
elias-orijtech opened this issue Sep 27, 2023 · 3 comments · Fixed by #21952
Closed

x/simulation: the liveness matrix no longer affects simulation #17912

elias-orijtech opened this issue Sep 27, 2023 · 3 comments · Fixed by #21952

Comments

@elias-orijtech
Copy link
Contributor

elias-orijtech commented Sep 27, 2023

The code that determines whether a simulated validator signs a block,

mVal.livenessState = params.LivenessTransitionMatrix().NextState(r, mVal.livenessState)
signed := true
if mVal.livenessState == 1 {
// spotty connection, 50% probability of success
// See https://github.com/golang/go/issues/23804#issuecomment-365370418
// for reasoning behind computing like this
signed = r.Int63()%2 == 0
} else if mVal.livenessState == 2 {
// offline
signed = false
}
if signed {
event("begin_block", "signing", "signed")
} else {
event("begin_block", "signing", "missed")
}
pubkey, err := cryptoenc.PubKeyFromProto(mVal.val.PubKey)
if err != nil {
panic(err)
}
voteInfos[i] = abci.VoteInfo{
Validator: abci.Validator{
Address: pubkey.Address(),
Power: mVal.val.Power,
},
BlockIdFlag: cmtproto.BlockIDFlagCommit,
}

no longer has any effect on the simulation, but merely collects statistics through the event function pointer.

As pointed out by @alexanderbez, v0.47 does propagate the signing parameter to the simulation:

SignedLastBlock: signed,

This change was made as part of the Comet v0.38 integration, 6cee22d.

@github-actions github-actions bot added the needs-triage Issue that needs to be triaged label Sep 27, 2023
@elias-orijtech
Copy link
Contributor Author

Note that this issue is for posterity; it can be closed once the simulator is replaced.

@tac0turtle tac0turtle added C:Simulations and removed needs-triage Issue that needs to be triaged labels Sep 28, 2023
@github-project-automation github-project-automation bot moved this to 👀 To Do in Cosmos-SDK Nov 17, 2023
@tac0turtle
Copy link
Member

is this solved @alpe

@alpe alpe self-assigned this Sep 27, 2024
@alpe
Copy link
Contributor

alpe commented Sep 27, 2024

No, the liveness metric is not taken into account. All validators "sign" currently

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🥳 Done
Development

Successfully merging a pull request may close this issue.

4 participants