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

Fix sidechain nonce retrieval #2619

Merged
merged 8 commits into from
Mar 27, 2024
Merged

Fix sidechain nonce retrieval #2619

merged 8 commits into from
Mar 27, 2024

Conversation

0xverin
Copy link
Contributor

@0xverin 0xverin commented Mar 26, 2024

Context

invalidNonce occurred in ci. After checking, the sidechain nonce is missing auto-increment in the tests step.

@0xverin 0xverin requested a review from silva-fj March 26, 2024 10:05
Copy link
Contributor

@Traf333 Traf333 left a comment

Choose a reason for hiding this comment

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

It seems like test still fails

  expected LinkIdentityFailed, received InvalidNonce instead

@silva-fj
Copy link
Contributor

Interesting, it fails now in the single worker setup but it passes in the multi worker one

@0xverin
Copy link
Contributor Author

0xverin commented Mar 26, 2024

It seems like test still fails

  expected LinkIdentityFailed, received InvalidNonce instead

I refactored this part of the code(getSidechainNonce), chose nonce incremental way, and will finally check the value of sidechiannonce. I deleted the tests case for link invalid identity because the use of nonce here is confusing. I will correct this in this PR. If you have time, please take a look at this PR as well. :p

@0xverin 0xverin requested a review from Traf333 March 26, 2024 15:22
@0xverin
Copy link
Contributor Author

0xverin commented Mar 26, 2024

Interesting, it fails now in the single worker setup but it passes in the multi worker one

This is another issue. I guess it might be caused by the problem here..

@0xverin 0xverin changed the title Fix sidechain nonce getting Fix sidechain nonce retrieval Mar 27, 2024
@0xverin
Copy link
Contributor Author

0xverin commented Mar 27, 2024

In addition, getSidechainNonce was not able to keep up with the speed of the ts-tests update before, as shown below:

    ✔ check user sidechain storage after linking (2007ms)
Got response: {"value":"0x00000000","do_watch":false,"status":"Ok"}
context.api.createType('Index', nonce) <BN: 0>

it should not be 0 after linking
I think the speed of ts-tests is accelerated after we cancel the parachain event listening, and sidechainnonce is not updated in time.
Either we should sleep every time we get sidechain nonce, or can increase it by self. I prefer the latter, because each sleep should be at least 10 seconds, which will lengthen the test time.
This is also why I chose to rewrite this part of the code, and I did check in the end whether the final sidechain nonce is the value we expect.

@0xverin 0xverin merged commit 7a270b3 into dev Mar 27, 2024
24 of 26 checks passed
@0xverin 0xverin deleted the quick-fix-sidechian-nonce branch March 27, 2024 12:40
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.

3 participants