fix: ValidatorStore interface doesn't match StakingKeeper#17164
Conversation
This comment has been minimized.
This comment has been minimized.
We could just have a function call in /integration/ to, it does not pollute simapp. |
julienrbrt
left a comment
There was a problem hiding this comment.
We should update the ADR as well
|
Moving this to draft as I'm writing an integration test |
can we import baseapp for now into staking to make sure it matches, later on we can fix the dependency but for now i think its fine |
I wanted to avoid this if possible honestly. I think we tweak the API(s) to avoid this but if we cannot, then yes, this is a fallback |
|
@tac0turtle @alexanderbez I just saw your comments, in my last commit I've added the necessary APIs to the staking keeper + an integration test. lmk what you think |
| } | ||
|
|
||
| sumVP = sumVP.Add(validator.BondedTokens()) | ||
| bondedTokens, err := valStore.BondedTokensByConsAddr(ctx, valConsAddr) |
There was a problem hiding this comment.
Curious, isn't it slower now because we get the validator twice? While before only once.
It is probably negligible but just curious. :D
There was a problem hiding this comment.
Yes, it will be slower sadly. We could have a specific API that returns both bonded tokens and public key, wdyt?
There was a problem hiding this comment.
No objection to that personally.
There was a problem hiding this comment.
@facundomedica yes let's do that. This will be used in the VE hotpath so we don't want obvious performance slowdowns
There was a problem hiding this comment.
Added BondedTokensAndPubKeyByConsAddr
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com> (cherry picked from commit c3ae0b0) # Conflicts: # CHANGELOG.md
Description
Closes: #17163
We had to add the necessary functions directly to the Staking Keeper given that when you have an interface with a function that returns another interface, you can't make another interface comply because the returning interface won't be accepted (example: https://go.dev/play/p/tz50jVl0NBw).
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...
!to the type prefix if API or client breaking changeCHANGELOG.mdmake lintandmake testReviewers 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...
!in the type prefix if API or client breaking change