Do not bypass simulation result auth entries processing#501
Draft
aditya1702 wants to merge 3 commits intomainfrom
Draft
Do not bypass simulation result auth entries processing#501aditya1702 wants to merge 3 commits intomainfrom
aditya1702 wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR tightens Soroban transaction handling to prevent bypassing auth-entry verification when building/signing channel-account transactions, and extends the GraphQL simulation-result input conversion to carry through host function results.
Changes:
- Reject Soroban
InvokeHostFunctiontransactions when the simulation response has empty/nilresults, ensuring auth entries cannot be skipped. - Extend GraphQL
convertSimulationResultto parse and populate simulationresultsfrom JSON-encoded strings. - Add/extend unit tests covering the new validation and GraphQL conversion behavior.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/services/transaction_service.go | Adds a new validation error and enforces non-empty simulation Results for InvokeHostFunction. |
| internal/services/transaction_service_test.go | Adds test cases to confirm InvokeHostFunction rejects empty/nil results while other Soroban ops may allow it. |
| internal/serve/graphql/resolvers/resolver.go | Parses SimulationResultInput.Results strings into entities.RPCSimulateHostFunctionResult. |
| internal/serve/graphql/resolvers/mutations.resolvers.go | Maps the new Soroban validation error to INVALID_SOROBAN_TRANSACTION. |
| internal/serve/graphql/resolvers/mutations_resolvers_test.go | Adds tests for GraphQL error mapping and for convertSimulationResult results parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
What
Resultsarray when building transaction.InvokeHostFunctionand thesimulationResult.Resultsfield is empty.Why
TODO
Known limitations
N/A
Issue that this PR addresses
Closes #502