Skip to content

Commit 8e5a247

Browse files
authored
Add force option in curse/uncurse changeset (#17633)
* Add const for chain id in curse/uncurse tests * Add a force option while uncursing and cursing * Run new tests in CI * Linting issues
1 parent 4ac6b91 commit 8e5a247

File tree

3 files changed

+240
-106
lines changed

3 files changed

+240
-106
lines changed

.github/integration-in-memory-tests.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,16 @@ runner-test-matrix:
277277
test_cmd: go test smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go -run "^TestRMNCurseOneConnectedLanesLaneOnlyOnSource$" -timeout 20m -test.parallel=1 -count=1 -json
278278
test_go_project_path: integration-tests
279279

280+
- id: smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go:TestRMNUncurseForceOption
281+
path: integration-tests/smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go
282+
test_env_type: in-memory
283+
runs_on: ubuntu-latest
284+
triggers:
285+
- PR Integration CCIP Tests
286+
- Nightly Integration CCIP Tests
287+
test_cmd: go test smoke/ccip/ccip_cs_rmn_curse_uncurse_test.go -run "^TestRMNUncurseForceOption$" -timeout 20m -test.parallel=1 -count=1 -json
288+
test_go_project_path: integration-tests
289+
280290
- id: smoke/ccip/ccip_disable_lane_test.go:*
281291
path: integration-tests/smoke/ccip/ccip_disable_lane_test.go
282292
test_env_type: in-memory

deployment/ccip/changeset/v1_6/cs_rmn_curse_uncurse.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ type RMNCurseConfig struct {
4040
CurseActions []CurseAction
4141
// Use this if you need to include lanes that are not in sourcechain in the offramp. i.e. not yet migrated lane from 1.5
4242
IncludeNotConnectedLanes bool
43-
Reason string
43+
// Use this if you want to include curse subject even when they are already cursed (CurseChangeset) or already uncursed (UncurseChangeset)
44+
Force bool
45+
Reason string
4446
}
4547

4648
func (c RMNCurseConfig) Validate(e deployment.Environment) error {
@@ -377,7 +379,7 @@ func RMNCurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployment
377379
return deployment.ChangesetOutput{}, fmt.Errorf("failed to check if chain %d is cursed: %w", selector, err)
378380
}
379381

380-
if !cursed {
382+
if !cursed || cfg.Force {
381383
notAlreadyCursedSubjects = append(notAlreadyCursedSubjects, subject)
382384
} else {
383385
e.Logger.Warnf("chain %s subject %x is already cursed, ignoring it while cursing", cursableChains[selector].Name(), subject)
@@ -460,7 +462,7 @@ func RMNUncurseChangeset(e deployment.Environment, cfg RMNCurseConfig) (deployme
460462
return deployment.ChangesetOutput{}, fmt.Errorf("failed to check if chain %d is cursed: %w", selector, err)
461463
}
462464

463-
if cursed {
465+
if cursed || cfg.Force {
464466
actuallyCursedSubjects = append(actuallyCursedSubjects, subject)
465467
} else {
466468
e.Logger.Warnf("chain %s subject %x is not cursed, ignoring it while uncursing", cursableChains[selector].Name(), subject)

0 commit comments

Comments
 (0)