From f8b59c68d9d3415cf69348d08dba02a979b919b3 Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 3 May 2024 12:02:20 -0400 Subject: [PATCH 01/11] change finality depth from 1 to 10 --- core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml | 2 +- core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/Celo_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/Celo_Testnet.toml | 2 +- core/chains/evm/config/toml/defaults/Klaytn_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/Klaytn_Testnet.toml | 2 +- core/chains/evm/config/toml/defaults/Metis_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/Metis_Rinkeby.toml | 2 +- core/chains/evm/config/toml/defaults/Metis_Sepolia.toml | 2 +- core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml | 2 +- core/chains/evm/config/toml/defaults/Simulated.toml | 2 +- core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/WeMix_Testnet.toml | 2 +- core/chains/evm/config/toml/defaults/zkSync_Goerli.toml | 2 +- core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml | 2 +- core/scripts/ocr2vrf/util.go | 2 +- crib/values-profiles/values-dev.yaml.example | 4 ++-- 19 files changed, 20 insertions(+), 20 deletions(-) diff --git a/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml b/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml index 98c4f9b44ea..4c1de4f2a44 100644 --- a/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml +++ b/core/chains/evm/config/toml/defaults/Avalanche_Fuji.toml @@ -1,5 +1,5 @@ ChainID = '43113' -FinalityDepth = 1 +FinalityDepth = 10 LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' LogPollInterval = '3s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml b/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml index 77ba6e6b76d..0fba5e0d08a 100644 --- a/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Avalanche_Mainnet.toml @@ -1,5 +1,5 @@ ChainID = '43114' -FinalityDepth = 1 +FinalityDepth = 10 LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' LogPollInterval = '3s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml b/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml index 87c6384083b..b48cb25b325 100644 --- a/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Celo_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '42220' ChainType = 'celo' -FinalityDepth = 1 +FinalityDepth = 10 LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' diff --git a/core/chains/evm/config/toml/defaults/Celo_Testnet.toml b/core/chains/evm/config/toml/defaults/Celo_Testnet.toml index 0508e86da3a..d3f595baac6 100644 --- a/core/chains/evm/config/toml/defaults/Celo_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/Celo_Testnet.toml @@ -1,6 +1,6 @@ ChainID = '44787' ChainType = 'celo' -FinalityDepth = 1 +FinalityDepth = 10 LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' diff --git a/core/chains/evm/config/toml/defaults/Klaytn_Mainnet.toml b/core/chains/evm/config/toml/defaults/Klaytn_Mainnet.toml index c68f03b0446..93c74267cf2 100644 --- a/core/chains/evm/config/toml/defaults/Klaytn_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Klaytn_Mainnet.toml @@ -1,5 +1,5 @@ ChainID = '8217' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 NoNewHeadsThreshold = '30s' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Klaytn_Testnet.toml b/core/chains/evm/config/toml/defaults/Klaytn_Testnet.toml index 864aa0fa72a..af4db6b0d23 100644 --- a/core/chains/evm/config/toml/defaults/Klaytn_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/Klaytn_Testnet.toml @@ -1,5 +1,5 @@ ChainID = '1001' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 NoNewHeadsThreshold = '30s' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml index 3e8efa531cc..bf18336b383 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Mainnet.toml @@ -2,7 +2,7 @@ ChainID = '1088' ChainType = 'metis' # Sequencer offers absolute finality -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Metis_Rinkeby.toml b/core/chains/evm/config/toml/defaults/Metis_Rinkeby.toml index 7d9fec9076f..592c8026392 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Rinkeby.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Rinkeby.toml @@ -1,6 +1,6 @@ ChainID = '588' ChainType = 'metis' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml b/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml index 2391ee2cab3..5d9212403e8 100644 --- a/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Metis_Sepolia.toml @@ -1,6 +1,6 @@ ChainID = '59902' ChainType = 'metis' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 NoNewHeadsThreshold = '0' OCR.ContractConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml b/core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml index e087b86fe3e..5101a24ae1f 100644 --- a/core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/Scroll_Mainnet.toml @@ -1,5 +1,5 @@ ChainID = '534352' -FinalityDepth = 1 +FinalityDepth = 10 ChainType = 'scroll' LogPollInterval = '3s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml b/core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml index 9db7a8ebed5..b705d2da43e 100644 --- a/core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/Scroll_Sepolia.toml @@ -1,5 +1,5 @@ ChainID = '534351' -FinalityDepth = 1 +FinalityDepth = 10 ChainType = 'scroll' LogPollInterval = '3s' MinIncomingConfirmations = 1 diff --git a/core/chains/evm/config/toml/defaults/Simulated.toml b/core/chains/evm/config/toml/defaults/Simulated.toml index 3d01429c27c..7f5358d2ee8 100644 --- a/core/chains/evm/config/toml/defaults/Simulated.toml +++ b/core/chains/evm/config/toml/defaults/Simulated.toml @@ -1,5 +1,5 @@ ChainID = '1337' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 MinContractPayment = '100' NoNewHeadsThreshold = '0s' diff --git a/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml b/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml index ee50a9844a4..35cd4a90a2f 100644 --- a/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/WeMix_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '1111' ChainType = 'wemix' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 # WeMix emits a block every 1 second, regardless of transactions LogPollInterval = '3s' diff --git a/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml b/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml index 6cdb451eb1d..77092630a53 100644 --- a/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml +++ b/core/chains/evm/config/toml/defaults/WeMix_Testnet.toml @@ -1,6 +1,6 @@ ChainID = '1112' ChainType = 'wemix' -FinalityDepth = 1 +FinalityDepth = 10 MinIncomingConfirmations = 1 # WeMix emits a block every 1 second, regardless of transactions LogPollInterval = '3s' diff --git a/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml b/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml index be3bc22b812..e5ad8ec62aa 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml @@ -1,6 +1,6 @@ ChainID = '280' ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' diff --git a/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml b/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml index 84ddac91db3..4d9ae985151 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml @@ -1,6 +1,6 @@ ChainID = '324' ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' diff --git a/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml b/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml index 0801e54acc9..fd30088aba5 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml @@ -1,6 +1,6 @@ ChainID = '300' ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 LogPollInterval = '5s' MinIncomingConfirmations = 1 NoNewHeadsThreshold = '1m' diff --git a/core/scripts/ocr2vrf/util.go b/core/scripts/ocr2vrf/util.go index e57f349f1fd..d19e7289ab4 100644 --- a/core/scripts/ocr2vrf/util.go +++ b/core/scripts/ocr2vrf/util.go @@ -55,7 +55,7 @@ var ( Enabled = true [[EVM]] - FinalityDepth = 1 + FinalityDepth = 10 ChainID = '%d' [EVM.Transactions] diff --git a/crib/values-profiles/values-dev.yaml.example b/crib/values-profiles/values-dev.yaml.example index 99151149182..fecedf60aaf 100644 --- a/crib/values-profiles/values-dev.yaml.example +++ b/crib/values-profiles/values-dev.yaml.example @@ -31,7 +31,7 @@ chainlink: ChainID = "43113" MinContractPayment = '0' AutoCreateKey = true - FinalityDepth = 1 + FinalityDepth = 10 [[EVM.Nodes]] Name = 'avax-fuji-testnet-official' WSURL = 'wss://api.avax-test.network/ext/bc/C/ws' @@ -41,7 +41,7 @@ chainlink: ChainID = "97" MinContractPayment = '0' AutoCreateKey = true - FinalityDepth = 1 + FinalityDepth = 10 [[EVM.Nodes]] Name = 'bsc-testnet-official' HTTPURL = 'https://data-seed-prebsc-1-s.bnbchain.org:8545' From 1c80e5ad892dc1126ad1c8417358cec9a3bff48d Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 3 May 2024 12:03:08 -0400 Subject: [PATCH 02/11] run make config-docs --- docs/CONFIG.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 61ba9256d9d..3ff0da98474 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -3352,7 +3352,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '5s' @@ -3437,7 +3437,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '5s' @@ -3522,7 +3522,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'zksync' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '5s' @@ -3693,7 +3693,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'metis' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -3777,7 +3777,7 @@ GasLimit = 5400000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -3862,7 +3862,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'metis' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -4031,7 +4031,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'wemix' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '3s' @@ -4116,7 +4116,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'wemix' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '3s' @@ -4200,7 +4200,7 @@ GasLimit = 5400000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -4622,7 +4622,7 @@ GasLimit = 3800000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -4963,7 +4963,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'celo' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '5s' @@ -5047,7 +5047,7 @@ GasLimit = 5400000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LinkContractAddress = '0x0b9d5D9136855f6FEc3c0993feE6E9CE8a297846' LogBackfillBatchSize = 1000 @@ -5132,7 +5132,7 @@ GasLimit = 5400000 AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LinkContractAddress = '0x5947BB275c521040051D82396192181b413227A3' LogBackfillBatchSize = 1000 @@ -5218,7 +5218,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'celo' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '5s' @@ -5555,7 +5555,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'metis' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '15s' @@ -6236,7 +6236,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'scroll' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '3s' @@ -6321,7 +6321,7 @@ AutoCreateKey = true BlockBackfillDepth = 10 BlockBackfillSkip = false ChainType = 'scroll' -FinalityDepth = 1 +FinalityDepth = 10 FinalityTagEnabled = false LogBackfillBatchSize = 1000 LogPollInterval = '3s' From 9621f45e0d2f428d0f3b267658ff7bac14577106 Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 3 May 2024 12:10:53 -0400 Subject: [PATCH 03/11] update changeset --- .changeset/orange-years-divide.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/orange-years-divide.md diff --git a/.changeset/orange-years-divide.md b/.changeset/orange-years-divide.md new file mode 100644 index 00000000000..b9ab8acffca --- /dev/null +++ b/.changeset/orange-years-divide.md @@ -0,0 +1,5 @@ +--- +"chainlink": patch +--- + +update finality depth for chains #nops From 10062019d377b61bed0542c640ccf29a89cfd73c Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 3 May 2024 12:28:05 -0400 Subject: [PATCH 04/11] fix HistoryDepth --- core/chains/evm/config/toml/defaults/zkSync_Goerli.toml | 2 +- core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml | 2 +- core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml b/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml index e5ad8ec62aa..05d85cfe248 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Goerli.toml @@ -11,4 +11,4 @@ PriceMax = 18446744073709551615 PriceMin = 0 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 diff --git a/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml b/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml index 4d9ae985151..02ce2b0f18c 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Mainnet.toml @@ -11,4 +11,4 @@ PriceMax = 18446744073709551615 PriceMin = 0 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 diff --git a/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml b/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml index fd30088aba5..b4e957a6c99 100644 --- a/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml +++ b/core/chains/evm/config/toml/defaults/zkSync_Sepolia.toml @@ -11,4 +11,4 @@ PriceMax = 18446744073709551615 PriceMin = 0 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 From fa3a8a892861e80e09aeaa9d391395157c2a3725 Mon Sep 17 00:00:00 2001 From: James Walker Date: Fri, 3 May 2024 12:28:55 -0400 Subject: [PATCH 05/11] make config-docs --- docs/CONFIG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/CONFIG.md b/docs/CONFIG.md index 3ff0da98474..01b4376b80c 100644 --- a/docs/CONFIG.md +++ b/docs/CONFIG.md @@ -3402,7 +3402,7 @@ CheckInclusionPercentile = 90 TransactionPercentile = 60 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' @@ -3487,7 +3487,7 @@ CheckInclusionPercentile = 90 TransactionPercentile = 60 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' @@ -3572,7 +3572,7 @@ CheckInclusionPercentile = 90 TransactionPercentile = 60 [HeadTracker] -HistoryDepth = 5 +HistoryDepth = 50 MaxBufferSize = 3 SamplingInterval = '1s' From 276fa00349db7a28d63065be6b83ed39db57fc82 Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Wed, 15 May 2024 11:33:28 -0400 Subject: [PATCH 06/11] Added LogPoller replay --- core/services/ocr2/plugins/llo/integration_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index b6f752541f4..0938cb9085e 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -4,6 +4,7 @@ import ( "crypto/ed25519" "encoding/hex" "fmt" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "math/big" "math/rand" "strings" @@ -162,6 +163,13 @@ func TestIntegration_LLO(t *testing.T) { addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, "job-1") addOCRJobs(t, streams, serverPubKey, serverURL, verifierAddress, bootstrapPeerID, bootstrapNodePort, nodes, configStoreAddress, clientPubKeys, chainID, fromBlock) + for _, n := range append(nodes, bootstrapNode) { + chain, err := n.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) + require.NoError(t, err) + err = chain.LogPoller().Replay(tests.Context(t), 1) + require.NoError(t, err) + } + t.Run("receives at least one report per feed from each oracle when EAs are at 100% reliability", func(t *testing.T) { // Expect at least one report per channel from each oracle (keyed by transmitter ID) seen := make(map[ocr2types.Account]map[llotypes.ChannelID]struct{}) From 46985d7d5b47fc9a3d74f1dcd4bbcbdee6b1d84e Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Wed, 15 May 2024 12:37:32 -0400 Subject: [PATCH 07/11] linting fix --- core/services/ocr2/plugins/llo/integration_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index 0938cb9085e..f1cbe4eb8a7 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -4,13 +4,14 @@ import ( "crypto/ed25519" "encoding/hex" "fmt" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" "math/big" "math/rand" "strings" "testing" "time" + "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" + "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" From f7cb51949c6f61f28d05f1a6e8213768b2885e6c Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Wed, 15 May 2024 18:31:26 -0400 Subject: [PATCH 08/11] Added replay fix for MercuryV1 integration test --- core/services/ocr2/plugins/mercury/integration_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index 2339117d4e3..6ec1fe0e8ea 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -273,6 +273,13 @@ func integration_MercuryV1(t *testing.T) { } } + for _, n := range append(nodes, bootstrapNode) { + chain, err := n.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) + require.NoError(t, err) + err = chain.LogPoller().Replay(ctx, 1) + require.NoError(t, err) + } + // Setup config on contract onchainConfig, err := (datastreamsmercury.StandardOnchainConfigCodec{}).Encode(rawOnchainConfig) require.NoError(t, err) From 9aa35324a8a670aba2e2bc2b43a12ce11a393082 Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Mon, 20 May 2024 17:31:17 -0400 Subject: [PATCH 09/11] Updated finality depth commitments --- .../ocr2/plugins/llo/integration_test.go | 16 +++------------- .../ocr2/plugins/mercury/integration_test.go | 15 --------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index f1cbe4eb8a7..ed7348f1674 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -10,8 +10,6 @@ import ( "testing" "time" - "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/accounts/abi/bind/backends" "github.com/ethereum/go-ethereum/common" @@ -150,9 +148,6 @@ func TestIntegration_LLO(t *testing.T) { }) } - configDigest := setConfig(t, steve, backend, verifierContract, verifierAddress, nodes, oracles) - channelDefinitions := setChannelDefinitions(t, steve, backend, configStoreContract, streams) - // Bury everything with finality depth ch, err := nodes[0].App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) @@ -161,16 +156,11 @@ func TestIntegration_LLO(t *testing.T) { backend.Commit() } + configDigest := setConfig(t, steve, backend, verifierContract, verifierAddress, nodes, oracles) + channelDefinitions := setChannelDefinitions(t, steve, backend, configStoreContract, streams) + addBootstrapJob(t, bootstrapNode, chainID, verifierAddress, "job-1") addOCRJobs(t, streams, serverPubKey, serverURL, verifierAddress, bootstrapPeerID, bootstrapNodePort, nodes, configStoreAddress, clientPubKeys, chainID, fromBlock) - - for _, n := range append(nodes, bootstrapNode) { - chain, err := n.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) - require.NoError(t, err) - err = chain.LogPoller().Replay(tests.Context(t), 1) - require.NoError(t, err) - } - t.Run("receives at least one report per feed from each oracle when EAs are at 100% reliability", func(t *testing.T) { // Expect at least one report per channel from each oracle (keyed by transmitter ID) seen := make(map[ocr2types.Account]map[llotypes.ChannelID]struct{}) diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index 8b359257494..f4ec390c976 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -333,21 +333,6 @@ func integration_MercuryV1(t *testing.T) { backend.Commit() } - // Bury it with finality depth - ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) - require.NoError(t, err) - finalityDepth := ch.Config().EVM().FinalityDepth() - for i := 0; i < int(finalityDepth); i++ { - backend.Commit() - } - - for _, n := range append(nodes, bootstrapNode) { - chain, err := n.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) - require.NoError(t, err) - err = chain.LogPoller().Replay(ctx, 1) - require.NoError(t, err) - } - t.Run("receives at least one report per feed from each oracle when EAs are at 100% reliability", func(t *testing.T) { // Expect at least one report per feed from each oracle seen := make(map[[32]byte]map[credentials.StaticSizedPublicKey]struct{}) From 03eb07608de10a028fc1fd91700efee01efda237 Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Tue, 21 May 2024 20:09:45 -0400 Subject: [PATCH 10/11] linting issue fix --- .../ocr2/plugins/mercury/integration_test.go | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index cf2629f36a8..d22c204936b 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -225,7 +225,8 @@ func integration_MercuryV1(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) + var b []byte + b, err = io.ReadAll(req.Body) require.NoError(t, err) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) @@ -234,12 +235,12 @@ func integration_MercuryV1(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } })) @@ -579,7 +580,8 @@ func integration_MercuryV2(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) + var b []byte + b, err = io.ReadAll(req.Body) require.NoError(t, err) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) @@ -588,12 +590,12 @@ func integration_MercuryV2(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } })) @@ -868,7 +870,8 @@ func integration_MercuryV3(t *testing.T) { createBridge := func(name string, i int, p *big.Int, borm bridges.ORM) (bridgeName string) { bridge := httptest.NewServer(http.HandlerFunc(func(res http.ResponseWriter, req *http.Request) { - b, err := io.ReadAll(req.Body) + var b []byte + b, err = io.ReadAll(req.Body) require.NoError(t, err) require.Equal(t, `{"data":{"from":"ETH","to":"USD"}}`, string(b)) @@ -877,12 +880,12 @@ func integration_MercuryV3(t *testing.T) { res.WriteHeader(http.StatusOK) val := decimal.NewFromBigInt(p, 0).Div(decimal.NewFromInt(multiplier)).Add(decimal.NewFromInt(int64(i)).Div(decimal.NewFromInt(100))).String() resp := fmt.Sprintf(`{"result": %s}`, val) - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } else { res.WriteHeader(http.StatusInternalServerError) resp := `{"error": "pError test error"}` - _, err := res.Write([]byte(resp)) + _, err = res.Write([]byte(resp)) require.NoError(t, err) } })) From 58afd44d0f8c97e14f3f0a4718eadf11b5e01b1f Mon Sep 17 00:00:00 2001 From: Silas Lenihan Date: Wed, 22 May 2024 20:34:24 -0400 Subject: [PATCH 11/11] updated comments in tests --- core/services/ocr2/plugins/llo/integration_test.go | 2 +- core/services/ocr2/plugins/mercury/integration_test.go | 8 ++++---- .../ocr2/plugins/ocr2keeper/integration_21_test.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/services/ocr2/plugins/llo/integration_test.go b/core/services/ocr2/plugins/llo/integration_test.go index ed7348f1674..fd955879f56 100644 --- a/core/services/ocr2/plugins/llo/integration_test.go +++ b/core/services/ocr2/plugins/llo/integration_test.go @@ -148,7 +148,7 @@ func TestIntegration_LLO(t *testing.T) { }) } - // Bury everything with finality depth + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from ch, err := nodes[0].App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) finalityDepth := ch.Config().EVM().FinalityDepth() diff --git a/core/services/ocr2/plugins/mercury/integration_test.go b/core/services/ocr2/plugins/mercury/integration_test.go index d22c204936b..680b05bd4d4 100644 --- a/core/services/ocr2/plugins/mercury/integration_test.go +++ b/core/services/ocr2/plugins/mercury/integration_test.go @@ -184,7 +184,7 @@ func integration_MercuryV1(t *testing.T) { bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) - // Bury it with finality depth + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) finalityDepth := ch.Config().EVM().FinalityDepth() @@ -192,7 +192,7 @@ func integration_MercuryV1(t *testing.T) { backend.Commit() } - fromBlock := int(finalityDepth) // cannot use zero, start from block 1 + fromBlock := int(finalityDepth) // cannot use zero, start from finality depth // Set up n oracles var ( @@ -540,7 +540,7 @@ func integration_MercuryV2(t *testing.T) { bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) - // Bury it with finality depth + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) finalityDepth := ch.Config().EVM().FinalityDepth() @@ -830,7 +830,7 @@ func integration_MercuryV3(t *testing.T) { bootstrapNode := Node{App: appBootstrap, KeyBundle: bootstrapKb} logObservers = append(logObservers, observedLogs) - // Bury it with finality depth + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) finalityDepth := ch.Config().EVM().FinalityDepth() diff --git a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go index f35bac3319b..cd992b1ea61 100644 --- a/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go +++ b/core/services/ocr2/plugins/ocr2keeper/integration_21_test.go @@ -656,7 +656,7 @@ func setupNodes(t *testing.T, nodeKeys [5]ethkey.KeyV2, registry *iregistry21.IK appBootstrap, bootstrapTransmitter, bootstrapKb, } - // Bury it with finality depth + // Commit blocks to finality depth to ensure LogPoller has finalized blocks to read from ch, err := bootstrapNode.App.GetRelayers().LegacyEVMChains().Get(testutils.SimulatedChainID.String()) require.NoError(t, err) finalityDepth := ch.Config().EVM().FinalityDepth()