Open
Conversation
Contributor
🚨🚨🚨 HOTFIX DETECTED 🚨🚨🚨It looks like you are trying to merge a hotfix PR into If you are trying to merge a hotfix PR, please complete the following essential steps:
If you do not complete these steps, your hotfix may be inadvertently removed in the future when branches are promoted to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion PR to the opentensor/polkadot-sdk#6
Update MEV shield on subtensor — a system that encrypts transactions client-side so their contents
are hidden from the mempool, preventing front-running and sandwich attacks. Block authors decrypt
shielded transactions at block building time using ML-KEM-768 + XChaCha20-Poly1305.
Changes
pallet-shieldannounce_next_keyinherent: rotatesCurrentKey ← NextKeyeach block and publishes theupcoming block author's ML-KEM public key so users can encrypt for them
submit_encryptedextrinsic: accepts an encrypted ciphertext wrapper from userstry_decode_shielded_tx/try_unshield_tx: runtime helpers called by the blockproposer (via the
ShieldApiruntime API) to detect, decrypt, and decode shielded transactionsCheckShieldedTxValiditytransaction extension: validateskey_hashagainstCurrentKey/NextKeyduring block import; pool validation only checks ciphertext structure toavoid spurious rejections from stale views
FindAuthorstrait for resolving current and next block authorstp-io(new crate — host functions)mlkem768_decapsulate: ML-KEM-768 decapsulation via theShieldKeystoreextensionaead_decrypt: XChaCha20-Poly1305 decryption via theShieldKeystoreextensionSubtensorHostFunctionsfor registration in the nodeNode integration
ShieldKeystoreis created inservice.rsand threaded through to the proposer and inherentproviders
ShieldInherentDataProvideradded to Aura and Babe consensus configurationsKeyRotationServicegenerates a new ML-KEM keypair on each own-block importSubtensorHostFunctionsregistered in the client executorRuntime integration
ShieldApiruntime API implemented (try_decode_shielded_tx,try_unshield_tx)CheckShieldedTxValidityadded to the transaction extension pipelineTests
pallet-shield: key rotation,try_decode_shielded_tx,try_unshield_tx, depth-limitprotection, inherent creation
CheckShieldedTxValidityextension: key_hash matching against CurrentKey/NextKey, malformedciphertext rejection, pool vs in-block source behavior