This call was removed in v385

This call is no longer available in the current runtime. Existed from v361 to v385. Shown here for historical reference.

mark_decryption_failed

Call Removed v361 → v385 (removed) #3

Marks an encrypted submission as failed to decrypt, removing it from storage .

Click items to navigate. Pan and zoom to explore.

Used by: validators

The Big Picture

Sometimes decryption fails - maybe the user encrypted with the wrong key, used invalid format, or the ciphertext was corrupted. Validators use this call to formally mark such failures, which removes the submission and emits an event so the user knows what happened.

Why This Matters

Without a formal failure mechanism, failed decryptions would leave orphaned submissions in storage. This call provides transparency - users can see DecryptionFailed events and understand why their transaction didn't execute.

Example Scenario

You're a validator processing encrypted submissions. One submission fails ML-KEM decapsulation (wrong key epoch). You call mark_decryption_failed(submission_id, 'ML-KEM decapsulate failed'). The DecryptionFailed event fires, the submission is removed, and the user can diagnose the issue.

Common Questions

What are common decryption failure reasons?
1) User encrypted with wrong epoch's key (KeyExpired), 2) Invalid ciphertext format, 3) AEAD authentication failed (corruption), 4) ML-KEM decapsulation error.
Can validators abuse this to reject valid transactions?
They could, but it's auditable - all mark_decryption_failed calls are on-chain with reasons. Validators who falsely reject valid submissions would be identified and lose reputation.

Use Cases

  • Handle malformed encrypted submissions
  • Report encryption failures to users via events
  • Clean up failed submissions from storage

From Chain Metadata

Marks a submission as failed to decrypt and removes it from storage. Called by the block author when decryption fails at any stage (e.g., ML-KEM decapsulate failed, AEAD decrypt failed, invalid ciphertext format, etc.). This allows clients to be notified of decryption failures through on-chain events.

Part of: MEV Shield

Input Parameters

#NameTypeDescription
0
id
H256 T::Hashid: Cryptographic hash (32 bytes)
1
reason
BoundedVec BoundedVec<u8, ConstU32<256>>reason (BoundedVec)

Permissions

Origin
Unknown
Required Role

Permission data inferred from metadata. May be incomplete.

Requirements

  • Caller is the current block author (validator)
  • Submission with given ID exists in Submissions
  • Decryption genuinely failed (ML-KEM, AEAD, or format error)

Effects

Events Emitted

Storage Modified

Postconditions

  • Submission removed from Submissions storage
  • DecryptionFailed event emitted with reason

Side Effects

  • User's encrypted transaction will not execute
  • Provides audit trail of why decryption failed

Code Examples

// ----------------------------------------------------------------------
// HEADS UP: 1 arg below has a complex type with no usable default.
// Look for `undefined as any` and replace it with real value
// before running — the snippet compiles, but will fail at runtime as-is.
// ----------------------------------------------------------------------
import { createClient, Binary } from "polkadot-api";
import { getWsProvider } from "polkadot-api/ws";
import { sub } from "@polkadot-api/descriptors"; // generated by: npx papi add sub -w wss://entrypoint-finney.opentensor.ai:443

const client = createClient(getWsProvider("wss://entrypoint-finney.opentensor.ai:443"));
const api = client.getTypedApi(sub);

// Build mark_decryption_failed call (typed, named args)
const id = "0x0000000000000000000000000000000000000000000000000000000000000000";
const reason = undefined as any /* BoundedVec — replace with real value */;

const tx = api.tx.MevShield.mark_decryption_failed({
  id,
  reason,
});

Runtime Info

View Source
Pallet Index
30
Call Index
3
First Version
v361
Removed In
v385