feat: add midnight_validateTransaction RPC endpoint with detailed errors#867
Draft
feat: add midnight_validateTransaction RPC endpoint with detailed errors#867
Conversation
Add a new RPC endpoint that validates transactions natively and returns detailed error information including the original error data that was previously lost during lossy type conversions. The endpoint is rate limited via governor with configurable global and per-transaction limits. Validation dispatches to the correct ledger version (ledger_8 or hard_fork_test) based on the runtime's reported ledger version, and returns a version-agnostic ValidationError with error_code, reason, and details fields. JIRA: PM-21415
Extract the native_api module from an inline definition in lib.rs to a dedicated ledger/src/native_api.rs file.
Contributor
…ries Read validation context directly from storage in the RPC layer instead of going through a dedicated runtime API, avoiding a runtime API version bump. StateKey, ParentTimestamp, and Timestamp::Now are read via storage queries; spec_version via CallApiAt::runtime_version_at; max_block_weight is passed from the node as a config value.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.








Overview
Addresses https://shielded.atlassian.net/browse/PM-21415 using @kapke 's suggestion for a new RPC endpoint
🗹 TODO before merging
📌 Submission Checklist
🧪 Testing Evidence
Please describe any additional testing aside from CI:
🔱 Fork Strategy
Links