-
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
refactor(staking): change historicalinfo to contain minimal set of data #17655
Conversation
7783a24
to
750a213
Compare
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
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.
Just dropping a question about naming, PR looks great btw! Thanks 🙏
CHANGELOG.md
Outdated
@@ -160,6 +160,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ | |||
|
|||
* (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Migrate `PreviousProposer` to collections. | |||
* (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp. | |||
* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `Historical`, it removes the validator set and comet header and only keep what is needed for IBC. |
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.
I feel like the changelog does not correspond to the latest updates in this PR.
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.
Can we add a Client Breaking change as well, given that the response of the query will be different?
@@ -25,6 +25,22 @@ var _ types.ValidatorSet = Keeper{} | |||
// Implements DelegationSet interface | |||
var _ types.DelegationSet = Keeper{} | |||
|
|||
func HistoricalInfoCodec(cdc codec.BinaryCodec) collcodec.ValueCodec[types.HistoricalRecord] { |
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, should be in keys.go
for consistency with bank (
cosmos-sdk/x/bank/types/keys.go
Line 39 in c25ddd3
var BalanceValueCodec = collcodec.NewAltValueCodec(sdk.IntValue, func(bytes []byte) (math.Int, error) { |
message HistoricalRecord { | ||
bytes apphash = 1; | ||
google.protobuf.Timestamp time = 2 [(gogoproto.stdtime) = true]; | ||
bytes validator_hash = 3; |
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.
Sorry, I know this is just merged, but should this field be validators_hash
(plural). I can make a PR if you want :)
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.
true i can amend
Description
While speaking with the ibc-go team and rereading the adr it became apparent that only three fields are needed by the ibc team and everything else is redundant. This PR aims to remove the redundant code in order to reduce state bloat
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.md
make lint
andmake test
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...
!
in the type prefix if API or client breaking change