Skip to content
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

Rate limiter final blow #128

Merged
merged 14 commits into from
Apr 28, 2022

Conversation

ChiTimesChi
Copy link
Collaborator

@ChiTimesChi ChiTimesChi commented Apr 27, 2022

Description

This PR aims to finish rate-limiter smart contracts side of things. Changes:

  • Initial retry timeout is shortened to 10 minutes, so that during the testing anyone could bump delayed tx relatively soon.
  • RateLimiter and SynapseBridge functions are regrouped and reordered for (slightly) better readability.
  • Unresolved issues from rate-limiter review should be now resolved.
    • Full Bridge state is now checked after the implementation upgrade.
    • Effects before interactions pattern applied in RateLimiter.
    • if/else pattern is used instead of if -> return + doSomething().
    • Sneaky private got turned into internal, underscores got added.
  • L2BridgeZap approvals are reworked. Tests for Zaps on Avalanche and Arbitrum covering all relevant functions are added as well.
  • Chain-specific contracts are thrown away where they belong.
  • redeemv2 is changed to redeemV2 on Zap contracts, Bridge interface.

Checklist

  • New Contracts have been tested
  • Lint has been run
  • I have checked my code and corrected any misspellings

@coveralls
Copy link

coveralls commented Apr 27, 2022

Pull Request Test Coverage Report for Build 2235376631

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 49 of 80 (61.25%) changed or added relevant lines in 4 files are covered.
  • 9 unchanged lines in 2 files lost coverage.
  • Overall coverage increased (+11.6%) to 52.238%

Changes Missing Coverage Covered Lines Changed/Added Lines %
contracts/bridge/wrappers/L1BridgeZap.sol 0 1 0.0%
contracts/bridge/RateLimiter.sol 18 23 78.26%
contracts/bridge/wrappers/L2BridgeZap.sol 0 10 0.0%
contracts/bridge/SynapseBridge.sol 31 46 67.39%
Files with Coverage Reduction New Missed Lines %
contracts/bridge/SynapseBridge.sol 1 51.06%
contracts/bridge/wrappers/L2BridgeZap.sol 8 0.0%
Totals Coverage Status
Change from base Build 2230455052: 11.6%
Covered Lines: 803
Relevant Lines: 1459

💛 - Coveralls

Copy link
Contributor

@aureliusbtc aureliusbtc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aureliusbtc aureliusbtc merged commit c6ecfc3 into feature/rate-limiter Apr 28, 2022
@ChiTimesChi ChiTimesChi deleted the feature/rate-limiter-final-blow branch April 28, 2022 20:14
trajan0x pushed a commit that referenced this pull request May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants