From a68f20b5c7491e329dd067864775185281761722 Mon Sep 17 00:00:00 2001 From: "Simon B.Robert" Date: Mon, 9 Dec 2024 10:11:52 -0500 Subject: [PATCH] Address some more feedback on the PR --- deployment/ccip/changeset/cs_update_rmn_config.go | 9 ++++++--- deployment/ccip/changeset/cs_update_rmn_config_test.go | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/deployment/ccip/changeset/cs_update_rmn_config.go b/deployment/ccip/changeset/cs_update_rmn_config.go index 02720698cae..f7b13fddc2d 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config.go +++ b/deployment/ccip/changeset/cs_update_rmn_config.go @@ -4,6 +4,7 @@ import ( "fmt" "math/big" "reflect" + "time" "github.com/ethereum/go-ethereum/common" "github.com/smartcontractkit/ccip-owner-contracts/pkg/gethwrappers" @@ -21,6 +22,7 @@ type SetRMNHomeCandidateConfig struct { RMNStaticConfig rmn_home.RMNHomeStaticConfig RMNDynamicConfig rmn_home.RMNHomeDynamicConfig DigestToOverride [32]byte + MinDelay time.Duration } func (c SetRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { @@ -63,13 +65,12 @@ func (c SetRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { } currentDigest, err := rmnHome.GetCandidateDigest(nil) - if err != nil { return fmt.Errorf("failed to get RMNHome candidate digest: %w", err) } if currentDigest != c.DigestToOverride { - return fmt.Errorf("current digest does not match digest to override") + return fmt.Errorf("current digest (%x) does not match digest to override (%x)", currentDigest[:], c.DigestToOverride[:]) } return nil @@ -78,6 +79,7 @@ func (c SetRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { type PromoteRMNHomeCandidateConfig struct { HomeChainSelector uint64 DigestToPromote [32]byte + MinDelay time.Duration } func (c PromoteRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { @@ -97,7 +99,7 @@ func (c PromoteRMNHomeCandidateConfig) Validate(state CCIPOnChainState) error { } if currentCandidateDigest != c.DigestToPromote { - return fmt.Errorf("candidate digest does not match digest to promote") + return fmt.Errorf("current digest (%x) does not match digest to promote (%x)", currentCandidateDigest[:], c.DigestToPromote[:]) } return nil @@ -259,6 +261,7 @@ type SetRMNRemoteConfig struct { HomeChainSelector uint64 Signers []rmn_remote.RMNRemoteSigner F uint64 + MinDelay time.Duration } func (c SetRMNRemoteConfig) Validate() error { diff --git a/deployment/ccip/changeset/cs_update_rmn_config_test.go b/deployment/ccip/changeset/cs_update_rmn_config_test.go index a59c72f3ca0..17ad8f8c370 100644 --- a/deployment/ccip/changeset/cs_update_rmn_config_test.go +++ b/deployment/ccip/changeset/cs_update_rmn_config_test.go @@ -62,6 +62,7 @@ func TestUpdateRMNHomeConfig(t *testing.T) { SourceChains: []rmn_home.RMNHomeSourceChain{}, OffchainConfig: []byte(""), }, + MinDelay: 0, } _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ @@ -87,6 +88,7 @@ func TestUpdateRMNHomeConfig(t *testing.T) { promoteConfig := PromoteRMNHomeCandidateConfig{ HomeChainSelector: e.HomeChainSel, DigestToPromote: currentCandidateDigest, + MinDelay: 0, } _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{ @@ -110,7 +112,8 @@ func TestUpdateRMNHomeConfig(t *testing.T) { NodeIndex: 0, }, }, - F: 0, + F: 0, + MinDelay: 0, } _, err = commonchangeset.ApplyChangesets(t, e.Env, timelocksPerChain, []commonchangeset.ChangesetApplication{