-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat(runtime): add metadata signed-extension #2097
Conversation
cccf0c3
to
e2b6389
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
975b993
to
4064783
Compare
@@ -304,6 +304,7 @@ pub type SignedExtra = ( | |||
pallet_frequency_tx_payment::ChargeFrqTransactionPayment<Runtime>, | |||
pallet_msa::CheckFreeExtrinsicUse<Runtime>, | |||
pallet_handles::handles_signed_extension::HandlesSignedExtension<Runtime>, | |||
frame_metadata_hash_extension::CheckMetadataHash<Runtime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do this for passkey unsigned ext? Maybe yes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think that sounds like a good idea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to ensure that the offline wallets are signing the expected data structure (metadata). Since we are doing the signing via passkey adding this does not bring any additional value at this point since the metadata is a totally foreign concept from passkey's perspective.
We might be able to utilize this check in future by adding this metadata hash inside PasskeyCall<T: Config>
type and that would allow us to ensure the passkey signature was done on a correct metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I’ve been considering it. Since this is an unsigned transaction, it might not be the best fit. However, I believe we are still signing the call function within the outer call. I wonder if we can verify that the hash of the metadata used at the time of signing matches the root.
We would have to implement the UI for this in any case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm , maybe we can add a story for passkey pallet to also add/support hash verification
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall! Added some questions
.export_heap_base() | ||
.import_memory() | ||
substrate_wasm_builder::WasmBuilder::init_with_defaults() | ||
.enable_metadata_hash("FRQCY", 8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why is this 8
for decimals? On reference implementation it's 14
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for asking about the number of decimals for the token. It prompted me to check, and I confirmed that both Frequency and Paseo have the same number of decimals.
@@ -304,6 +304,7 @@ pub type SignedExtra = ( | |||
pallet_frequency_tx_payment::ChargeFrqTransactionPayment<Runtime>, | |||
pallet_msa::CheckFreeExtrinsicUse<Runtime>, | |||
pallet_handles::handles_signed_extension::HandlesSignedExtension<Runtime>, | |||
frame_metadata_hash_extension::CheckMetadataHash<Runtime>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to ensure that the offline wallets are signing the expected data structure (metadata). Since we are doing the signing via passkey adding this does not bring any additional value at this point since the metadata is a totally foreign concept from passkey's perspective.
We might be able to utilize this check in future by adding this metadata hash inside PasskeyCall<T: Config>
type and that would allow us to ensure the passkey signature was done on a correct metadata.
3edcc5f
to
7148439
Compare
7148439
to
5cf3517
Compare
5cf3517
to
687dc11
Compare
Add a new signed extension that enables the metadata hash verification feature approved under [RFC 0078](https://polkadot-fellows.github.io/RFCs/approved/0078-merkleized-metadata.html#rfc-0078-merkleized-metadata). This enhancement will support the new generic ledger hardware wallet app and future hardware wallets within the Polkadot ecosystem. [Reference implementation](paritytech/polkadot-sdk#4580)
9d93940
to
4c6082b
Compare
Add a new signed extension that enables the metadata hash verification feature approved under RFC 0078. This enhancement will support the new generic ledger hardware wallet app and future hardware wallets within the Polkadot ecosystem.
Reference implementation