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

Refactor user nonce logic. #649

Merged
merged 20 commits into from
Jul 26, 2023
Merged

Refactor user nonce logic. #649

merged 20 commits into from
Jul 26, 2023

Conversation

mariacarmina
Copy link
Member

@mariacarmina mariacarmina commented Jul 3, 2023

Fixes #648 .

Changes proposed in this PR:

  • solve Invalid signature error
  • fix bug in nonce endpoint
  • convert & store provider nonces into integers.

@mariacarmina mariacarmina self-assigned this Jul 3, 2023
@bogdanfazakas
Copy link
Member

@mariacarmina i think there is a use case that is not well handled, if the address sent is a fresh one the provider returns a null response instead of creating a new entrance for the new address and return 0 maybe

@mariacarmina
Copy link
Member Author

mariacarmina commented Jul 17, 2023

@mariacarmina i think there is a use case that is not well handled, if the address sent is a fresh one the provider returns a null response instead of creating a new entrance for the new address and return 0 maybe

I suggest to create a new entry and return the new nonce value instead of 0 or null.

@bogdanfazakas
Copy link
Member

@mariacarmina i think there is a use case that is not well handled, if the address sent is a fresh one the provider returns a null response instead of creating a new entrance for the new address and return 0 maybe

I suggest to create a new entry an return the new nonce value instead of 0 or null.

yep agreed with the new nonce value, 0 was just a better alternative for null

@mariacarmina mariacarmina requested a review from alexcos20 July 17, 2023 10:36
@mariacarmina
Copy link
Member Author

A fresh address will be stored as a new entry in a database with 1 as the nonce value.

@mariacarmina
Copy link
Member Author

Tested on barge & mumbai a compute flow (end to end) and it worked as expected, without occurring InvalidSignatureError (I could start the C2D job, get the status & results of the algorithm, get the C2D envs successfully).
To mention that I tested these modifications on a separate VM (hosted in US) which has better hardware resources.

@mariacarmina mariacarmina marked this pull request as ready for review July 20, 2023 09:42
@@ -46,7 +47,7 @@ def process_compute_request(data):


def sign_for_compute(wallet, owner, job_id=None):
nonce = datetime.now(timezone.utc).timestamp()
nonce = datetime.now(timezone.utc).timestamp() * 1000
Copy link
Member

Choose a reason for hiding this comment

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

if we handle this in a new issue, then lgtm

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.

Unable to purchase computed data with mumbai testnet due to Invalid signature error
3 participants