-
Notifications
You must be signed in to change notification settings - Fork 694
feat: rate limit module #8268
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
base: main
Are you sure you want to change the base?
feat: rate limit module #8268
Conversation
ck, ok := ics4Wrapper.(*channelkeeper.Keeper) | ||
if ok { | ||
im.channelKeeper = ck | ||
} else { |
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.
Isn't this going to require ICS4Wrapper to be the channelkeeper. THis is wrong, we want ability to wrap ratelimiting with higher level middleware
packetToCheck := channeltypes.Packet{ | ||
Sequence: seq, | ||
SourcePort: sourcePort, | ||
SourceChannel: sourceChannel, | ||
TimeoutHeight: timeoutHeight, | ||
TimeoutTimestamp: timeoutTimestamp, | ||
Data: data, | ||
} | ||
|
||
err = im.keeper.SendRateLimitedPacket(ctx, packetToCheck) |
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.
Seems this can be refactored to not need to construct the packetToCheck
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 send in the data
if actualSeq != seq { | ||
return 0, errorsmod.Wrapf(channeltypes.ErrInvalidPacket, "sequence mismatch: expected %d, got %d", seq, actualSeq) | ||
} | ||
|
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 can be then removed
Description
ref: #7974
Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
).godoc
comments.Files changed
in the GitHub PR explorer.SonarCloud Report
in the comment section below once CI passes.