-
Notifications
You must be signed in to change notification settings - Fork 122
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
Slash packet throttling #462
Conversation
Addressing this comment, this design does not violate a lot of the spec properties compared to alternatives like dropping slash packets. These are definitely valuable conversations, but I think they're best saved for the development of the slash packet throttling spec. I'll add a section in the doc about the max queue limit |
* reb * reb * Del unused Co-authored-by: Daniel <[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.
Amazing work @smarshall-spitzbart. Check my comments bellow. Nothing major. Can be fixed after this is merged.
x/ccv/provider/types/keys.go
Outdated
timeBzL := len(timeBz) | ||
return AppendMany( | ||
[]byte{GlobalSlashEntryBytePrefix}, | ||
sdk.Uint64ToBigEndian(uint64(timeBzL)), |
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 sorts by the number of bytes returned by sdk.FormatTimeBytes
. Replace with uint64 as done in e440824
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.
Nice catch! When you have time could you sanity check 3b03354. It should be safe to parse the uint64 time back to a time.Time
using recvTime = time.Unix(0, int64(timeBz)).UTC()
, correct?
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.
LGTM. I would be more comfortable though once we have #607 fixed.
vscMaturedData = []ccvtypes.VSCMaturedPacketData{} | ||
ibcSeqNums = []uint64{} | ||
|
||
iteratorLoop: |
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.
Change the switch to ifs to avoid using a label, becuase most people won't be familiar with labels
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.
See #611
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.
LGTM
Description
Slash packets are now queued on the provider, and handled in a throttled manner.
Closes #404
Closes #595
I've kept #589 and #600 as separate PRs, but they are useful in validating the correctness of this feature. My suggestion is to merge them into main after this PR, once people have time to review them.
Protocol Description and Background
See md file in PR https://github.com/cosmos/interchain-security/blob/ba9965ec5fa8920008e3b1afc593277741e5c9e8/docs/throttle.md