Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into e2e_clnode_start_r…
Browse files Browse the repository at this point in the history
…etry
  • Loading branch information
tateexon committed Sep 12, 2023
2 parents 1e956ee + fae227d commit e28cb97
Show file tree
Hide file tree
Showing 37 changed files with 297 additions and 207 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ on:
merge_group:
pull_request:
schedule:
- cron: "0 0 * * *"
# - cron: "0 0 * * *"
- cron: "0 * * * *" # DEBUG: Run every hour to nail down flakes
push:
tags:
- "*"
Expand Down Expand Up @@ -147,6 +148,11 @@ jobs:
outputs:
matrix: ${{ env.MATRIX_JSON }}
steps:
- name: Check for Skip Tests Label
if: contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests')
run: |
echo "## \`skip-smoke-tests\` label is active, skipping E2E smoke tests" >>$GITHUB_STEP_SUMMARY
exit 0
- name: Checkout the repo
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
- name: Compare Test Lists
Expand All @@ -158,11 +164,12 @@ jobs:
id: build-test-matrix-list
run: |
cd ./integration-tests
MATRIX_JSON_AUTOMATION=$(./scripts/buildTestMatrixList.sh ./smoke/automation_test.go automation ubuntu20.04-8cores-32GB)
MATRIX_JSON_KEEPER=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu20.04-8cores-32GB)
MATRIX_JSON_AUTOMATION=$(./scripts/buildTestMatrixList.sh ./smoke/automation_test.go automation ubuntu20.04-8cores-32GB 1)
MATRIX_JSON_KEEPER=$(./scripts/buildTestMatrixList.sh ./smoke/keeper_test.go keeper ubuntu20.04-8cores-32GB 1)
COMBINED_ARRAY=$(jq -c -n "$MATRIX_JSON_AUTOMATION + $MATRIX_JSON_KEEPER")
echo "MATRIX_JSON=${COMBINED_ARRAY}" >> $GITHUB_ENV
eth-smoke-tests-matrix-automation:
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }}
environment: integration
permissions:
checks: write
Expand Down Expand Up @@ -229,6 +236,7 @@ jobs:
test-results-file: '{"testType":"go","filePath":"/tmp/gotest.log"}'
continue-on-error: true
eth-smoke-tests-matrix:
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }}
environment: integration
permissions:
checks: write
Expand Down Expand Up @@ -633,6 +641,7 @@ jobs:
if: needs.changes.outputs.src == 'false' || needs.solana-test-image-exists.outputs.exists == 'true'

solana-smoke-tests:
if: ${{ !contains(join(github.event.pull_request.labels.*.name, ' '), 'skip-smoke-tests') }}
environment: integration
permissions:
checks: write
Expand Down Expand Up @@ -776,7 +785,7 @@ jobs:

