-
Notifications
You must be signed in to change notification settings - Fork 476
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
Algod: Add experimental endpoint for simulating transactions against a real block evaluator #4436
Conversation
Dynamic budget checks in the evaluator complicate the gatekeeping. This functionality will be easier to add in the future after the `DebuggerHook` interface has been extended.
This test confirms an error spotted by @jannotti where `errors.As(…)` was always true. #4322 (comment)
"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" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a placeholder for the actual information that will eventually be returned. It's intentionally minimal for the time being, and unless there's a serious concern, I'd rather leave this as is and focus on enriching this response in later PRs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems mergable to me.
], | ||
"summary": "Simulates a raw transaction as it would be evaluated on the network.", | ||
"operationId": "SimulateTransaction", | ||
"parameters": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we need some sort of "envelope" to contain the transaction(s) and metadata. I find myself wanting this in the protocol itself often as well.
Summary
This PR adds an initial implementation of the simulate endpoint.
This early implementation should be mostly functional, but its results are intentionally narrow for the time being. Following PRs will expand on the work here to add more useful information to the results.
The new endpoint can be used by sending a POST request to
/v2/transactions/simulate
. This endpoint is tagged as experimental, which means it will not be enabled by unless theEnableExperimentalAPI
node config flag is set to true.Test Plan
New tests added.
Follow up PRs