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

Protocol 20: Add support for resource leeway in simulateTransaction #374

Open
2 tasks
Shaptic opened this issue Dec 16, 2023 · 0 comments
Open
2 tasks

Protocol 20: Add support for resource leeway in simulateTransaction #374

Shaptic opened this issue Dec 16, 2023 · 0 comments

Comments

@Shaptic
Copy link

Shaptic commented Dec 16, 2023

Upcoming Soroban RPC Change

The v20.1.0 version of Soroban RPC introduces the following additive change:

Which changes the request schema for the simulateTransaction endpoint, adding the optional resourceConfig parameter, which, for now, contains a single field:

{
  "transaction": "<base64-encoded transaction>",
  "resourceConfig" {
    "instructionLeeway": 0   // <number of add'l CPU instructions to reserve>
  }
}

Though this is an optional parameter, it may require an update depending on how you were submitting the request via JSON-RPC previously. Namely, optional parameters are treated differently depending on whether or not you are POSTing with an object (i.e. params: { transaction: "..." }) or an array (i.e. params: [ "..." ]). In the latter case, the optional parameter will not be honored and the request will be met with the following error:

{
  "jsonrpc": "2.0",
  "id": 2,
  "error": {
    "code": -32602,
    "message": "invalid parameters",
    "data": "[-32602] got 1 parameters, want 2"
  }
}
  • Please update your SDK to use object-based parameter passing in JSON-RPC (if necessary) and allow users to optionally specify this additional CPU instruction leeway parameter.
  • Please also note the set of breaking schema changes that occurred in the stable Protocol 20 release, described here.

Reference implementation

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

1 participant