-
Notifications
You must be signed in to change notification settings - Fork 54
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
Conversation
…ndition Signed-off-by: 0xsuryansh <[email protected]>
Signed-off-by: 0xsuryansh <[email protected]>
LCOV of commit
|
@@ -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 |
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.
let's add struct packing comments, they should have been there already but the previous person also missed them :)
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.
# 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 <[email protected]>
Signed-off-by: 0xsuryansh <[email protected]>
Signed-off-by: 0xsuryansh <[email protected]>
Added a test for setting a new chain with |
Signed-off-by: 0xsuryansh <[email protected]>
# Conflicts: # contracts/gas-snapshots/ccip.gas-snapshot # core/gethwrappers/ccip/generation/generated-wrapper-dependency-versions-do-not-edit.txt
Signed-off-by: 0xsuryansh <[email protected]>
IRouter router; // Source router address | ||
uint64 destChainSelector; // ─╮ Destination chain selector | ||
IRouter router; // │ Source router address | ||
bool allowListEnabled; //─────╯ Boolean indicator to specify if allowList check is enabled |
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.
q: since this is now part of dest chain config args - do we still need it in allowListConfigArgs
? There are now 2 ways to change the allowlist - is this intended?
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.
This just enables it when a new chain it set, to prevent unauthorised access to a private chain. The other method is still required to set the actual permitted addresses
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.
For the first option it makes sense, for the second option - we can always batch 2 MCMS calls:
setDestChainConfigArgs
setAllowlistConfigArgs
Seems slightly redundant to have the flag twice
Quality Gate passedIssues Measures |
Motivation
When the
onRamp::_applyDestChainConfigUpdates
is invoked in the constructor, theallowListEnabled
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 toonRamp::applyAllowListUpdates
Solution
Directly sets the
allowListEnabled
field during the constructor execution.