This event was removed in v385
This event is no longer emitted in the current runtime. Existed from v361 to v385. Shown here for historical reference.
DecryptionFailed
Event Removed v361 → v385 (removed) #3Emitted when the validator couldn't decrypt an encrypted submission.
The Big Picture
Something went wrong with the cryptography. Maybe you encrypted with the wrong epoch's key, the ciphertext was corrupted, or the format was invalid. The validator couldn't decrypt your submission, so your transaction is lost. The 'reason' field helps diagnose what went wrong.
Why This Matters
If decryption fails, your transaction is gone - the inner contents can't be recovered. This event tells you what went wrong (wrong key? bad format?) so you can fix your client and retry. Always test encryption carefully before submitting real transactions.
Example Scenario
You cached an old NextKey and encrypted with it, but the key epoch expired before your submission was processed. DecryptionFailed fires with id=0x123..., reason='KeyExpired'. Your transaction is lost. Fix: Always fetch fresh NextKey immediately before encrypting.
Common Questions
- Can I recover my transaction?
- No. If decryption failed, the inner transaction is unrecoverable. This is why testing encryption flow thoroughly before real usage is critical.
- What are common failure reasons?
- 1) KeyExpired - used wrong epoch's key, 2) ML-KEM decapsulate failed - key/ciphertext mismatch, 3) AEAD decrypt failed - corrupted data, 4) Invalid format - wrong ciphertext structure.
- Could the validator be lying about failure?
- Technically yes, but it's auditable. False decryption failures would damage validator reputation and could be detected by comparing expected vs actual behavior across many submissions.
Use Cases
- Diagnose encryption/submission problems
- Track decryption failure rates
- Debug MEV-protection client implementations
- Audit validator behavior
How to Use This Event
- → Monitor your submission IDs for this failure event
- → Parse reason to fix client-side encryption bugs
- → Alert on elevated decryption failure rates
From Chain Metadata
Decryption failed - validator could not decrypt the submission.
Triggers
Emitted by
Preconditions
- Submission existed in Submissions storage
- Decryption was attempted by block author
- Cryptographic operation failed
Effects
Storage Modified
Postconditions
- Submission removed from Submissions storage
- Failure reason recorded in event
- Inner transaction never seen or executed
Side Effects
- User's encrypted transaction lost (can't be recovered)
- Provides debugging information via reason field
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | id → submission_id | H256 | Identifier of the submission that could not be decrypted |
| 1 | reason → failure_reason | BoundedVec | Human-readable reason for the decryption failure |
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Subscribe to DecryptionFailed events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("MevShield") &&
event.method === "DecryptionFailed"
)
.forEach(({ event }) => {
console.log("DecryptionFailed:", event.data.toHuman());
});
});Runtime Info
View Source- Pallet Index
- 30
- Event Index
- 3
- First Version
- v361
- Removed In
- v385