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.
DecryptedRejected
Event Removed v361 → v385 (removed) #2Emitted when a decrypted transaction failed to execute due to a dispatch error.
The Big Picture
The encryption worked, the decryption worked, but the inner transaction failed. This is like a normal transaction failure (insufficient balance, wrong parameters, etc.) but wrapped in MEV protection. The reason field tells you what went wrong so you can fix it and retry.
Why This Matters
If your encrypted transaction fails, you need to know why. This event means the MEV protection part worked fine, but the underlying transaction had an issue. Check the 'reason' field for the specific dispatch error - it's the same error you'd get from a normal unencrypted transaction.
Example Scenario
You encrypted a remove_stake for 1000 TAO but only have 500 TAO staked. DecryptedRejected fires with id=0x123..., reason=NotEnoughStakeToWithdraw. The encryption worked, but the stake removal failed. Fix the amount and resubmit an encrypted transaction.
Common Questions
- Did I waste my encryption effort?
- Unfortunately yes - you paid for submit_encrypted but the inner transaction failed. Always validate your inner transaction parameters before encrypting to avoid this.
- How is this different from DecryptionFailed?
- DecryptedRejected means decryption succeeded but the inner transaction had an error (like NotEnoughBalance). DecryptionFailed means the cryptographic decryption itself failed (wrong key, corrupted data).
Use Cases
- Diagnose why your MEV-protected transaction failed
- Track failure rates in MEV protection system
- Build error handling for MEV-protected flows
- Audit transaction rejection reasons
How to Use This Event
- → Subscribe to your submission IDs to catch failures
- → Parse reason field for specific error handling
- → Index failures to improve MEV protection UX
From Chain Metadata
Decrypted execution rejected.
Triggers
Preconditions
- Decryption succeeded (this isn't a decryption failure)
- Commitment matched (inner transaction is authentic)
- Inner transaction dispatch failed
Effects
Postconditions
- Submission removed from Submissions storage
- Inner transaction not applied
- Error reason captured in event
Side Effects
- User may have paid for encryption but transaction didn't execute
- State unchanged from inner transaction's perspective
Event Data
| # | Name | Type | Description |
|---|---|---|---|
| 0 | id → submission_id | H256 | Identifier of the submission that was decrypted but failed execution |
| 1 | reason → dispatch_error | DispatchErrorWithPostInfo | Error that caused the inner transaction to fail |
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 DecryptedRejected events
api.query.system.events((events) => {
events
.filter(({ event }) =>
event.section === stringCamelCase("MevShield") &&
event.method === "DecryptedRejected"
)
.forEach(({ event }) => {
console.log("DecryptedRejected:", event.data.toHuman());
});
});Runtime Info
View Source- Pallet Index
- 30
- Event Index
- 2
- First Version
- v361
- Removed In
- v385