-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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!: deprecate blocktime on context #17738
Conversation
@@ -106,7 +106,7 @@ func (k msgServer) CreateValidator(ctx context.Context, msg *types.MsgCreateVali | |||
|
|||
commission := types.NewCommissionWithTime( | |||
msg.Commission.Rate, msg.Commission.MaxRate, | |||
msg.Commission.MaxChangeRate, sdkCtx.BlockHeader().Time, | |||
msg.Commission.MaxChangeRate, sdkCtx.HeaderInfo().Time, |
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 think for these kind of changes need an UPGRADING.md section (Unreleased > Modules > All)
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.
this isnt required to be changed as part of this pr. I migrated to be consistent throughout the repo
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.
You are right, the getter is an alias to the headerinfo, commented before seing it 😅
This does make my other comment even more relevant however.
types/context.go
Outdated
@@ -175,6 +173,7 @@ func (c Context) WithHeaderHash(hash []byte) Context { | |||
|
|||
// WithBlockTime returns a Context with an updated CometBFT block header time in UTC with no monotonic component. | |||
// Stripping the monotonic component is for time equality. | |||
// Deprecated: use WithHeaderInfo instead | |||
func (c Context) WithBlockTime(newTime time.Time) Context { |
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 think we should kill the setter but keep the getters.
Otherwise now, WithBlockTime/BlockTime with behave very weirdly as BlockTime gets is from the header info.
Description
pulls out some changes from #17502 as the pr was getting big and had more changes to come.
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