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

Batch verify fix #804

Closed
kamilsa opened this issue Jul 5, 2021 · 1 comment
Closed

Batch verify fix #804

kamilsa opened this issue Jul 5, 2021 · 1 comment

Comments

@kamilsa
Copy link
Contributor

kamilsa commented Jul 5, 2021

In block 1089328 (#767 ) one of the problem Kagome team faced was related to crypto batch verification. Expected and implemented behaviour was the following:

  1. Batch begins (ext_start_batch_verify)
  2. Messages and signatures are queued

Not 100% about this part, but Internally ext_sr25519_verify postpones verification and just returns true even for invalid signatures if verification was invoked inside the batch (at least that way it was implemented in Kagome by this moment)

  1. Batch ends and verification of all queued signatures begins. True is returned if all signatures are valid and false otherwise (ext_finish_batch_verify)

Surprisingly correct behaviour (at least for this block) was the following:

  1. Batch begins (ext_start_batch_verify)
  2. Signature verification is not postponed and it just goes to verify it (like here)
  3. Batch ends and returns true even if inside batch there were invalid signatures (here)

So statement below is not true, at least for block 1089328
image

For now we will just keep things as it is done in smoldot, but later we need to investigate and return correct behaviour

@kamilsa
Copy link
Contributor Author

kamilsa commented Jul 6, 2021

That was the reason of such behaviour paritytech/substrate#6616

@kamilsa kamilsa closed this as completed Jul 6, 2021
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

No branches or pull requests

1 participant