Skip to content

Commit

Permalink
Migrate to the most recent RMN version (#15004)
Browse files Browse the repository at this point in the history
* update rmn config

* update rmn config
  • Loading branch information
dimkouv authored Oct 30, 2024
1 parent a30e10e commit e2cf137
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 13 deletions.
4 changes: 3 additions & 1 deletion deployment/ccip/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ import (
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/core/types"
"github.com/pkg/errors"
cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"

cciptypes "github.com/smartcontractkit/chainlink-ccip/pkg/types/ccipocr3"

"github.com/ethereum/go-ethereum/common"
"github.com/stretchr/testify/require"

Expand Down
20 changes: 13 additions & 7 deletions deployment/environment/devenv/rmn_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,24 @@ type Stability struct {
HardConfirmations int `toml:"hard_confirmations"`
}

type RemoteChain struct {
Name string `toml:"name"`
Stability Stability `toml:"stability"`
StartBlockNumber int `toml:"start_block_number"`
OffRamp string `toml:"off_ramp"`
RMNRemote string `toml:"rmn_remote"`
type ChainParam struct {
Name string `toml:"name"`
Stability Stability `toml:"stability"`
}

type RemoteChains struct {
Name string `toml:"name"`
OnRampStartBlockNumber int `toml:"on_ramp_start_block_number"`
OffRamp string `toml:"off_ramp"`
OnRamp string `toml:"on_ramp"`
RMNRemote string `toml:"rmn_remote"`
}

type SharedConfig struct {
Networking SharedConfigNetworking `toml:"networking"`
HomeChain HomeChain `toml:"home_chain"`
RemoteChains []RemoteChain `toml:"remote_chains"`
ChainParams []ChainParam `toml:"chain_params"`
RemoteChains []RemoteChains `toml:"remote_chains"`
}

func (s SharedConfig) afn2ProxySharedConfigFile() (string, error) {
Expand Down
17 changes: 12 additions & 5 deletions integration-tests/ccip-tests/testsetups/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,21 +180,27 @@ func GenerateTestRMNConfig(t *testing.T, nRMNNodes int, tenv ccipdeployment.Depl
// Just set all RMN nodes to support all chains.
state, err := ccipdeployment.LoadOnchainState(tenv.Env, tenv.Ab)
require.NoError(t, err)
var remoteChains []devenv.RemoteChain
var chainParams []devenv.ChainParam
var remoteChains []devenv.RemoteChains

var rpcs []devenv.Chain
for chainSel, chain := range state.Chains {
c, _ := chainsel.ChainBySelector(chainSel)
rmnName := MustCCIPNameToRMNName(c.Name)
remoteChains = append(remoteChains, devenv.RemoteChain{
chainParams = append(chainParams, devenv.ChainParam{
Name: rmnName,
Stability: devenv.Stability{
Type: "ConfirmationDepth",
SoftConfirmations: 0,
HardConfirmations: 0,
},
StartBlockNumber: 0,
OffRamp: chain.OffRamp.Address().String(),
RMNRemote: chain.RMNRemote.Address().String(),
})
remoteChains = append(remoteChains, devenv.RemoteChains{
Name: rmnName,
OnRampStartBlockNumber: 0,
OffRamp: chain.OffRamp.Address().String(),
OnRamp: chain.OnRamp.Address().String(),
RMNRemote: chain.RMNRemote.Address().String(),
})
rpcs = append(rpcs, devenv.Chain{
Name: rmnName,
Expand All @@ -213,6 +219,7 @@ func GenerateTestRMNConfig(t *testing.T, nRMNNodes int, tenv ccipdeployment.Depl
RMNHome: state.Chains[tenv.HomeChainSel].RMNHome.Address().String(),
},
RemoteChains: remoteChains,
ChainParams: chainParams,
}

rmnConfig := make(map[string]devenv.RMNConfig)
Expand Down

0 comments on commit e2cf137

Please sign in to comment.