This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Invalid signatures passed to a pallet's method stop block import #6585
Labels
I3-bug
The node fails to follow expected behavior.
We have a pallet with a function that accepts an SR25199 signature and verifies it. Our implementation looks like this:
And a verify method which verifies the signature
This setup worked fine for us until recently where we discovered that our network was stopping to finalise with an error about Signature verification.
After investigating this issue we discovered that the nodes start throwing this exception when we submit a signature that fails validation.
We looked into it a bit more and found the root cause to be this PR: d615043
Prior to this change, the verify method (defined here: primitives/runtime/src/traits.rs) uses a method called sr25519_verify to simply do the verification and return the result (defined here: primitives/io/src/lib.rs).
After this PR,
sr25519_verify
adds all signature verification requests into a vector and does a batch verification when a block is executed, so if we pass in an invalid signature to our pallet, instead of the pallet returning an error and continuing (as it normally does), it errors when trying to execute the block.Do you have any suggestions on how to fix this problem?
Thanks.
The text was updated successfully, but these errors were encountered: