-
Notifications
You must be signed in to change notification settings - Fork 119
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
fix: exclude reverted cctx from rate limiter #2256
Conversation
!!!WARNING!!! Be very careful about using Only suppress a single rule (or a specific set of rules) within a section of code, while continuing to scan for other problems. To do this, you can list the rule(s) to be suppressed within the #nosec annotation, e.g: /* #nosec G401 */ or //#nosec G201 G202 G203 Pay extra attention to the way |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2256 +/- ##
===========================================
+ Coverage 68.80% 68.81% +0.01%
===========================================
Files 261 261
Lines 16250 16257 +7
===========================================
+ Hits 11180 11187 +7
Misses 4589 4589
Partials 481 481
|
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.
Reverted cctxs contain inbound_tx_observed_external_height that indicates an external chain's height (not ZetaChain height)
inbound_tx_observed_external_height
should never contains the height of ZetaChain per its name. If it is the case, there are refactoring to do on this side
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.
looks good, just small comments about naming
We need to generate the files again. |
Description
Athens3 saw a sharp increase in
Current Withdraw Rate
metrics right after the rate limiter conversion rates ofeth/erc20/btc
kicked in. The reason was found after some debugging effort. There were many reverted cctxs (for instance https://zetachain-testnet-api.itrocket.net/zeta-chain/crosschain/cctx/11155111/135) happened inSepolia
testnet. Reverted cctxs containinbound_tx_observed_external_height
that indicates an external chain's height (not ZetaChain height). When compared with ZetaChain height, these reverted cctxs were falsely included in the rate limiter window and count to the total withdrawn value.A quick fix can be excluding these type of cctxs by checking
SenderChainId
to make sure it is a true withdrawal from ZetaChain.Closes:
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Include instructions and any relevant details so others can reproduce.
Checklist: