|
1 | 1 | package evm |
2 | 2 |
|
3 | 3 | import ( |
4 | | - "context" |
5 | 4 | "errors" |
6 | 5 | "fmt" |
7 | 6 |
|
@@ -476,22 +475,6 @@ func (c CCIPChainState) ValidateOnRamp( |
476 | 475 | return nil |
477 | 476 | } |
478 | 477 |
|
479 | | -// chainSelFromConfigs extracts the chain selector from CCIPHome configs, |
480 | | -// falling back through active→candidate for both commit and exec. |
481 | | -func chainSelFromConfigs(commit, exec ccip_home.GetAllConfigs) uint64 { |
482 | | - sel := commit.ActiveConfig.Config.ChainSelector |
483 | | - if sel == 0 { |
484 | | - sel = commit.CandidateConfig.Config.ChainSelector |
485 | | - } |
486 | | - if sel == 0 { |
487 | | - sel = exec.ActiveConfig.Config.ChainSelector |
488 | | - if sel == 0 { |
489 | | - sel = exec.CandidateConfig.Config.ChainSelector |
490 | | - } |
491 | | - } |
492 | | - return sel |
493 | | -} |
494 | | - |
495 | 478 | // ValidateRouter validates the router contract and returns all connected v1.6 chains. |
496 | 479 | // v16ActiveChains filters out legacy v1.5 lane entries in mixed environments. |
497 | 480 | func (c CCIPChainState) ValidateRouter(e cldf.Environment, isTestRouter bool, v16ActiveChains map[uint64]bool) ([]uint64, error) { |
@@ -554,37 +537,6 @@ func (c CCIPChainState) ValidateRouter(e cldf.Environment, isTestRouter bool, v1 |
554 | 537 | return v16ConnectedChains, nil |
555 | 538 | } |
556 | 539 |
|
557 | | -// V16ActiveChainSelectors returns chain selectors with an active or candidate |
558 | | -// v1.6 DON config in CCIPHome. Home chain only. |
559 | | -func (c CCIPChainState) V16ActiveChainSelectors(ctx context.Context) (map[uint64]bool, error) { |
560 | | - if c.CCIPHome == nil { |
561 | | - return nil, errors.New("no CCIPHome contract found in the state") |
562 | | - } |
563 | | - if c.CapabilityRegistry == nil { |
564 | | - return nil, errors.New("no CapabilityRegistry contract found in the state") |
565 | | - } |
566 | | - ccipDons, err := shared.GetCCIPDonsFromCapRegistry(ctx, c.CapabilityRegistry) |
567 | | - if err != nil { |
568 | | - return nil, fmt.Errorf("failed to get CCIP DONs from capability registry: %w", err) |
569 | | - } |
570 | | - callOpts := &bind.CallOpts{Context: ctx} |
571 | | - active := make(map[uint64]bool, len(ccipDons)) |
572 | | - for _, don := range ccipDons { |
573 | | - commitConfigs, err := c.CCIPHome.GetAllConfigs(callOpts, don.Id, uint8(types.PluginTypeCCIPCommit)) |
574 | | - if err != nil { |
575 | | - continue |
576 | | - } |
577 | | - execConfigs, err := c.CCIPHome.GetAllConfigs(callOpts, don.Id, uint8(types.PluginTypeCCIPExec)) |
578 | | - if err != nil { |
579 | | - continue |
580 | | - } |
581 | | - if chainSel := chainSelFromConfigs(commitConfigs, execConfigs); chainSel != 0 { |
582 | | - active[chainSel] = true |
583 | | - } |
584 | | - } |
585 | | - return active, nil |
586 | | -} |
587 | | - |
588 | 540 | // ValidateRMNRemote validates the RMNRemote contract to check if all wired contracts are synced with state |
589 | 541 | // and returns whether RMN is enabled for the chain on the RMNRemote |
590 | 542 | // It validates whether RMNRemote is in sync with the RMNHome contract |
|
0 commit comments