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

Add fork tests for flow rate controls #85

Merged
merged 26 commits into from
Feb 7, 2024
Merged

Conversation

ermyas
Copy link
Collaborator

@ermyas ermyas commented Feb 1, 2024

This PR introduces fork tests to check the flow rate control capabilities of the bridge, a crucial security feature. Despite the existence of numerous unit and integration tests for this function, it's necessary to test it against a deployed version of the bridge. Here, parameters, configurations, and token contract idiosyncrasies could potentially affect its functionality. However, running live E2E tests on the flow rate control feature on mainnet isn't feasible. Hence, these tests serve as an alternative way to confirm that this capability works as expected under a range of conditions, in all bridge deployment environments.

This PR addresses SMR-2336-SMR-2238

@platform-sa
Copy link

platform-sa commented Feb 1, 2024

📃CI Report

Compiling 143 files with 0.8.19
Solc 0.8.19 finished in 15.70s
Compiler run �[32msuccessful!�[0m
Analysing contracts...
Running tests...

File % Lines % Statements % Branches % Funcs
src/child/ChildAxelarBridgeAdaptor.sol 100.00% (51/51) 100.00% (68/68) 100.00% (24/24) 100.00% (8/8)
src/child/ChildERC20.sol 100.00% (14/14) 100.00% (15/15) 100.00% (2/2) 100.00% (7/7)
src/child/ChildERC20Bridge.sol 99.23% (129/130) 99.43% (175/176) 98.44% (63/64) 100.00% (21/21)
src/child/WIMX.sol 100.00% (19/19) 100.00% (22/22) 100.00% (8/8) 100.00% (6/6)
src/common/AdaptorRoles.sol 100.00% (6/6) 100.00% (6/6) 100.00% (0/0) 100.00% (6/6)
src/common/BridgeRoles.sol 100.00% (8/8) 100.00% (8/8) 100.00% (0/0) 100.00% (8/8)
src/lib/EIP712MetaTransaction.sol 8.00% (2/25) 9.68% (3/31) 8.33% (1/12) 14.29% (1/7)
src/lib/EIP712Upgradeable.sol 73.33% (11/15) 60.87% (14/23) 0.00% (0/2) 50.00% (2/4)
src/lib/WETH.sol 0.00% (0/19) 0.00% (0/22) 0.00% (0/8) 0.00% (0/6)
src/root/RootAxelarBridgeAdaptor.sol 100.00% (51/51) 100.00% (68/68) 100.00% (24/24) 100.00% (8/8)
src/root/RootERC20Bridge.sol 94.07% (127/135) 95.83% (184/192) 87.93% (51/58) 91.30% (21/23)
src/root/flowrate/FlowRateDetection.sol 100.00% (30/30) 100.00% (33/33) 100.00% (14/14) 100.00% (4/4)
src/root/flowrate/FlowRateWithdrawalQueue.sol 100.00% (46/46) 100.00% (60/60) 78.57% (11/14) 100.00% (7/7)
src/root/flowrate/RootERC20BridgeFlowRate.sol 100.00% (42/42) 97.96% (48/49) 100.00% (10/10) 100.00% (9/9)

For a full HTML report run: forge coverage --report lcov && genhtml --ignore-errors category --branch-coverage --output-dir coverage lcov.info

Copy link
Contributor

@wcgcyx wcgcyx left a comment

Choose a reason for hiding this comment

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

Overall looks good to me, just some minor comments.

test/fork/root/RootERC20BridgeFlowRate.t.sol Outdated Show resolved Hide resolved
test/fork/root/RootERC20BridgeFlowRate.t.sol Show resolved Hide resolved
Copy link
Contributor

@wcgcyx wcgcyx left a comment

Choose a reason for hiding this comment

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

LGTM

@ermyas ermyas merged commit b38b11c into main Feb 7, 2024
5 checks passed
@ermyas ermyas deleted the SMR-2336/test/fork/flowrate branch April 12, 2024 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants