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

Backport of https://github.com/cosmos/cosmos-sdk/pull/18959 #538

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

ValarDragon
Copy link
Member

@ValarDragon ValarDragon commented Feb 22, 2024

Slight state compatible speedup to slashing.GetParams

This is a .3% state machine processing time speedup on IAVL v0, .5% on v1 no fast nodes.

Backporting this to more easily backport our more significant write reduction PR we made upstream.

@@ -19,7 +19,8 @@
// Iterate over all the validators which *should* have signed this block
// store whether or not they have actually signed it and slash/unbond any
// which have missed too many blocks in a row (downtime slashing)
params := k.GetParams(ctx)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already had this panic path alas

for _, voteInfo := range req.LastCommitInfo.GetVotes() {
k.HandleValidatorSignature(ctx, voteInfo.Validator.Address, voteInfo.Validator.Power, voteInfo.SignedLastBlock)
k.HandleValidatorSignatureWithParams(ctx, params, voteInfo.Validator.Address, voteInfo.Validator.Power, voteInfo.SignedLastBlock)

Check warning

Code scanning / CodeQL

Panic in BeginBock or EndBlock consensus methods Warning

path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
path flow from Begin/EndBlock to a panic call
Copy link
Member

@czarcas7ic czarcas7ic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@ValarDragon ValarDragon merged commit c4a2b32 into osmo/v0.47.5 Feb 23, 2024
23 checks passed
@ValarDragon ValarDragon deleted the dev/slashing_params_speedup branch February 23, 2024 00:00
mergify bot pushed a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)
mergify bot pushed a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)
mergify bot pushed a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)
ValarDragon added a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)

Co-authored-by: Dev Ojha <[email protected]>
ValarDragon added a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)

Co-authored-by: Dev Ojha <[email protected]>
ValarDragon added a commit that referenced this pull request Feb 23, 2024
(cherry picked from commit c4a2b32)

Co-authored-by: Dev Ojha <[email protected]>
czarcas7ic added a commit that referenced this pull request Mar 7, 2024
czarcas7ic added a commit that referenced this pull request Mar 7, 2024
czarcas7ic pushed a commit that referenced this pull request May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants