Skip to content

protocols/rpc: add UseUpgradedAuth flag to SimulateTransactionRequest#5948

Merged
Shaptic merged 7 commits into
stellar:mainfrom
Ryang-21:simulate-tx-auth-v2
Jun 18, 2026
Merged

protocols/rpc: add UseUpgradedAuth flag to SimulateTransactionRequest#5948
Shaptic merged 7 commits into
stellar:mainfrom
Ryang-21:simulate-tx-auth-v2

Conversation

@Ryang-21

@Ryang-21 Ryang-21 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

What

Adds an AuthV2 UseUpgradedAuth field (json:"useUpgradedAuth,omitempty") to protocols/rpc.SimulateTransactionRequest,
the request type for the RPC simulateTransaction method. When set to true, it asks the
simulator to record authorization entries using SorobanCredentials AddressV2 ("v2")
instead of Address ("v1").

Also adds test coverage:

  • JSON (de)serialization of the new field, including omitempty behavior 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 the
    ENVELOPE_TYPE_SOROBAN_AUTHORIZATION_WITH_ADDRESS HashIDPreimage arm.

Why

Protocol 27 introduced a v2 authorization model with new credential XDR types. The
simulateTransaction RPC method exposes an authV2 useUpgradedAuth request flag so clients can opt into
having recorded auth entries returned in the v2 credential format. Surfacing this on the
SDK's request type lets rpcclient (and other consumers of protocols/rpc) request v2 auth
recording. The XDR round-trip tests lock in correct encode/decode behavior for the newly
generated v2 credential types.

Copilot AI review requested due to automatic review settings June 10, 2026 19:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 authV2 to SimulateTransactionRequest and verifies JSON marshal/unmarshal behavior.
  • Extends RPC tests to cover authV2 defaulting 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.

Comment thread protocols/rpc/simulate_transaction.go Outdated
Comment thread xdr/soroban_credentials_test.go Outdated
Comment thread protocols/rpc/simulate_transaction_test.go Outdated
Comment thread xdr/soroban_credentials_test.go Outdated
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread protocols/rpc/simulate_transaction.go
@Ryang-21 Ryang-21 changed the title protocols/rpc: add authV2 flag to SimulateTransactionRequest protocols/rpc: add UseUpgradedAuth flag to SimulateTransactionRequest Jun 18, 2026
@Shaptic Shaptic merged commit 308407e into stellar:main Jun 18, 2026
11 checks passed
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.

3 participants