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

Fix/onramp allowlist race condition #1480

Open
wants to merge 9 commits into
base: ccip-develop
Choose a base branch
from

Conversation

0xsuryansh
Copy link
Member

@0xsuryansh 0xsuryansh commented Oct 2, 2024

Motivation

When the onRamp::_applyDestChainConfigUpdates is invoked in the constructor, the allowListEnabled field of the destination chain configuration is not set directly. As a result, if an onRamp with an allow list is required, the deployment must be bundled with a call to onRamp::applyAllowListUpdates

Solution

Directly sets the allowListEnabled field during the constructor execution.

0xsuryansh and others added 3 commits October 2, 2024 15:21
…ndition

Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
Copy link
Contributor

github-actions bot commented Oct 2, 2024

LCOV of commit 549b19d during Solidity Foundry #8509

Summary coverage rate:
  lines......: 97.8% (2264 of 2314 lines)
  functions..: 95.3% (426 of 447 functions)
  branches...: 93.6% (537 of 574 branches)

Files changed coverage rate: n/a

@0xsuryansh 0xsuryansh marked this pull request as ready for review October 2, 2024 15:35
@@ -91,6 +91,7 @@ contract OnRamp is IEVM2AnyOnRampClient, ITypeAndVersion, OwnerIsCreator {
struct DestChainConfigArgs {
uint64 destChainSelector; // Destination chain selector
IRouter router; // Source router address
bool allowListEnabled; // Boolean indicator to specify if allowList check is enabled
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's add struct packing comments, they should have been there already but the previous person also missed them :)

Copy link
Member Author

Choose a reason for hiding this comment

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

# Conflicts:
#	contracts/gas-snapshots/ccip.gas-snapshot
#	core/gethwrappers/ccip/generated/onramp/onramp.go
#	core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
Signed-off-by: 0xsuryansh <suryansh.shrivastava@smartcontract.com>
@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@0xsuryansh
Copy link
Member Author

Added a test for setting a new chain with allowedListEnabled : true and then trying out sending a msg with empty allowed list, the forwardFromRouter call should revert here

549b19d

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.

2 participants