protocols/rpc: add UseUpgradedAuth flag to SimulateTransactionRequest#5948
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds test coverage and API surface for Soroban auth “v2” constructs and an authV2 flag on the RPC simulate-transaction request.
Changes:
- Introduces XDR round-trip tests for Soroban credential v2 union arms, delegate signatures, and a new hash-id preimage arm.
- Adds
authV2toSimulateTransactionRequestand verifies JSON marshal/unmarshal behavior. - Extends RPC tests to cover
authV2defaulting and round-tripping.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| xdr/soroban_credentials_test.go | New XDR round-trip and union-arm mapping tests for Soroban auth v2 types. |
| protocols/rpc/simulate_transaction_test.go | Adds JSON tests for the new authV2 request field. |
| protocols/rpc/simulate_transaction.go | Adds AuthV2 to SimulateTransactionRequest. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 327d51d135
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
What
Adds an
AuthV2UseUpgradedAuthfield (json:"useUpgradedAuth,omitempty") toprotocols/rpc.SimulateTransactionRequest,the request type for the RPC
simulateTransactionmethod. When set totrue, it asks thesimulator to record authorization entries using
SorobanCredentialsAddressV2("v2")instead of
Address("v1").Also adds test coverage:
JSON (de)serialization of the new field, includingomitemptybehavior and a full round-trip.XDR round-trip tests for the v2 Soroban authorization types these credentials rely on:
SOROBAN_CREDENTIALS_ADDRESS_V2,SOROBAN_CREDENTIALS_ADDRESS_WITH_DELEGATES,SorobanDelegateSignature(including recursive nested delegates), and theENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESSHashIDPreimagearm.Why
Protocol 27 introduced a v2 authorization model with new credential XDR types. The
simulateTransactionRPC method exposes anauthV2useUpgradedAuthrequest flag so clients can opt intohaving recorded auth entries returned in the v2 credential format. Surfacing this on the
SDK's request type lets
rpcclient(and other consumers ofprotocols/rpc) request v2 authrecording. The XDR round-trip tests lock in correct encode/decode behavior for the newly
generated v2 credential types.