Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Amend AcknowledgePacket to handle flushing #3922
Amend AcknowledgePacket to handle flushing #3922
Changes from all commits
39070be
ffa311e
864011a
aef4e8f
27bbd5e
f76b257
3ed00e9
6e3e520
f794a4b
d247777
6be48f0
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
how does this read to folks? Can refactor in a similar way to SendPacket but this conditional isn't as beefy.
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.
Don't we want to be able to process acks in
TRYUPGRADE
andACKUPGRADE
states?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.
yeah but only if we're flushing, right?
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.
aha, yea this is kind of subtle
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.
super duper nit:
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'm honestly not sure what avenue to chose when doing this sort of error checking.
suite.Require.NoError
is super nice when it doesn't result in a behemoth of a line. When the line length gets excessive, I'm more in favor of having the assignment since it helps when visually parsing things.In the current file, we do go with
err = ...
followed bysuite.Require().NoError(err)
withRecvPacket
, I'm happy to switch it up here.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 am honestly not so opinionated, it's just some feedback I've gotten before that I thought made sense so I'm passing it along now. but I also see your reasoning with the line length, so I think it's just up to you here :) no need to push another commit if you feel it's more readable this way!
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 could also reuse this rather than fully building the expected packet here
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.
curiously, this doesn't work, events are empty, am not seeing why
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, calling
CommitBlock
in the endpoint'sSendPacket
probably flushes the events from the event manager on the current context. So by the time we're usingsuite.chainA.GetContext()
here its actually a new ctx...Most certainly easier to leave this as is, forget my suggestion 😅
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.
specifically its when we call
NextBlock
in the testing pkg, this will call abciCommit()
andBeginBlock()
which will create a new ctx https://github.com/cosmos/cosmos-sdk/blob/v0.47.3/baseapp/abci.go#L184-L193There 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.
now that's what I call
musiccontext ❤️