Skip to content
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

CNS-374: fix vrfIndex mismatch between consumer and provider #430

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

orenl-lava
Copy link
Contributor

Following a data reliability message, the provider verifies that it indeed is the designated provider by checking that its "self" vrfIndex matches that of the client.

This got broken with the use of subscription in E2E tests, becuase the default plan uses 5 providers while E2E uses 2 providers, the while the consumer uses the number of providers from the pairing, the provider gets it from the plan. Since they disagree, the VRF output also (likely) differs and triggers error.

The error message was:

testutil/e2e/logs/05_LavaProvider_01_errors.log:Apr  2 08:10:13 ERR
Provider identified invalid vrfIndex in data reliability request, the given
index and self index are different GUID=16864668971218711883....

Actually, in the non-subscription case, the providers gets that number from the params. Therefore, similar issue would happen also in any case where the number of providers in a consumer's current pairing differs from that saved in the params.

This commit fixes the issue by teaching the provider to use the pairing to get the respective data. It also adds it to ProviderSessionsWithConsumer struct for fast access.

Following a data reliability message, the provider verifies that it indeed is
the designated provider by checking that its "self" vrfIndex matches that of
the client.

This got broken with the use of subscription in E2E tests, becuase the default
plan uses 5 providers while E2E uses 2 providers, the while the consumer uses
the number of providers from the pairing, the provider gets it from the plan.
Since they disagree, the VRF output also (likely) differs and triggers error.

The error message was:

    testutil/e2e/logs/05_LavaProvider_01_errors.log:Apr  2 08:10:13 ERR
    Provider identified invalid vrfIndex in data reliability request, the given
    index and self index are different GUID=16864668971218711883....

Actually, in the non-subscription case, the providers gets that number from
the params. Therefore, similar issue would happen also in any case where the
number of providers in a consumer's current pairing differs from that saved in
the params.

This commit fixes the issue by teaching the provider to use the pairing to get
the respective data. It also adds it to `ProviderSessionsWithConsumer struct`
for fast access.
@orenl-lava orenl-lava force-pushed the CNS-374-VRF-self-index-mismatch branch from 60b3831 to 33af6db Compare April 19, 2023 11:57
@ranlavanet ranlavanet added the bug Something isn't working label Apr 19, 2023
@omerlavanet omerlavanet merged commit 6b87806 into main Apr 20, 2023
@omerlavanet omerlavanet deleted the CNS-374-VRF-self-index-mismatch branch April 20, 2023 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants