From 7999d45a99a9107cccdab0697d9bfbdffcdd56c0 Mon Sep 17 00:00:00 2001 From: Ryan Tinianov Date: Tue, 19 Dec 2023 16:06:10 -0500 Subject: [PATCH] More debug stuff --- core/scripts/go.mod | 2 +- core/scripts/go.sum | 4 +-- core/services/relay/evm/chain_reader.go | 2 +- integration-tests/go.mod | 2 +- integration-tests/go.sum | 4 +-- .../smoke/chain_reader_and_codec_test.go | 33 +++++++++++++++---- 6 files changed, 33 insertions(+), 14 deletions(-) diff --git a/core/scripts/go.mod b/core/scripts/go.mod index 99b5120fb53..8d5f3724c55 100644 --- a/core/scripts/go.mod +++ b/core/scripts/go.mod @@ -240,7 +240,7 @@ require ( github.com/smartcontractkit/chainlink-common v0.1.7-0.20231218192030-a1f59aa9e04b // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/core/scripts/go.sum b/core/scripts/go.sum index 21ca9bbe626..d4ab4dee392 100644 --- a/core/scripts/go.sum +++ b/core/scripts/go.sum @@ -1154,8 +1154,8 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff67 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 h1:PmJRQUEd46glRHQWCrMyRTWfTocG5SlMovIOei25+ho= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc= diff --git a/core/services/relay/evm/chain_reader.go b/core/services/relay/evm/chain_reader.go index 3e63bb79c89..b42de6ddc70 100644 --- a/core/services/relay/evm/chain_reader.go +++ b/core/services/relay/evm/chain_reader.go @@ -85,7 +85,7 @@ func (cr *chainReader) getLatestValueFromLogPoller(ctx context.Context, contract return err } - log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Finalized) + log, err := cr.lp.LatestLogByEventSigWithConfs(hash, ae.addr, logpoller.Unconfirmed) if err != nil { errStr := err.Error() if strings.Contains(errStr, "not found") || strings.Contains(errStr, "no rows") { diff --git a/integration-tests/go.mod b/integration-tests/go.mod index d2d5b4e89d6..a64e08d11b5 100644 --- a/integration-tests/go.mod +++ b/integration-tests/go.mod @@ -347,7 +347,7 @@ require ( github.com/smartcontractkit/caigo v0.0.0-20230621050857-b29a4ca8c704 // indirect github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679 // indirect github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 // indirect - github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 // indirect + github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 // indirect github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a // indirect github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 // indirect github.com/smartcontractkit/tdh2/go/ocr2/decryptionplugin v0.0.0-20230906073235-9e478e5e19f1 // indirect diff --git a/integration-tests/go.sum b/integration-tests/go.sum index bfcc31312f8..9c4dfa1693b 100644 --- a/integration-tests/go.sum +++ b/integration-tests/go.sum @@ -1438,8 +1438,8 @@ github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff67 github.com/smartcontractkit/chainlink-cosmos v0.4.1-0.20231128204301-ee4297eff679/go.mod h1:2Jx7bTEk4ujFQdsZpZq3A0BydvaVPs6mX8clUfxHOEM= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1 h1:xYqRgZO0nMSO8CBCMR0r3WA+LZ4kNL8a6bnbyk/oBtQ= github.com/smartcontractkit/chainlink-data-streams v0.0.0-20231204152908-a6e3fe8ff2a1/go.mod h1:GuPvyXryvbiUZIHmPeLBz4L+yJKeyGUjrDfd1KNne+o= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312 h1:PmJRQUEd46glRHQWCrMyRTWfTocG5SlMovIOei25+ho= -github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219191350-07dbf91e3312/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802 h1:gTbzH7DfK6N4RbO+SAAdJUnkaZ5Gu5IHjZdF40Fufbg= +github.com/smartcontractkit/chainlink-feeds v0.0.0-20231219204752-f623ecc16802/go.mod h1:Mr81s6sKCXcIyxv6cJ4OOPEdbxLCY6BkO7NiP26AOJ0= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a h1:JoyTazNcqXvZoMQjNfB0eapnlaoMS6pI0NeRvouRvog= github.com/smartcontractkit/chainlink-solana v1.0.3-0.20231130211003-6d1bb2f0b68a/go.mod h1:rioELYwPY2xBtzPRN/D08Y7iTPbIQEjPknYdJK51CzQ= github.com/smartcontractkit/chainlink-starknet/relayer v0.0.1-beta-test.0.20231128204445-3d61b12a0006 h1:1GzOKT53e8N7ZPwsyf1hSbKsynZmXmLOIL3DMvGq9sc= diff --git a/integration-tests/smoke/chain_reader_and_codec_test.go b/integration-tests/smoke/chain_reader_and_codec_test.go index e4bcade2711..f6f26fef447 100644 --- a/integration-tests/smoke/chain_reader_and_codec_test.go +++ b/integration-tests/smoke/chain_reader_and_codec_test.go @@ -86,6 +86,9 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) { require.NoError(t, err, "Error configuring OCRv2 aggregator contracts") fmt.Println("built agg") + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 50) + require.NoError(t, err) + err = actions.StartNewOCR2Round(1, aggregatorContracts, env.EVMClient, time.Minute*5, l) require.NoError(t, err, "Error starting new OCR2 round") @@ -95,10 +98,8 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) { require.NoError(t, err, "Getting latest answer from OCR contract shouldn't fail") fmt.Println("get latest") - require.Equal(t, int64(5), roundData.Answer.Int64(), - "Expected latest answer from OCR contract to be 5 but got %d", - roundData.Answer.Int64(), - ) + fmt.Printf("want 50 it's %v\n", roundData.Answer.Int64()) + fmt.Println("answer") err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 10) @@ -113,11 +114,29 @@ func TestOCRv2BasicWithChainReaderAndCodec(t *testing.T) { require.NoError(t, err, "Error getting latest OCR answer") fmt.Println("got answer 2") - require.Equal(t, int64(10), roundData.Answer.Int64(), + fmt.Printf("want 10 it's %v\n", roundData.Answer.Int64()) + + err = env.MockAdapter.SetAdapterBasedIntValuePath("ocr2", []string{http.MethodGet, http.MethodPost}, 15) + require.NoError(t, err) + fmt.Println("adapter 2") + + err = actions.StartNewOCR2Round(3, aggregatorContracts, env.EVMClient, time.Minute*5, l) + require.NoError(t, err) + fmt.Println("new round 3") + + roundData, err = aggregatorContracts[0].GetRound(testcontext.Get(t), big.NewInt(3)) + require.NoError(t, err, "Error getting latest OCR answer") + fmt.Println("got answer 3") + + fmt.Printf("want 15 it's %v\n", roundData.Answer.Int64()) + + /*require.Equal(t, int64(10), roundData.Answer.Int64(), "Expected latest answer from OCR contract to be 10 but got %d", roundData.Answer.Int64(), - ) + )*/ - fmt.Println("values equal") + fmt.Println("SLEEPING NOW") + time.Sleep(time.Hour) + fmt.Println("DONE SLEEPING") require.Fail(t, "Capture logs") }