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: CheckMetadataHash signedExtension support #5882

Merged
merged 9 commits into from
May 20, 2024
Merged

Conversation

TarikGul
Copy link
Member

@TarikGul TarikGul commented May 15, 2024

closes: #5881
rel: paritytech/polkadot-sdk#4274

Update:

Tested

Using Txwrapper-core to create the Payloads and to create a SubmittableExtrinsic and a SignedExtrinsic with it, in order to confirm this addition didn't break any historic compatibility.

},

// This is the CheckMetadataHash SignedExtension type.
MetadataHash: 'Option<Vec<u8>>'
Copy link

Choose a reason for hiding this comment

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

So the mode is an enum/u8. And the additional signed is a special type that encodes to nothing if mode == 0, otherwise it only passes a [u8; 32].

@@ -5,6 +5,13 @@ import type { ExtDef, ExtInfo } from './types.js';

import { emptyCheck } from './emptyCheck.js';

const CheckMetadataHash: ExtInfo = {
extrinsic: {
metadataHash: 'MetadataHash'
Copy link

Choose a reason for hiding this comment

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

Suggested change
metadataHash: 'MetadataHash'
metadataHash: 'u8'

@TarikGul
Copy link
Member Author

Just as a note, @bee344 is going to take over adding this into the API to free up some resources for me so I can also finish some additional high priority bugs in Apps.

Thanks again @bee344 🙏

@bkchr
Copy link

bkchr commented May 17, 2024

@bee344 when are you planning to tackle this? I will also need this for my pr to pass CI :D

@bee344
Copy link
Contributor

bee344 commented May 17, 2024

@bkchr I'll do it today

@bkchr
Copy link

bkchr commented May 17, 2024

heads up @bee344 some last minute changes to the signed extension, the signed data is now an Option<Hash>

@bee344 bee344 changed the title CheckMetadataHash signedExtension support fix: CheckMetadataHash signedExtension support May 20, 2024
@bee344 bee344 marked this pull request as ready for review May 20, 2024 11:54
@bee344
Copy link
Contributor

bee344 commented May 20, 2024

@TarikGul
Copy link
Member Author

@bee344 Small nits. We should also add a test for in SignerPayload.spec.ts.

@bee344
Copy link
Contributor

bee344 commented May 20, 2024

Update:
Tested against:

  1. https://github.com/paritytech/polkadot-sdk/tree/bkchr-metadata-hash
  2. Client v1.11.0 polkadot --dev
  3. Live Westend Relay Chain v1.11.0

Using Txwrapper-core to create the Payloads and to create a SubmittableExtrinsic and a SignedExtrinsic with it.

@bee344 bee344 merged commit b392c19 into master May 20, 2024
4 checks passed
@bee344 bee344 deleted the tg-checkMetadataHash branch May 20, 2024 16:31
@bkchr
Copy link

bkchr commented May 21, 2024

@TarikGul @bee344 could I please get a release with this included?

@TarikGul
Copy link
Member Author

@bkchr Yup, its scheduled to be released today :)

@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CheckMetadataHash SignedExtension Support
4 participants