diff --git a/commit/merkleroot/rmn/controller.go b/commit/merkleroot/rmn/controller.go index caa0bab03..520f11094 100644 --- a/commit/merkleroot/rmn/controller.go +++ b/commit/merkleroot/rmn/controller.go @@ -168,7 +168,7 @@ func (c *controller) ComputeReportSignatures( return nil, fmt.Errorf("process update requests: %w", err) } - homeFMap, err := c.rmnHomeReader.GetF(rmnRemoteCfg.ConfigDigest) + homeFMap, err := c.rmnHomeReader.GetFObserve(rmnRemoteCfg.ConfigDigest) if err != nil { return nil, fmt.Errorf("get home F: %w", err) } @@ -624,7 +624,7 @@ func (c *controller) getRmnReportSignatures( // At this point it is also possible that the signed observations contain // different roots for the same source chain and interval. - homeChainF, err := c.rmnHomeReader.GetF(rmnRemoteCfg.ConfigDigest) + homeChainF, err := c.rmnHomeReader.GetFObserve(rmnRemoteCfg.ConfigDigest) if err != nil { return nil, fmt.Errorf("get home reader F: %w", err) } diff --git a/commit/merkleroot/rmn/controller_test.go b/commit/merkleroot/rmn/controller_test.go index 7f6d962ff..87dd1d0ee 100644 --- a/commit/merkleroot/rmn/controller_test.go +++ b/commit/merkleroot/rmn/controller_test.go @@ -497,7 +497,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) { t.Run("empty lane update request", func(t *testing.T) { ts := newTestSetup(t) - ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( + ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2}, nil) ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil) @@ -515,7 +515,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) { ts := newTestSetup(t) ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil) - ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( + ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2, chainD1: 2}, nil) go func() { requestIDs, requestedChains := ts.waitForObservationRequestsToBeSent( @@ -556,7 +556,7 @@ func TestClient_ComputeReportSignatures(t *testing.T) { ts.rmnController.reportsInitialRequestTimerDuration = time.Nanosecond ts.rmnHomeMock.On("GetRMNNodesInfo", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return(ts.rmnNodes, nil) - ts.rmnHomeMock.On("GetF", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( + ts.rmnHomeMock.On("GetFObserve", cciptypes.Bytes32{0x1, 0x2, 0x3}).Return( map[cciptypes.ChainSelector]int{chainS1: 2, chainS2: 2}, nil) go func() { diff --git a/mocks/pkg/reader/rmn_home.go b/mocks/pkg/reader/rmn_home.go index 825cad5cf..1f4d8084b 100644 --- a/mocks/pkg/reader/rmn_home.go +++ b/mocks/pkg/reader/rmn_home.go @@ -129,12 +129,12 @@ func (_c *MockRMNHome_GetAllConfigDigests_Call) RunAndReturn(run func() (ccipocr return _c } -// GetF provides a mock function with given fields: configDigest -func (_m *MockRMNHome) GetF(configDigest ccipocr3.Bytes32) (map[ccipocr3.ChainSelector]int, error) { +// GetFObserve provides a mock function with given fields: configDigest +func (_m *MockRMNHome) GetFObserve(configDigest ccipocr3.Bytes32) (map[ccipocr3.ChainSelector]int, error) { ret := _m.Called(configDigest) if len(ret) == 0 { - panic("no return value specified for GetF") + panic("no return value specified for GetFObserve") } var r0 map[ccipocr3.ChainSelector]int @@ -159,30 +159,30 @@ func (_m *MockRMNHome) GetF(configDigest ccipocr3.Bytes32) (map[ccipocr3.ChainSe return r0, r1 } -// MockRMNHome_GetF_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetF' -type MockRMNHome_GetF_Call struct { +// MockRMNHome_GetFObserve_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetFObserve' +type MockRMNHome_GetFObserve_Call struct { *mock.Call } -// GetF is a helper method to define mock.On call +// GetFObserve is a helper method to define mock.On call // - configDigest ccipocr3.Bytes32 -func (_e *MockRMNHome_Expecter) GetF(configDigest interface{}) *MockRMNHome_GetF_Call { - return &MockRMNHome_GetF_Call{Call: _e.mock.On("GetF", configDigest)} +func (_e *MockRMNHome_Expecter) GetFObserve(configDigest interface{}) *MockRMNHome_GetFObserve_Call { + return &MockRMNHome_GetFObserve_Call{Call: _e.mock.On("GetFObserve", configDigest)} } -func (_c *MockRMNHome_GetF_Call) Run(run func(configDigest ccipocr3.Bytes32)) *MockRMNHome_GetF_Call { +func (_c *MockRMNHome_GetFObserve_Call) Run(run func(configDigest ccipocr3.Bytes32)) *MockRMNHome_GetFObserve_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(ccipocr3.Bytes32)) }) return _c } -func (_c *MockRMNHome_GetF_Call) Return(_a0 map[ccipocr3.ChainSelector]int, _a1 error) *MockRMNHome_GetF_Call { +func (_c *MockRMNHome_GetFObserve_Call) Return(_a0 map[ccipocr3.ChainSelector]int, _a1 error) *MockRMNHome_GetFObserve_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockRMNHome_GetF_Call) RunAndReturn(run func(ccipocr3.Bytes32) (map[ccipocr3.ChainSelector]int, error)) *MockRMNHome_GetF_Call { +func (_c *MockRMNHome_GetFObserve_Call) RunAndReturn(run func(ccipocr3.Bytes32) (map[ccipocr3.ChainSelector]int, error)) *MockRMNHome_GetFObserve_Call { _c.Call.Return(run) return _c } diff --git a/pkg/reader/rmn_home.go b/pkg/reader/rmn_home.go index 4dce34c16..aa325c730 100644 --- a/pkg/reader/rmn_home.go +++ b/pkg/reader/rmn_home.go @@ -38,9 +38,9 @@ type RMNHome interface { GetRMNNodesInfo(configDigest cciptypes.Bytes32) ([]rmntypes.HomeNodeInfo, error) // IsRMNHomeConfigDigestSet checks if the configDigest is set in the RMNHome contract IsRMNHomeConfigDigestSet(configDigest cciptypes.Bytes32) bool - // GetF gets the F value for each source chain in the given configDigest. + // GetFObserve gets the F value for each source chain in the given configDigest. // Maximum number of faulty observers; F+1 observers required to agree on an observation for a source chain. - GetF(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) + GetFObserve(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) // GetOffChainConfig gets the offchain config for the given configDigest GetOffChainConfig(configDigest cciptypes.Bytes32) (cciptypes.Bytes, error) // GetAllConfigDigests gets the active and candidate RMNHomeConfigs @@ -195,7 +195,7 @@ func (r *rmnHomePoller) IsRMNHomeConfigDigestSet(configDigest cciptypes.Bytes32) return ok } -func (r *rmnHomePoller) GetF(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) { +func (r *rmnHomePoller) GetFObserve(configDigest cciptypes.Bytes32) (map[cciptypes.ChainSelector]int, error) { r.mutex.RLock() defer r.mutex.RUnlock() _, ok := r.rmnHomeState.rmnHomeConfig[configDigest] diff --git a/pkg/reader/rmn_home_test.go b/pkg/reader/rmn_home_test.go index 6815c186f..17b72e37b 100644 --- a/pkg/reader/rmn_home_test.go +++ b/pkg/reader/rmn_home_test.go @@ -250,7 +250,7 @@ func Test_RMNHomePollingWorking(t *testing.T) { require.NotEmpty(t, offchainConfig) } - minObsMap, err := configPoller.GetF(config.ConfigDigest) + minObsMap, err := configPoller.GetFObserve(config.ConfigDigest) if isEmpty { require.Error(t, err) require.Empty(t, minObsMap)