testnet-smoke-tests-notify:
name: Live Testnet Start Slack Thread
if: ${{ github.event_name == 'schedule' || (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) }} ## Only run live tests on new tags and nightly
if: success() || failure()
environment: integration
outputs:
thread_ts: ${{ steps.slack.outputs.thread_ts }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/operator-ui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ jobs:
with:
owner: smartcontractkit
repo: operator-ui
comment_downstream_url: ${{ github.event.pull_request.comments_url }}
github_token: ${{ steps.get-gh-token.outputs.access-token }}
workflow_file_name: chainlink-ci.yml
client_payload: '{"ref": "${{ github.event.pull_request.head.sha }}"}'
2 changes: 1 addition & 1 deletion .github/workflows/solidity-foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
- name: Run Forge snapshot
if: ${{ !contains(fromJson('["vrf"]'), matrix.product) }}
run: |
forge snapshot --check gas-snapshots/${{ matrix.product }}.gas-snapshot
forge snapshot --nmt "testFuzz_\w{1,}?" --check gas-snapshots/${{ matrix.product }}.gas-snapshot
id: snapshot
working-directory: contracts
env:
Expand Down
4 changes: 3 additions & 1 deletion contracts/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ ALL_FOUNDRY_PRODUCTS = vrf automation llo-feeds functions automation-dev shared
# make snapshot
# make call example
# make FOUNDRY_PROFILE=llo-feeds snapshot
# note make snapshot skips fuzz tests named according to best practices, although forge uses
# a static fuzz seed by default, flaky gas results per platform are still observed.
.PHONY: snapshot
snapshot: ## Make a snapshot for a specific product.
export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot
export FOUNDRY_PROFILE=$(FOUNDRY_PROFILE) && forge snapshot --nmt "testFuzz_\w{1,}?" --snap gas-snapshots/$(FOUNDRY_PROFILE).gas-snapshot

.PHONY: snapshot-all
snapshot-all: ## Make a snapshot for all products.
Expand Down
1 change: 1 addition & 0 deletions contracts/scripts/native_solc_compile_all_vrf
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ compileContract vrf/BatchBlockhashStore.sol
compileContract vrf/BatchVRFCoordinatorV2.sol
compileContract vrf/testhelpers/VRFCoordinatorV2TestHelper.sol
compileContractAltOpts vrf/VRFCoordinatorV2.sol 10000
compileContract mocks/VRFCoordinatorV2Mock.sol
compileContract vrf/VRFOwner.sol

# VRF V2Plus
Expand Down
38 changes: 32 additions & 6 deletions contracts/src/v0.8/mocks/VRFCoordinatorV2Mock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ pragma solidity ^0.8.4;
import "../shared/interfaces/LinkTokenInterface.sol";
import "../interfaces/VRFCoordinatorV2Interface.sol";
import "../vrf/VRFConsumerBaseV2.sol";
import "../shared/access/ConfirmedOwner.sol";

contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface, ConfirmedOwner {
uint96 public immutable BASE_FEE;
uint96 public immutable GAS_PRICE_LINK;
uint16 public immutable MAX_CONSUMERS = 100;
Expand All @@ -17,6 +18,7 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
error TooManyConsumers();
error InvalidConsumer();
error InvalidRandomWords();
error Reentrant();

event RandomWordsRequested(
bytes32 indexed keyHash,
Expand All @@ -34,7 +36,13 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
event SubscriptionCanceled(uint64 indexed subId, address to, uint256 amount);
event ConsumerAdded(uint64 indexed subId, address consumer);
event ConsumerRemoved(uint64 indexed subId, address consumer);
event ConfigSet();

struct Config {
// Reentrancy protection.
bool reentrancyLock;
}
Config private s_config;
uint64 s_currentSubId;
uint256 s_nextRequestId = 1;
uint256 s_nextPreSeed = 100;
Expand All @@ -52,9 +60,18 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
}
mapping(uint256 => Request) s_requests; /* requestId */ /* request */

constructor(uint96 _baseFee, uint96 _gasPriceLink) {
constructor(uint96 _baseFee, uint96 _gasPriceLink) ConfirmedOwner(msg.sender) {
BASE_FEE = _baseFee;
GAS_PRICE_LINK = _gasPriceLink;
setConfig();
}

/**
* @notice Sets the configuration of the vrfv2 mock coordinator
*/
function setConfig() public onlyOwner {
s_config = Config({reentrancyLock: false});
emit ConfigSet();
}

function consumerIsAdded(uint64 _subId, address _consumer) public view returns (bool) {
Expand Down Expand Up @@ -85,7 +102,7 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
* @param _requestId the request to fulfill
* @param _consumer the VRF randomness consumer to send the result to
*/
function fulfillRandomWords(uint256 _requestId, address _consumer) external {
function fulfillRandomWords(uint256 _requestId, address _consumer) external nonReentrant {
fulfillRandomWordsWithOverride(_requestId, _consumer, new uint256[](0));
}

Expand Down Expand Up @@ -114,7 +131,9 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {

VRFConsumerBaseV2 v;
bytes memory callReq = abi.encodeWithSelector(v.rawFulfillRandomWords.selector, _requestId, _words);
s_config.reentrancyLock = true;
(bool success, ) = _consumer.call{gas: req.callbackGasLimit}(callReq);
s_config.reentrancyLock = false;

uint96 payment = uint96(BASE_FEE + ((startGas - gasleft()) * GAS_PRICE_LINK));
if (s_subscriptions[req.subId].balance < payment) {
Expand Down Expand Up @@ -146,7 +165,7 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
uint16 _minimumRequestConfirmations,
uint32 _callbackGasLimit,
uint32 _numWords
) external override onlyValidConsumer(_subId, msg.sender) returns (uint256) {
) external override nonReentrant onlyValidConsumer(_subId, msg.sender) returns (uint256) {
if (s_subscriptions[_subId].owner == address(0)) {
revert InvalidSubscription();
}
Expand Down Expand Up @@ -185,7 +204,7 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
return (s_subscriptions[_subId].balance, 0, s_subscriptions[_subId].owner, s_consumers[_subId]);
}

function cancelSubscription(uint64 _subId, address _to) external override onlySubOwner(_subId) {
function cancelSubscription(uint64 _subId, address _to) external override onlySubOwner(_subId) nonReentrant {
emit SubscriptionCanceled(_subId, _to, s_subscriptions[_subId].balance);
delete (s_subscriptions[_subId]);
}
Expand Down Expand Up @@ -221,7 +240,7 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
function removeConsumer(
uint64 _subId,
address _consumer
) external override onlySubOwner(_subId) onlyValidConsumer(_subId, _consumer) {
) external override onlySubOwner(_subId) onlyValidConsumer(_subId, _consumer) nonReentrant {
address[] storage consumers = s_consumers[_subId];
for (uint256 i = 0; i < consumers.length; i++) {
if (consumers[i] == _consumer) {
Expand Down Expand Up @@ -276,6 +295,13 @@ contract VRFCoordinatorV2Mock is VRFCoordinatorV2Interface {
);
}

modifier nonReentrant() {
if (s_config.reentrancyLock) {
revert Reentrant();
}
_;
}

function getFallbackWeiPerUnitLink() external view returns (int256) {
return 4000000000000000; // 0.004 Ether
}
Expand Down
3 changes: 1 addition & 2 deletions contracts/test/v0.8/dev/OptimismSequencerUptimeFeed.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ describe('OptimismSequencerUptimeFeed', () => {
.updateStatus(true, timestamp.add(200))

// Submit another status update with the same status
const currentBlock = await ethers.provider.getBlockNumber()
const latestBlock = await ethers.provider.getBlock(currentBlock)
const latestBlock = await ethers.provider.getBlock('latest')

await expect(tx)
.to.emit(optimismUptimeFeed, 'RoundUpdated')
Expand Down
6 changes: 2 additions & 4 deletions contracts/test/v0.8/dev/OptimismValidator.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ describe('OptimismValidator', () => {
it('posts sequencer status when there is not status change', async () => {
await optimismValidator.addAccess(eoaValidator.address)

const currentBlockNum = await ethers.provider.getBlockNumber()
const currentBlock = await ethers.provider.getBlock(currentBlockNum)
const currentBlock = await ethers.provider.getBlock('latest')
const futureTimestamp = currentBlock.timestamp + 5000

await ethers.provider.send('evm_setNextBlockTimestamp', [futureTimestamp])
Expand All @@ -100,8 +99,7 @@ describe('OptimismValidator', () => {
it('post sequencer offline', async () => {
await optimismValidator.addAccess(eoaValidator.address)

const currentBlockNum = await ethers.provider.getBlockNumber()
const currentBlock = await ethers.provider.getBlock(currentBlockNum)
const currentBlock = await ethers.provider.getBlock('latest')
const futureTimestamp = currentBlock.timestamp + 10000

await ethers.provider.send('evm_setNextBlockTimestamp', [futureTimestamp])
Expand Down
4 changes: 2 additions & 2 deletions contracts/test/v0.8/dev/VRFCoordinatorV2Mock.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ describe('VRFCoordinatorV2Mock', () => {
expect(receipt.events[0].args['success']).to.equal(true)
assert(
receipt.events[0].args['payment']
.sub(BigNumber.from('100119017000000000'))
.sub(BigNumber.from('100119403000000000'))
.lt(BigNumber.from('10000000000')),
)

Expand Down Expand Up @@ -315,7 +315,7 @@ describe('VRFCoordinatorV2Mock', () => {
expect(receipt.events[0].args['success']).to.equal(true)
assert(
receipt.events[0].args['payment']
.sub(BigNumber.from('100119017000000000'))
.sub(BigNumber.from('100120516000000000'))
.lt(BigNumber.from('10000000000')),
)

Expand Down
2 changes: 1 addition & 1 deletion core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ require (
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230831132059-42af68994512 // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230908162043-e2f9fcf758d8 // indirect
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230912094934-cb83289b440e // indirect
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca // indirect
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 // indirect
github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1377,8 +1377,8 @@ github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 h1:T3lFWumv
github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704/go.mod h1:2QuJdEouTWjh5BDy5o/vgGXQtR4Gz8yH1IYB5eT7u4M=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230831132059-42af68994512 h1:DojChlaudA1HAxwQPKmt/EDf36OUeFJ0LJBYClauMyU=
github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20230831132059-42af68994512/go.mod h1:xMwqRdj5vqYhCJXgKVqvyAwdcqM6ZAEhnwEQ4Khsop8=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230908162043-e2f9fcf758d8 h1:JRXkI/eE1S0E3VatXVc24vD5e8Zu+YwSV6uSvOh23xU=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230908162043-e2f9fcf758d8/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230912094934-cb83289b440e h1:l09/mhVNyX6+Vhx27VfD7XtuT+Yqrtt9n5TIL09Yj2E=
github.com/smartcontractkit/chainlink-relay v0.1.7-0.20230912094934-cb83289b440e/go.mod h1:gWclxGW7rLkbjXn7FGizYlyKhp/boekto4MEYGyiMG4=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca h1:x7M0m512gtXw5Z4B1WJPZ52VgshoIv+IvHqQ8hsH4AE=
github.com/smartcontractkit/chainlink-solana v1.0.3-0.20230831134610-680240b97aca/go.mod h1:RIUJXn7EVp24TL2p4FW79dYjyno23x5mjt1nKN+5WEk=
github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20230901115736-bbabe542a918 h1:ByVauKFXphRlSNG47lNuxZ9aicu+r8AoNp933VRPpCw=
Expand Down
8 changes: 4 additions & 4 deletions core/services/ocr2/plugins/mercury/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/shopspring/decimal"
"github.com/smartcontractkit/libocr/commontypes"
"github.com/smartcontractkit/libocr/offchainreporting2plus/confighelper"
ocr3confighelper "github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"
"github.com/smartcontractkit/libocr/offchainreporting2plus/ocr3confighelper"
ocr2types "github.com/smartcontractkit/libocr/offchainreporting2plus/types"
"github.com/smartcontractkit/wsrpc/credentials"
"github.com/stretchr/testify/assert"
Expand Down Expand Up @@ -67,7 +67,7 @@ var (
}
rawReportingPluginConfig = relaymercury.OffchainConfig{
ExpirationWindow: 1,
BaseUSDFeeCents: 100,
BaseUSDFee: decimal.NewFromInt(100),
}
)

Expand Down Expand Up @@ -701,7 +701,7 @@ func TestIntegration_MercuryV2(t *testing.T) {
continue // already saw all oracles for this feed
}

expectedFee := relaymercury.CalculateFee(big.NewInt(234567), rawReportingPluginConfig.BaseUSDFeeCents)
expectedFee := relaymercury.CalculateFee(big.NewInt(234567), rawReportingPluginConfig.BaseUSDFee)
expectedExpiresAt := reportElems["observationsTimestamp"].(uint32) + rawReportingPluginConfig.ExpirationWindow

assert.GreaterOrEqual(t, int(reportElems["observationsTimestamp"].(uint32)), int(testStartTimeStamp))
Expand Down Expand Up @@ -983,7 +983,7 @@ func TestIntegration_MercuryV3(t *testing.T) {
continue // already saw all oracles for this feed
}

expectedFee := relaymercury.CalculateFee(big.NewInt(234567), rawReportingPluginConfig.BaseUSDFeeCents)
expectedFee := relaymercury.CalculateFee(big.NewInt(234567), rawReportingPluginConfig.BaseUSDFee)
expectedExpiresAt := reportElems["observationsTimestamp"].(uint32) + rawReportingPluginConfig.ExpirationWindow

assert.GreaterOrEqual(t, int(reportElems["observationsTimestamp"].(uint32)), int(testStartTimeStamp))
Expand Down
3 changes: 3 additions & 0 deletions core/services/relay/evm/config_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ func (cp *configPoller) LatestConfig(ctx context.Context, changedInBlock uint64)
if err != nil {
return ocrtypes.ContractConfig{}, err
}
if len(lgs) == 0 {
return ocrtypes.ContractConfig{}, errors.New("no logs found")
}
latestConfigSet, err := configFromLog(lgs[len(lgs)-1].Data)
if err != nil {
return ocrtypes.ContractConfig{}, err
Expand Down
10 changes: 6 additions & 4 deletions core/services/relay/evm/config_poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@ func TestConfigPoller(t *testing.T) {
lp := logpoller.NewLogPoller(lorm, ethClient, lggr, 100*time.Millisecond, 1, 2, 2, 1000)
require.NoError(t, lp.Start(ctx))
t.Cleanup(func() { lp.Close() })
logPoller, err := NewConfigPoller(lggr, lp, ocrAddress)
configPoller, err := NewConfigPoller(lggr, lp, ocrAddress)
require.NoError(t, err)
// Should have no config to begin with.
_, config, err := logPoller.LatestConfigDetails(testutils.Context(t))
_, config, err := configPoller.LatestConfigDetails(testutils.Context(t))
require.NoError(t, err)
require.Equal(t, ocrtypes2.ConfigDigest{}, config)
_, err = configPoller.LatestConfig(testutils.Context(t), 0)
require.Error(t, err)
// Set the config
contractConfig := setConfig(t, median.OffchainConfig{
AlphaReportInfinite: false,
Expand All @@ -89,13 +91,13 @@ func TestConfigPoller(t *testing.T) {
var digest [32]byte
gomega.NewGomegaWithT(t).Eventually(func() bool {
b.Commit()
configBlock, digest, err = logPoller.LatestConfigDetails(testutils.Context(t))
configBlock, digest, err = configPoller.LatestConfigDetails(testutils.Context(t))
require.NoError(t, err)
return ocrtypes2.ConfigDigest{} != digest
}, testutils.WaitTimeout(t), 100*time.Millisecond).Should(gomega.BeTrue())

// Assert the config returned is the one we configured.
newConfig, err := logPoller.LatestConfig(testutils.Context(t), configBlock)
newConfig, err := configPoller.LatestConfig(testutils.Context(t), configBlock)
require.NoError(t, err)
// Note we don't check onchainConfig, as that is populated in the contract itself.
assert.Equal(t, digest, [32]byte(newConfig.ConfigDigest))
Expand Down
6 changes: 6 additions & 0 deletions core/services/relay/evm/contract_transmitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ func (oc *contractTransmitter) Transmit(ctx context.Context, reportCtx ocrtypes.
var rs [][32]byte
var ss [][32]byte
var vs [32]byte
if len(signatures) > 32 {
return errors.New("too many signatures, maximum is 32")
}
for i, as := range signatures {
r, s, v, err := evmutil.SplitSignature(as.Signature)
if err != nil {
Expand Down Expand Up @@ -138,6 +141,9 @@ func parseTransmitted(log []byte) ([32]byte, uint32, error) {
if err != nil {
return [32]byte{}, 0, err
}
if len(transmitted) < 2 {
return [32]byte{}, 0, errors.New("transmitted event log has too few arguments")
}
configDigest := *abi.ConvertType(transmitted[0], new([32]byte)).(*[32]byte)
epoch := *abi.ConvertType(transmitted[1], new(uint32)).(*uint32)
return configDigest, epoch, err
Expand Down
3 changes: 3 additions & 0 deletions core/services/relay/evm/functions/config_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ func (cp *configPoller) LatestConfig(ctx context.Context, changedInBlock uint64)
if err != nil {
return ocrtypes.ContractConfig{}, err
}
if len(lgs) == 0 {
return ocrtypes.ContractConfig{}, errors.New("no logs found")
}
latestConfigSet, err := configFromLog(lgs[len(lgs)-1].Data, cp.pluginType)
if err != nil {
return ocrtypes.ContractConfig{}, err
Expand Down
2 changes: 2 additions & 0 deletions core/services/relay/evm/functions/config_poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func runTest(t *testing.T, pluginType functions.FunctionsPluginType, expectedDig
_, config, err := configPoller.LatestConfigDetails(testutils.Context(t))
require.NoError(t, err)
require.Equal(t, ocrtypes2.ConfigDigest{}, config)
_, err = configPoller.LatestConfig(testutils.Context(t), 0)
require.Error(t, err)

pluginConfig := &functionsConfig.ReportingPluginConfigWrapper{
Config: &functionsConfig.ReportingPluginConfig{
Expand Down
Loading

0 comments on commit e28cb97

Please sign in to comment.