x/slashing/keeper: SlashRedelegation should hoist non-changing ValidatorAddress and DelegatorAddress parsing out of hot loop #18032
Labels
S:orijtech
Squad: OrijTech
T: Performance
Performance improvements
Type: Code Hygiene
General cleanup and restructuring of code to provide clarity, flexibility, and modularity.
Is there an existing issue for this?
What happened?
I was auditing and testing out code in x/slashing/keeper over the weekend and I noticed this code in a loop
cosmos-sdk/x/staking/keeper/slash.go
Lines 310 to 321 in 599b58d
and it doesn't change much so no need to keep it in that loop while redelegating
This fixes it by hoisting that code out
/cc @elias-orijtech
Cosmos SDK Version
main
How to reproduce?
Auditing the code
The text was updated successfully, but these errors were encountered: