Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] - Validate transaction without submission #999

Open
frog357 opened this issue Dec 27, 2024 · 4 comments
Open

[FR] - Validate transaction without submission #999

frog357 opened this issue Dec 27, 2024 · 4 comments

Comments

@frog357
Copy link

frog357 commented Dec 27, 2024

Internal/External
Internal if an IOHK staff member.
External otherwise.

Area
Token Locking Related to Token Locking (Allegra).
Native Tokens Related to Native Tokens (Mary).
Plutus Related to Plutus Scripts (Alonzo).
Other Any other topic (Delegation, Ranking, ...).

Describe the feature you'd like
The ability to validate a transaction before submit. Having a flag that would perform all the same checks as cardano-cli transaction submit but without the submit part.

Additional context / screenshots
Suggestion:
cardano-cli transaction validate --tx-file infile --mainnet

@smelc
Copy link
Contributor

smelc commented Jan 3, 2025

cc @Jimbo4350 @CarlosLopezDeLara

@carbolymer
Copy link
Contributor

We had a short chat with @Jimbo4350 . This may require changes in consensus / ledger first, before we can make changes in cli.

@CarlosLopezDeLara
Copy link
Contributor

Yes, such validation would correspond to the node. In particular, I think would need changes to mempool.

@frog357 Can you tell us more about this FR? What kind of benefits brings or what problems it solves?

@frog357
Copy link
Author

frog357 commented Jan 10, 2025

I didn’t go into the code to determine the exact requirements, but I was hoping it was modular enough to perform the same validations in the submit routine without actually submitting. In some languages, this is referred to as a "lint" command—the ability to completely validate a transaction’s eligibility to submit without encountering unexpected errors.

Errors like the one included below (for reference) illustrate the kind of issues this could prevent. While I don’t need help with this particular error—I’ve already found the solution—it inspired me to suggest the idea of a "transaction linting" feature. I believe it could improve the ecosystem by offering users a way to preemptively validate transactions.

Unfortunately, I don’t have the capability to create a pull request for this feature myself, but I hope this suggestion resonates with those who are more technically equipped to implement it. It’s a feature people might not realize they need until they encounter scenarios like mine—pushing the limits of transaction size or complexity. For example, when posting a transaction that approaches or exceeds the maximum size, there’s currently no way to know whether it will succeed until submission is attempted.

cardano-cli: DecoderFailure (LocalStateQuery HardForkBlock (': * ByronBlock (': * (ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)) ('[] *)))))))) Query (BlockQuery (HardForkBlock (': * ByronBlock (': * (ShelleyBlock (TPraos StandardCrypto) (ShelleyEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AllegraEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (MaryEra StandardCrypto)) (': * (ShelleyBlock (TPraos StandardCrypto) (AlonzoEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (BabbageEra StandardCrypto)) (': * (ShelleyBlock (Praos StandardCrypto) (ConwayEra StandardCrypto)) ('[] *))))))))))) ServerAgency TokQuerying BlockQuery (QueryIfCurrent (QS (QS (QS (QS (QS (QS (QZ (GetDRepState (fromList []))))))))))) (DeserialiseFailure 37 "Size mismatch when decoding Record RecD.\nExpected 4, but found 3.")

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

No branches or pull requests

4 participants