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

possibility to disable metadata verification #592

Closed
niklasad1 opened this issue Jul 4, 2022 · 1 comment · Fixed by #593
Closed

possibility to disable metadata verification #592

niklasad1 opened this issue Jul 4, 2022 · 1 comment · Fixed by #593

Comments

@niklasad1
Copy link
Member

niklasad1 commented Jul 4, 2022

Hey,

I have dedicated use-case that I care that some certain calls in a pallet works and optionally that decoding some events.

When an extrinsic is submitted then subxt reports IncompatibleMetadata but the extrinsic itself was successfully transmitted to the chain.

Thus, I would want to disable this check metadata check and only fail if I get transaction verification error when the RPC call fails when using SubmittableExtrinsic::sign_and_submit_then_watch.

What would be the downside disabling the metadata check completely? Some events could not be decoded?

@jsdw
Copy link
Collaborator

jsdw commented Jul 5, 2022

The metadata validation checks a couple of things:

  1. Does the actual shape of the information you're trying to submit line up with what the node is expecting? The node itself will kick up a fuss anyway if this isn't true, but validation will catch it sooner without it needing to be submitted (and can, although doesn't really atm, provide a much nicer description of what went wrong).
  2. Does the semantic information line up? For example, the static codegen might have struct Foo { a: u64, b: u64 } but the node might be expecting { b: u64, a: u64 }. The encoded structure/types would all line up and be valid, but in fact we've swapped a and b around so the thing you submit probably won't do what you want any more. Basically, if the names of fields/structs change, validation will spot that change and disallow because it could be that the meaning has changed even if the shape hasn't.

I'm in favour of being able to opt out of validation though; sometimes you just want to YOLO it because you know better and not have this extra check!

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 a pull request may close this issue.

2 participants