Skip to content

Commit

Permalink
Algod: Additional simulation result information (#4439)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Diamant <[email protected]>
Co-authored-by: Jason Paulos <[email protected]>
  • Loading branch information
3 people authored Feb 24, 2023
1 parent 292b807 commit b41ae08
Show file tree
Hide file tree
Showing 28 changed files with 4,474 additions and 1,843 deletions.
80 changes: 70 additions & 10 deletions daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,7 @@
"application/x-binary"
],
"produces": [
"application/json",
"application/msgpack"
],
"schemes": [
Expand All @@ -1232,11 +1233,14 @@
"type": "string",
"format": "binary"
}
},
{
"$ref": "#/parameters/format"
}
],
"responses": {
"200": {
"$ref": "#/responses/SimulationResponse"
"$ref": "#/responses/SimulateResponse"
},
"400": {
"description": "Bad Request - Malformed Algorand transaction",
Expand Down Expand Up @@ -3321,6 +3325,49 @@
}
}
},
"SimulateTransactionGroupResult": {
"description": "Simulation result for an atomic transaction group",
"type": "object",
"required": [
"txn-results"
],
"properties": {
"txn-results": {
"description": "Simulation result for individual transactions",
"type": "array",
"items": {
"$ref": "#/definitions/SimulateTransactionResult"
}
},
"failure-message": {
"description": "If present, indicates that the transaction group failed and specifies why that happened",
"type": "string"
},
"failed-at": {
"description": "If present, indicates which transaction in this group caused the failure. This array represents the path to the failing transaction. Indexes are zero based, the first element indicates the top-level transaction, and successive elements indicate deeper inner transactions.",
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"SimulateTransactionResult": {
"description": "Simulation result for an individual transaction",
"type": "object",
"required": [
"txn-result"
],
"properties": {
"txn-result": {
"$ref": "#/definitions/PendingTransactionResponse"
},
"missing-signature": {
"description": "A boolean indicating whether this transaction is missing signatures",
"type": "boolean"
}
}
},
"StateProof": {
"description": "Represents a state proof and its corresponding message",
"type": "object",
Expand Down Expand Up @@ -3485,7 +3532,7 @@
"msgpack"
],
"type": "string",
"description": "Configures whether the response object is JSON or MessagePack encoded.",
"description": "Configures whether the response object is JSON or MessagePack encoded. If not provided, defaults to JSON.",
"name": "format",
"in": "query"
},
Expand Down Expand Up @@ -3964,24 +4011,37 @@
}
}
},
"SimulationResponse": {
"SimulateResponse": {
"description": "Result of a transaction group simulation.",
"tags": [
"experimental"
],
"schema": {
"type": "object",
"required": [
"failure-message",
"missing-signatures"
"version",
"last-round",
"txn-groups",
"would-succeed"
],
"properties": {
"failure-message": {
"description": "\\[fm\\] Failure message, if the transaction would have failed during a live broadcast.",
"type": "string"
"version": {
"description": "The version of this response object.",
"type": "integer"
},
"last-round": {
"description": "The round immediately preceding this simulation. State changes through this round were used to run this simulation.",
"type": "integer"
},
"txn-groups": {
"description": "A result object for each transaction group that was simulated.",
"type": "array",
"items": {
"$ref": "#/definitions/SimulateTransactionGroupResult"
}
},
"missing-signatures": {
"description": "\\[ms\\] Whether any transactions would have failed during a live broadcast because they were missing signatures.",
"would-succeed": {
"description": "Indicates whether the simulated transactions would have succeeded during an actual submission. If any transaction fails or is missing a signature, this will be false.",
"type": "boolean"
}
}
Expand Down
Loading

0 comments on commit b41ae08

Please sign in to comment.