-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
perf: Don't deserialize params for every validator in slashing #18959
Conversation
WalkthroughThe changes involve updates to the slashing module, specifically refining how the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit's AI:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
This comment has been minimized.
This comment has been minimized.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
@@ -191,6 +191,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||
* (types) [#18372](https://github.com/cosmos/cosmos-sdk/pull/18372) Removed global configuration for coin type and purpose. Setters and getters should be removed and access directly to defined types. | |||
* (types) [#18695](https://github.com/cosmos/cosmos-sdk/pull/18695) Removed global configuration for txEncoder. | |||
* (server) [#18909](https://github.com/cosmos/cosmos-sdk/pull/18909) Remove configuration endpoint on grpc reflection endpoint in favour of auth module bech32prefix endpoint already exposed. | |||
* (slashing) [#18959](https://github.com/cosmos/cosmos-sdk/pull/18959) Slight speedup to Slashing Beginblock logic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit, changelog of modules should be under their own changelog.
Here x/slashing/changelog.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah thank you will move that
@@ -146,3 +146,13 @@ func validateSlashFractionDowntime(i interface{}) error { | |||
|
|||
return nil | |||
} | |||
|
|||
// return min signed per window as an integer (vs the decimal in the param) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit go doc naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the pr
(cherry picked from commit c4a2b32)
(cherry picked from commit c4a2b32)
(cherry picked from commit c4a2b32)
(cherry picked from commit c4a2b32) Co-authored-by: Dev Ojha <[email protected]>
(cherry picked from commit c4a2b32) Co-authored-by: Dev Ojha <[email protected]>
(cherry picked from commit c4a2b32) Co-authored-by: Dev Ojha <[email protected]>
Description
Pretty light performance improvement. Its a been a consistent small point that validators missed block tracking appears in CPU profiles. (DB key format / data layout is the bigger issue to fixing)
This at least removes the param deserialization of it. I don't have a "fair" benchmark to compare with on-hand over a large period, but on an IAVL v0 benchmark during 100 blocks with high CPU load, it appears params deserialziation is taking
.8%
of the CPU time for block execution.Go tests are broken on my laptop rn for the SDK, hopefully this works without too many back + forths 🙏
I won't be able to fix too many follow-ups in a hot loop because of this, so happy to close if its not worth the overhead. (Or have someone else take over!)
This should be fully state compatible.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...