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
|
lumtis
left a comment
There was a problem hiding this comment.
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
skosito
left a comment
There was a problem hiding this comment.
looks good, just small comments about naming
|
We need to generate the files again. |
Description
Athens3 saw a sharp increase in
Current Withdraw Ratemetrics right after the rate limiter conversion rates ofeth/erc20/btckicked 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 inSepoliatestnet. Reverted cctxs containinbound_tx_observed_external_heightthat 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
SenderChainIdto 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: