Skip to content

Fix interface tests for passing params to GetLatestValue #1108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: NONEVM-1064/querykey-integration-tests
Choose a base branch
from

Conversation

reductionista
Copy link
Contributor

@reductionista reductionista commented Feb 26, 2025

@reductionista reductionista force-pushed the chore/NONEVM-1312-batch_get_latest_value_interface_tests branch from 2b4bb86 to f24ab00 Compare February 26, 2025 07:35
@reductionista reductionista force-pushed the chore/NONEVM-1312-batch_get_latest_value_interface_tests branch from bcb1b95 to b1c687b Compare February 27, 2025 03:59
@reductionista reductionista changed the title exclusively use big endian for big ints Fix interface tests for passing params to GetLatestValue Feb 27, 2025
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
1 New Blocker Issues (required ≤ 0)
E Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube

Catch issues before they fail your Quality Gate with our IDE extension SonarQube IDE SonarQube IDE

@@ -0,0 +1,36 @@
-- logpoller db table initialization for tests. loosely based on what's in chainlnk repo
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a strategy for keeping these in sync?

Copy link
Contributor Author

@reductionista reductionista Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that as part of the EVM Extraction epic (probably the last step?) the sql migrations for solana will get moved into chainlink-solana. At that point, I'm assuming we would combine them here.

In the meantime, I guess the ideal strategy would be to have chainlink CI run these Solana interface tests, or at least this one. (Not sure if that's something we already do? I know there are some Solana integration tests that get run.) If that happens, then any time we update the schema in the chainlink repo in a way that breaks this test, we'll immediately be prompted to fix it by updating it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime, I guess the ideal strategy would be to have chainlink CI run these Solana interface tests, or at least this one.

It looks like the only Solana integration test that chainlink CI runs is TestSolanaOCRV2Smoke (via make test_smoke):
https://github.com/smartcontractkit/chainlink-solana/blob/develop/Makefile#L93

At present, the purpose of this test schema is just to make sure that LogPoller doesn't error out when the interface tests are run without an external db, as soon as it starts up. Otherwise even the GetLatestValue interface tests wouldn't pass in CI. We still have to disable any that have a non-trivial dependence on the external db (ie, most of the ones where we search for events).

The only time this schema needs to be updated is if there are code changes to LogPoller in this repo which break the interface tests in this repo's CI (due to the new LogPoller code not being compatible with the test schema), so that will be caught immediately anyway, even if we keep the chainlink CI as-is.

But the real issue is that if someone makes a change to the db schema in chainlink repo, we would like any incompatibility with the LogPoller ORM that uses it to be caught immediately. That means we should be running something besides the OCRV2 smoke test anyway. This is already a problem on develop branch. It's not directly related to this test schema but a side effect of breaking the correspondence between Solana LogPoller code and chainlink schema would be the two schemas would also be out of sync.

Ideally, there would be a CCIP smoke test that gets run for this purpose. Until we have that, I think it does make sense to have it run the Solana relay interface tests instead. But there is one problem with that I hadn't thought of in my previous comment: we've completely disabled any of them which depend on an external db, due to them not being able to run in Solana CI.

I guess what we need is a way of disabling them if they're run from this CI, but not if they're run from chainlink CI--I'll look into that.

Comment on lines +944 to +946
pdaStructData2Prefix := make([]byte, len(pdaStructData1Prefix))
copy(pdaStructData2Prefix, pdaStructData1Prefix)
binary.LittleEndian.PutUint64(pdaStructData2Prefix[11:19], 2)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: couldn't we just do the same thing as pdaStructData1Prefix here so you don't have to replace specific indexes?

Suggested change
pdaStructData2Prefix := make([]byte, len(pdaStructData1Prefix))
copy(pdaStructData2Prefix, pdaStructData1Prefix)
binary.LittleEndian.PutUint64(pdaStructData2Prefix[11:19], 2)
pdaStructData2Prefix := make([]byte, len(pdaStructDataPrefix))
copy(pdaStructData2Prefix, pdaStructDataPrefix)
pdaStructData2Prefix = binary.LittleEndian.AppendUint64(pdaStructData2Prefix, 2)
pdaStructData2Prefix = binary.LittleEndian.AppendUint64(pdaStructData2Prefix, idx)

Copy link
Contributor

This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 11, 2025
@archseer archseer removed the Stale label May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants