Skip to content

chore: removed custom pre_dispatch for pallet_midnight#1235

Open
Klapeyron wants to merge 1 commit intomainfrom
chore/removed_pre_dispatch
Open

chore: removed custom pre_dispatch for pallet_midnight#1235
Klapeyron wants to merge 1 commit intomainfrom
chore/removed_pre_dispatch

Conversation

@Klapeyron
Copy link
Copy Markdown
Contributor

@Klapeyron Klapeyron commented Apr 3, 2026

Overview

Non-functional refactor. pallet_midnight no longer overrides ValidateUnsigned::pre_dispatch; it uses the Substrate trait default, which forwards to validate_unsigned(TransactionSource::InBlock, call) and maps the result to Ok(()) / TransactionValidityError.

To keep behavior identical to the old custom pre_dispatch, validate_unsigned now branches on TransactionSource: the in-block path uses the real block context and LedgerApi::validate_guaranteed_execution (what the removed pre_dispatch did); the local/external path keeps the existing pool validation (LedgerApi::validate_transaction, adjusted tblock, tags, longevity, etc.). No change to what the runtime accepts or rejects—only where that logic lives so the default pre_dispatch is correct.

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

@Klapeyron Klapeyron self-assigned this Apr 3, 2026
@Klapeyron Klapeyron force-pushed the chore/removed_pre_dispatch branch from 7eb8868 to 21da1b2 Compare April 3, 2026 09:20
@Klapeyron Klapeyron marked this pull request as ready for review April 3, 2026 11:23
@Klapeyron Klapeyron requested a review from a team as a code owner April 3, 2026 11:23
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