[NONEVM-3478] Implement Soft Freeze in core contracts#530
Open
patricios-space wants to merge 15 commits intomainfrom
Open
[NONEVM-3478] Implement Soft Freeze in core contracts#530patricios-space wants to merge 15 commits intomainfrom
patricios-space wants to merge 15 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a soft freeze mechanism in CCIP core contracts to prevent value leakage when contract balances fall below operational thresholds. The soft freeze restricts permissionless operations while allowing owner operations to continue, ensuring contracts remain operational for administrative tasks even when underfunded.
Changes:
- Introduced soft freeze library and threshold constants across Router, OnRamp, OffRamp, and FeeQuoter contracts
- Added validation for OnRamp reserve configuration to ensure it exceeds the soft freeze threshold
- Updated default contract funding amounts and reserve values in deployment configurations and test files
Reviewed changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pkg/ccip/bindings/soft_freeze/types.go | Go bindings for soft freeze error codes |
| pkg/ccip/bindings/soft_freeze/exitcode_string.go | Generated string representations for soft freeze exit codes |
| pkg/ccip/bindings/onramp/onramp.go | Added InvalidReserve error to OnRamp exit codes |
| pkg/ccip/bindings/onramp/exitcode_string.go | Generated strings for updated OnRamp exit codes |
| deployment/ccip/cs_test_helpers.go | Increased default coin and reserve amounts in test deployment config |
| deployment/ccip/1_6_0/sequences/deploy_chain_contracts.go | Updated default contract coin and reserve amount constants |
| contracts/wrappers/libraries/funding/SoftFreeze.ts | TypeScript wrapper for soft freeze error codes |
| contracts/wrappers/ccip/Router.ts | Added soft freeze threshold constant to Router |
| contracts/wrappers/ccip/OnRamp.ts | Added soft freeze threshold and InvalidReserve error to OnRamp |
| contracts/wrappers/ccip/OffRamp.ts | Added soft freeze threshold constant to OffRamp |
| contracts/wrappers/ccip/FeeQuoter.ts | Added soft freeze threshold constant to FeeQuoter |
| contracts/tests/lib/funding/WithdrawableSpec.ts | Updated funding logic to ensure balance exceeds reserve |
| contracts/tests/lib/funding/SoftFreezeSpec.ts | New reusable test suite for soft freeze functionality |
| contracts/tests/gas-report/ccip/messaging/OnRamp.spec.ts | Updated deployment amounts to use soft freeze threshold |
| contracts/tests/gas-report/ccip/messaging/OffRamp.spec.ts | Updated deployment amounts and refactored imports |
| contracts/tests/gas-report/ccip/messaging/FeeQuoter.spec.ts | Updated deployment amounts to use soft freeze threshold |
| contracts/tests/ccip/router/Router.spec.ts | Added soft freeze test suite for Router |
| contracts/tests/ccip/router/Router.Setup.ts | Updated deployment amounts to use soft freeze threshold |
| contracts/tests/ccip/onramp/OnRamp.withdrawFeeToken.spec.ts | Refactored balance validation into helper function |
| contracts/tests/ccip/onramp/OnRamp.spec.ts | Added soft freeze test suite for OnRamp |
| contracts/tests/ccip/onramp/OnRamp.setDynamicConfig.spec.ts | Added test for invalid reserve validation |
| contracts/tests/ccip/onramp/OnRamp.Setup.ts | Updated default reserve to exceed soft freeze threshold |
| contracts/tests/ccip/helpers/SetUp.ts | Refactored to use namespaced imports |
| contracts/tests/ccip/feequoter/FeeQuoterSetup.ts | Updated deployment amounts to use soft freeze threshold |
| contracts/tests/ccip/feequoter/FeeQuoter.spec.ts | Added soft freeze test suite for FeeQuoter |
| contracts/tests/ccip/OffRamp.spec.ts | Added soft freeze test suite for OffRamp |
| contracts/contracts/lib/funding/soft_freeze.tolk | Core soft freeze implementation in Tolk |
| contracts/contracts/ccip/router/contract.tolk | Integrated soft freeze check in Router message handler |
| contracts/contracts/ccip/onramp/errors.tolk | Added InvalidReserve error to OnRamp |
| contracts/contracts/ccip/onramp/contract.tolk | Integrated soft freeze and reserve validation in OnRamp |
| contracts/contracts/ccip/offramp/contract.tolk | Integrated soft freeze check in OffRamp message handler |
| contracts/contracts/ccip/fee_quoter/contract.tolk | Integrated soft freeze check in FeeQuoter message handler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NONEVM-3478