Skip to content
Merged
Show file tree
Hide file tree
Changes from 127 commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
8f840dc
Add simulate endpoint to OpenAPI file
jdtzmn Jul 20, 2022
62f4b59
Basic simulation endpoint with failure message
jdtzmn Jul 25, 2022
505bc50
Return msgpack response instead of JSON
jdtzmn Jul 26, 2022
58846a3
Test Simulator class with basic pay transactions
jdtzmn Jul 27, 2022
e242bc4
Use genesis methods for block header creation
jdtzmn Jul 27, 2022
63805af
Test simple group transaction
jdtzmn Jul 27, 2022
5d93ceb
Trivial app create and call test
jdtzmn Jul 27, 2022
2c8c912
Remove budget error gatekeeping for now
jdtzmn Jul 27, 2022
b9f96ee
Add invalid signature check
jdtzmn Jul 28, 2022
e52d1bf
Lowercase simulate test methods to make them private
jdtzmn Jul 28, 2022
a9f4d1a
Add balance change test
jdtzmn Jul 28, 2022
8a54d2e
Merge branch 'feature/simulate-endpoint' into psuedo-eval-endpoint
jdtzmn Jul 29, 2022
301a366
Implement newly included ledger methods introduced in the merge
jdtzmn Jul 29, 2022
06d0063
Fix unkeyed struct fields
jdtzmn Jul 29, 2022
0631333
Fix golint errors
jdtzmn Jul 29, 2022
7f0b564
Spec file changes
jdtzmn Aug 1, 2022
6e5c9ce
Use new flag for configuring simulation endpoint visibility
jdtzmn Aug 2, 2022
64567aa
Check node status separately from transaction decoding
jdtzmn Aug 2, 2022
fc76cb2
Write interface annotations
jdtzmn Aug 2, 2022
760bbfb
Add docstring to MakeLedgerForRound
jdtzmn Aug 2, 2022
cc6e605
Use error type to fix fragile signature error check
jdtzmn Aug 2, 2022
c51926f
Fix signature check and add invalid signature test
jdtzmn Aug 2, 2022
deb330f
Test reject app call
jdtzmn Aug 2, 2022
19cdb73
Disable transaction simulator by default
jdtzmn Aug 4, 2022
462a9dd
Fix API spec descriptions
jdtzmn Aug 5, 2022
b2c4f51
Improve `decodeTxGroup`
jdtzmn Aug 4, 2022
6ec12f1
Clean up simulator ledger
jdtzmn Aug 5, 2022
b5473ae
Add invalid transaction group test
jdtzmn Aug 5, 2022
307709d
Make `SignatureError` a struct
jdtzmn Aug 5, 2022
7995700
Cleanup simulator tests
jdtzmn Aug 5, 2022
02d0947
Remove “contact us” language and cut helper function used in only one…
jdtzmn Aug 5, 2022
a3e0f59
Handle returned error from `attachGroupID`
jdtzmn Aug 5, 2022
dad0197
Cleaner implementation by going through `Node` instead of `LedgerForAPI`
jdtzmn Aug 8, 2022
ac72228
Rename `makeSimulateEnv` to `prepareSimulatorTest`
jdtzmn Aug 8, 2022
50304a3
Use `MissingSignatures` boolean instead of `SignatureFailureMessage`
jdtzmn Aug 8, 2022
33dda59
Implement renamed `MissingSignatures`
jdtzmn Aug 8, 2022
f1c0b05
Improve Simulator `check` to catch badly formed transactions when sig…
jdtzmn Aug 8, 2022
f90c19a
Document allowing unsigned transactions
jdtzmn Aug 8, 2022
394f7e7
Correctly catch CompactCert special case
jdtzmn Aug 9, 2022
be38467
Simplify TxnIsMissingSig logic
jdtzmn Aug 9, 2022
970d9f4
Fix linter errors
jdtzmn Aug 9, 2022
595ca6b
Refactor Simulator to be more general
jdtzmn Aug 9, 2022
5f45dfe
Deprecate no longer needed `SimulationResult`
jdtzmn Aug 9, 2022
7897a2e
Fix shortened property names in API spec
jdtzmn Aug 9, 2022
051cbef
Test pooled fees
jdtzmn Aug 9, 2022
65cba5c
Support verifying transaction groups with missing signatures
jdtzmn Aug 9, 2022
b78e899
Test non-overriden `data.Ledger` methods used during evaluation have …
jdtzmn Aug 9, 2022
7324c0e
Redesign DebuggerHook to support more hooks
jdtzmn Jul 29, 2022
ad3be73
Remove unnecessary cx.Debugger checks
jdtzmn Jul 29, 2022
2176d2d
Support `afterTealOp` hook
jdtzmn Jul 29, 2022
cb381d8
Fix test name typo
jdtzmn Aug 10, 2022
195ac07
Support `beforeInnerTxn` and `afterInnerTxn` hooks
jdtzmn Aug 11, 2022
e2eb402
Support `beforeTxn` and `afterTxn` hooks
jdtzmn Aug 11, 2022
2d92ad4
Return error in `LookupLatest` override since panics within API handl…
jdtzmn Aug 10, 2022
2f189d2
Add missing `PartitionTest()`
jdtzmn Aug 11, 2022
5bf32e7
Improve test step description
jdtzmn Aug 12, 2022
c7996d3
Favor explicit returns within `txnGroupBatchVerify`
jdtzmn Aug 18, 2022
08f8e5e
Remove unused `ScopedSimulatorError` artifact
jdtzmn Aug 18, 2022
f16d378
Fix dryrun hooks and docstrings
jdtzmn Aug 18, 2022
83fae5c
Fix incorrect debugger hooks lifecycle test
jdtzmn Aug 18, 2022
2a30a89
Implement additional `BeforeTxn` and `AfterTxn` responsibilities
jdtzmn Aug 18, 2022
f32981a
Rename inner transaction hooks and add documentation
jdtzmn Aug 18, 2022
8c90301
Fix dryrun debugger hooks so the logic stays consistent with previous…
jdtzmn Aug 18, 2022
251cc15
Use correctly named debugger hooks within the TEAL debugger
jdtzmn Aug 18, 2022
9bbd757
Fix tealdbg debugger hooks so the logic stays consistent with previou…
jdtzmn Aug 18, 2022
b9acbf7
Fix unnecessary calls to `cx.refreshDebugState`
jdtzmn Aug 18, 2022
0c99043
Support LogicSigs within `logic.DebuggerHook`
jdtzmn Aug 18, 2022
6e448a8
Remove extra space (#4435)
jdtzmn Aug 19, 2022
139672a
Undo changes to txn verification code, use proxy signer instead
jasonpaulos Aug 23, 2022
6ad7387
More simulator tests
jasonpaulos Aug 23, 2022
47e83dc
Merge branch 'master' into psuedo-eval-endpoint
jasonpaulos Aug 23, 2022
ba5d43e
Fix merge issues
jasonpaulos Aug 23, 2022
82f31c8
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Aug 23, 2022
d3e4253
Merge branch 'feature/simulate-endpoint' into psuedo-eval-endpoint
jasonpaulos Aug 23, 2022
bf3907b
Revert unintended change
jasonpaulos Aug 23, 2022
1e518be
Not sure what happened, but fix routes again
jasonpaulos Aug 23, 2022
5da2cd8
Merge branch 'psuedo-eval-endpoint' into extend-debugger-interface
jasonpaulos Aug 24, 2022
e7ce7fc
Add comments about future LogicSig support
jasonpaulos Aug 24, 2022
6e106ba
Merge branch 'psuedo-eval-endpoint' into extend-debugger-interface
jasonpaulos Aug 24, 2022
75d5326
Rename TxnGroupForDebugger -> TxnGroupWithDebugger
jasonpaulos Aug 24, 2022
dd27558
Fix debugger not being able to handle logicsigs
jasonpaulos Aug 24, 2022
4cf359e
godog
jasonpaulos Aug 24, 2022
042704a
Make a copy of the txgroup when checking sigs
jasonpaulos Aug 29, 2022
ca59421
CR feedback
jasonpaulos Aug 29, 2022
a0a0550
Merge pull request #4322 from jdtzmn/psuedo-eval-endpoint
jasonpaulos Aug 29, 2022
6673103
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Aug 29, 2022
488d748
Split debugger code into current and legacy
jasonpaulos Aug 30, 2022
ce98909
Separate debugger tests better and fix error
jasonpaulos Aug 30, 2022
8bdbd5f
Remove DebugState from EvalContext, bring back DebuggerHook helper me…
jasonpaulos Aug 30, 2022
d7981a8
More legacy debugger tests
jasonpaulos Aug 30, 2022
82b75e9
Fix missed debugger
jasonpaulos Aug 30, 2022
959261f
Combine app and logicsig eval hooks into one & expose logic.RunMode
jasonpaulos Aug 30, 2022
25899d0
More testing
jasonpaulos Aug 30, 2022
1908046
Remove debugger arg from PrepareGroupContext, enhance evaluator and v…
jasonpaulos Aug 31, 2022
e5fd2a1
Make all debugger methods required
jasonpaulos Sep 19, 2022
b99b80b
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Oct 31, 2022
ad5f515
Fix generate config files
jasonpaulos Oct 31, 2022
2a2b8a9
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Oct 31, 2022
115421f
Reorder debugger hook functions
jasonpaulos Oct 31, 2022
533c239
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Nov 1, 2022
1219bef
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Nov 1, 2022
1c7c406
WIP
jasonpaulos Nov 8, 2022
807b384
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Dec 8, 2022
3f4e74e
Clarify group transactions are also acceptable
jasonpaulos Dec 8, 2022
4a74a24
Try to appease the new parallel linter
jasonpaulos Dec 8, 2022
2f083e8
Classify simulation endpoint as experimental
jasonpaulos Dec 9, 2022
3c5bc99
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Dec 9, 2022
70ddd43
Rename EnableTransactionSimulator to EnableExperimentalAPI
jasonpaulos Dec 12, 2022
6de00a4
Update config.json.example
jasonpaulos Dec 12, 2022
c2dfb80
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Dec 12, 2022
a76ce0c
File renames
jasonpaulos Dec 12, 2022
3ef9112
Rename DebuggerHook to EvalTracer and remove error return values from…
jasonpaulos Dec 14, 2022
f153f4a
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Dec 14, 2022
d1f0d0e
Make experimental routes public
jasonpaulos Dec 14, 2022
845425b
Add to API docs
jasonpaulos Dec 14, 2022
075e288
Missing change to README
jasonpaulos Dec 14, 2022
b1ee178
Linter bug
jasonpaulos Dec 14, 2022
336038e
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Dec 14, 2022
f3ea97e
debuggerEvalTracerAdaptor embeds NullEvalTracer
jasonpaulos Dec 14, 2022
987fd51
Rename EvalTracer methods
jasonpaulos Dec 14, 2022
a932450
Get rid of legacy names
jasonpaulos Dec 14, 2022
b20f6a7
Better use of txntest package
jasonpaulos Dec 14, 2022
cfe8496
Let's see if the export linter yells at this
jasonpaulos Dec 15, 2022
0e19762
Rename DebuggerHook to Debugger
jasonpaulos Dec 15, 2022
76ca4cd
Ensure tracer implements don't drift from interface
jasonpaulos Dec 15, 2022
82d3f2c
Add back export comments
jasonpaulos Dec 15, 2022
942901c
Improve EvalTracer method docs
jasonpaulos Dec 15, 2022
84c5dff
Add experimental warning to swagger file
jasonpaulos Dec 15, 2022
446d158
Merge branch 'master' into feature/simulate-endpoint
jasonpaulos Dec 15, 2022
3d57840
Merge branch 'feature/simulate-endpoint' into extend-debugger-interface
jasonpaulos Dec 15, 2022
f588511
Merge branch 'master' into extend-debugger-interface
jasonpaulos Jan 12, 2023
8b4384b
Fix test issue
jasonpaulos Jan 12, 2023
0c43566
Update license headers
jasonpaulos Jan 12, 2023
54b7534
minor updates from CR
jasonpaulos Jan 12, 2023
5927a63
Use assembler instead of hardcoding program bytes
jasonpaulos Jan 12, 2023
0b02d9e
Make tracer a field in BlockEvaluator and generalize txn group hooks
jasonpaulos Jan 17, 2023
10e74cb
Don't add tracer to GroupContext
jasonpaulos Jan 17, 2023
c0489c7
Fix incorrect txn depth logic in debuggerEvalTracerAdaptor
jasonpaulos Jan 17, 2023
b4e0999
Merge branch 'master' into extend-debugger-interface
jasonpaulos Jan 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions cmd/tealdbg/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Protocol](#protocol)
- [Transaction and Transaction Group](#transaction-and-transaction-group)
- [Balance records](#balance-records)
- [Indexer Support](#indexer-support)
- [Execution mode](#execution-mode)
- [Chrome DevTools Frontend Features](#chrome-devtools-frontend-features)
- [Configure the Listener](#configure-the-listener)
Expand Down Expand Up @@ -44,7 +45,7 @@ and balance records (see [Setting Debug Context](#setting-debug-context) for det

Remote debugger might be useful for debugging unit tests for TEAL (currently in Golang only) or for hacking **algod** `eval` and breaking on any TEAL evaluation.
The protocol consist of three REST endpoints and one data structure describing the evaluator state.
See `WebDebuggerHook` and `TestWebDebuggerManual` in [go-algorand sources](https://github.com/algorand/go-algorand/tree/master/data/transactions/logic) for more details.
See `WebDebugger` and `TestWebDebuggerManual` in [go-algorand sources](https://github.com/algorand/go-algorand/tree/master/data/transactions/logic) for more details.

### Frontends

Expand Down Expand Up @@ -206,13 +207,18 @@ Refer to the [Chrome DevTools debugging](https://developers.google.com/web/tools

The evaluator accepts a new `Debugger` parameter described as the interface:
```golang
type DebuggerHook interface {
// Debugger is an interface that supports the first version of AVM debuggers.
// It consists of a set of functions called by eval function during AVM program execution.
//
// Deprecated: This interface does not support non-app call or inner transactions. Use EvalTracer
// instead.
type Debugger interface {
// Register is fired on program creation
Register(state *DebugState) error
Register(state *DebugState)
// Update is fired on every step
Update(state *DebugState) error
Update(state *DebugState)
// Complete is called when the program exits
Complete(state *DebugState) error
Complete(state *DebugState)
}
```
If `Debugger` is set the evaluator calls `Register` on creation, `Update` on every step and `Complete` on exit.
Expand Down Expand Up @@ -251,13 +257,13 @@ The core calls `SessionEnded` on `Complete` call.

If one needs to debug TEAL in as much real environment as possible then do

1. Add `WebDebuggerHook` to `data/transactions/logic/eval.go`:
1. Add `WebDebugger` to `data/transactions/logic/eval.go`:
```golang
cx.program = program

// begin new code
debugURL := os.Getenv("TEAL_DEBUGGER_URL")
cx.Debugger = &WebDebuggerHook{URL: debugURL}
cx.Debugger = &WebDebugger{URL: debugURL}
// end new code

if cx.Debugger != nil {
Expand Down
23 changes: 18 additions & 5 deletions cmd/tealdbg/debugger.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (

"github.com/algorand/go-algorand/data/basics"
"github.com/algorand/go-algorand/data/transactions/logic"
"github.com/algorand/go-algorand/logging"
)

// Notification is sent to the client over their websocket connection
Expand Down Expand Up @@ -528,7 +529,7 @@ func (d *Debugger) SaveProgram(
}

// Register setups new session and notifies frontends if any
func (d *Debugger) Register(state *logic.DebugState) error {
func (d *Debugger) Register(state *logic.DebugState) {
sid := state.ExecID
pcOffset := make(map[int]int, len(state.PCOffset))
for _, pco := range state.PCOffset {
Expand Down Expand Up @@ -556,12 +557,17 @@ func (d *Debugger) Register(state *logic.DebugState) error {

// Wait for acknowledgement
<-s.acknowledged

return nil
}

// Update process state update notifications: pauses or continues as needed
func (d *Debugger) Update(state *logic.DebugState) error {
func (d *Debugger) Update(state *logic.DebugState) {
err := d.update(state)
if err != nil {
logging.Base().Errorf("error in Update hook: %s", err.Error())
}
}

func (d *Debugger) update(state *logic.DebugState) error {
sid := state.ExecID
s, err := d.getSession(sid)
if err != nil {
Expand Down Expand Up @@ -596,7 +602,14 @@ func (d *Debugger) Update(state *logic.DebugState) error {
}

// Complete terminates session and notifies frontends if any
func (d *Debugger) Complete(state *logic.DebugState) error {
func (d *Debugger) Complete(state *logic.DebugState) {
err := d.complete(state)
if err != nil {
logging.Base().Errorf("error in Complete hook: %s", err.Error())
}
}

func (d *Debugger) complete(state *logic.DebugState) error {
sid := state.ExecID
s, err := d.getSession(sid)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/tealdbg/debugger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestDebuggerSimple(t *testing.T) {
debugger.AddAdapter(da)

ep := logic.NewEvalParams(make([]transactions.SignedTxnWithAD, 1), &proto, nil)
ep.Debugger = debugger
ep.Tracer = logic.MakeEvalTracerDebuggerAdaptor(debugger)
ep.SigLedger = logic.NoHeaderLedger{}

source := `int 0
Expand Down
2 changes: 1 addition & 1 deletion cmd/tealdbg/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ func (r *LocalRunner) RunAll() error {
// ep.Debugger = r.debugger
// if ep.Debugger != nil // FALSE
if r.debugger != nil {
ep.Debugger = r.debugger
ep.Tracer = logic.MakeEvalTracerDebuggerAdaptor(r.debugger)
}
}

Expand Down
14 changes: 5 additions & 9 deletions cmd/tealdbg/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/algorand/go-algorand/protocol"
)

// RemoteHookAdapter provides HTTP transport for WebDebuggerHook
// RemoteHookAdapter provides HTTP transport for WebDebugger
type RemoteHookAdapter struct {
debugger *Debugger
}
Expand All @@ -38,7 +38,7 @@ func MakeRemoteHook(debugger *Debugger) *RemoteHookAdapter {
return r
}

// Setup adds HTTP handlers for remote WebDebuggerHook
// Setup adds HTTP handlers for remote WebDebugger
func (rha *RemoteHookAdapter) Setup(router *mux.Router) {
router.HandleFunc("/exec/register", rha.registerHandler).Methods("POST")
router.HandleFunc("/exec/update", rha.updateHandler).Methods("POST")
Expand All @@ -59,11 +59,7 @@ func (rha *RemoteHookAdapter) registerHandler(w http.ResponseWriter, r *http.Req
}

// Register, and wait for user to acknowledge registration
err = rha.debugger.Register(&state)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return
}
rha.debugger.Register(&state)

// Proceed!
w.WriteHeader(http.StatusOK)
Expand All @@ -78,7 +74,7 @@ func (rha *RemoteHookAdapter) updateHandler(w http.ResponseWriter, r *http.Reque
}

// Ask debugger to process and wait to continue
err = rha.debugger.Update(&state)
err = rha.debugger.update(&state)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return
Expand All @@ -96,7 +92,7 @@ func (rha *RemoteHookAdapter) completeHandler(w http.ResponseWriter, r *http.Req
}

// Ask debugger to process and wait to continue
err = rha.debugger.Complete(&state)
err = rha.debugger.complete(&state)
if err != nil {
w.WriteHeader(http.StatusBadRequest)
return
Expand Down
4 changes: 4 additions & 0 deletions config/localTemplate.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ type Local struct {
// 0x01 (txFilterRawMsg) - check for raw tx message duplicates
// 0x02 (txFilterCanonical) - check for canonical tx group duplicates
TxIncomingFilteringFlags uint32 `version[26]:"1"`

// EnableExperimentalAPI enables experimental API endpoint. Note that these endpoints have no
// guarantees in terms of functionality or future support.
EnableExperimentalAPI bool `version[26]:"false"`
}

// DNSBootstrapArray returns an array of one or more DNS Bootstrap identifiers
Expand Down
1 change: 1 addition & 0 deletions config/local_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ var defaultLocal = Local{
EnableBlockServiceFallbackToArchiver: true,
EnableCatchupFromArchiveServers: false,
EnableDeveloperAPI: false,
EnableExperimentalAPI: false,
EnableGossipBlockService: true,
EnableIncomingMessageFilter: false,
EnableLedgerService: false,
Expand Down
2 changes: 1 addition & 1 deletion crypto/merklesignature/committablePublicKeys.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type (
keyLifetime uint64
}

// CommittablePublicKey is used to create a binary representation of public keys in the merkle
// CommittablePublicKey is used to create a binary representation of public keys in the merkle
// signature scheme.
CommittablePublicKey struct {
VerifyingKey crypto.FalconVerifier
Expand Down
5 changes: 4 additions & 1 deletion daemon/algod/api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ GOPATH := $(shell go env GOPATH)
GOPATH1 := $(firstword $(subst :, ,$(GOPATH)))

# `make all` or just `make` should be appropriate for dev work
all: server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go server/v2/generated/data/routes.go
all: server/v2/generated/model/types.go server/v2/generated/nonparticipating/public/routes.go server/v2/generated/nonparticipating/private/routes.go server/v2/generated/participating/public/routes.go server/v2/generated/participating/private/routes.go server/v2/generated/data/routes.go server/v2/generated/experimental/routes.go

# `make generate` should be able to replace old `generate.sh` script and be appropriate for build system use
generate: oapi-codegen all
Expand All @@ -23,6 +23,9 @@ server/v2/generated/participating/private/routes.go: algod.oas3.yml
server/v2/generated/data/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/data/data_routes.yml algod.oas3.yml

server/v2/generated/experimental/routes.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/experimental/experimental_routes.yml algod.oas3.yml

server/v2/generated/model/types.go: algod.oas3.yml
$(GOPATH1)/bin/oapi-codegen -config ./server/v2/generated/model/model_types.yml algod.oas3.yml

Expand Down
8 changes: 5 additions & 3 deletions daemon/algod/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ Each API in `algod.oas2.json`, except for some pre-existing `common` APIs, shoul
`algod.token` token, while the `private` APIs use the admin token, found in `algod.admin.token` within the algod data
directory.
2. The type, or group, of API. This is currently `participating`, `nonparticipating`, or `data`, but may expand in the
future to encompass different sets of APIs such as `experimental` APIs. Additional APIs should be added to one of the
existing sets of tags based on its use case--unless you intend to create a new group in which case you will need to
additionally ensure your new APIs are registered.
future to encompass different sets of APIs. Additional APIs should be added to one of the existing sets of tags based
on its use case--unless you intend to create a new group in which case you will need to additionally ensure your new
APIs are registered.

For backwards compatibility, the default set of APIs registered will always be `participating` and `nonparticipating`
APIs.
Expand All @@ -38,6 +38,8 @@ participation keys, the agreement service, etc.
* A special set of APIs which require manipulating the node state in order to provide additional data about the node state
at some predefined granularity. For example, SetSyncRound and GetLedgerStateDelta used together control and expose StateDelta objects
containing per-round ledger differences that get compacted when actually written to the ledger DB.
* `experimental`
* APIs which are still in development and not ready to be generally released.

## What codegen tool is used?

Expand Down
88 changes: 87 additions & 1 deletion daemon/algod/api/algod.oas2.json
Original file line number Diff line number Diff line change
Expand Up @@ -1157,7 +1157,7 @@
"schemes": [
"http"
],
"summary": "Broadcasts a raw transaction to the network.",
"summary": "Broadcasts a raw transaction or transaction group to the network.",
"operationId": "RawTransaction",
"parameters": [
{
Expand Down Expand Up @@ -1205,6 +1205,69 @@
}
}
},
"/v2/transactions/simulate": {
"post": {
"tags": [
"public",
"experimental"
],
"consumes": [
"application/x-binary"
],
"produces": [
"application/msgpack"
],
"schemes": [
"http"
],
"summary": "Simulates a raw transaction or transaction group as it would be evaluated on the network.",
"operationId": "SimulateTransaction",
"parameters": [
{
"description": "The byte encoded transaction to simulate",
"name": "rawtxn",
"in": "body",
"required": true,
"schema": {
"type": "string",
"format": "binary"
}
}
],
"responses": {
"200": {
"$ref": "#/responses/SimulationResponse"
},
"400": {
"description": "Bad Request - Malformed Algorand transaction",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"401": {
"description": "Invalid API Token",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"500": {
"description": "Internal Error",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"503": {
"description": "Service Temporarily Unavailable",
"schema": {
"$ref": "#/definitions/ErrorResponse"
}
},
"default": {
"description": "Unknown Error"
}
}
}
},
"/v2/transactions/params": {
"get": {
"tags": [
Expand Down Expand Up @@ -4128,6 +4191,29 @@
}
}
},
"SimulationResponse": {
"description": "Result of a transaction group simulation.",
"tags": [
"experimental"
],
"schema": {
"type": "object",
"required": [
"failure-message",
"missing-signatures"
],
"properties": {
"failure-message": {
"description": "\\[fm\\] Failure message, if the transaction would have failed during a live broadcast.",
"type": "string"
},
"missing-signatures": {
"description": "\\[ms\\] Whether any transactions would have failed during a live broadcast because they were missing signatures.",
"type": "boolean"
}
}
}
},
"SupplyResponse": {
"description": "Supply represents the current supply of MicroAlgos in the system.",
"schema": {
Expand Down
Loading