Skip to content

MEV Shield V2: Introduce fee refund system with reason tracking#2587

Open
shamil-gadelshin wants to merge 2 commits intodevnet-readyfrom
mev-shield-v2-refund
Open

MEV Shield V2: Introduce fee refund system with reason tracking#2587
shamil-gadelshin wants to merge 2 commits intodevnet-readyfrom
mev-shield-v2-refund

Conversation

@shamil-gadelshin
Copy link
Copy Markdown
Collaborator

Summary

  • Add fee refund mechanism for encrypted extrinsics dispatched during on_initialize, refunding the difference between the weight charged at store_encrypted time and the actual weight consumed during dispatch
  • Introduce RefundReason enum (Success, Failure, Expired) to categorize refunds and emit ExtrinsicRefunded events.
  • Refund logic is gated by refund_enabled() (for Success/Failure) and refund_on_expiration() (for Expired) via the EncryptedExtrinsicFees trait
  • Runtime implementation uses LinearWeightToFee to convert weight difference to balance; no refund is issued on decode failure, weight exceeded, or postponement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant