-
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: Modify simulate endpoint request type #5292
algod: Modify simulate endpoint request type #5292
Conversation
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 am generally good on this, maybe a few details we want to be clear for following steps:
- unlimited-log should go under
simulate/extended
- minor questions on erroring early in
SimulateTxnExtended
handler
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.
generally lookin good, and testing looks nice!
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.
There are a few things to be fixed in clerk.go
, but others should be fine.
Summary
Currently the
/v2/transactions/simulate
endpoint has the same request format as/v2/transactions
, the transaction submission endpoint. This format is a concatenated byte array of all of the encoded transactions in an atomic group. Unfortunately this format has the following shortcomings for simulate:To solve these problems, this PR creates a new
SimulationRequest
object that serves as the/v2/transactions/simulate
endpoint's request type. This object can be encoded using either JSON or msgpack. At the moment this object does not offer any additional features, but the goal is to introduce new fields in the future for this purpose.NOTE: this new request object is a backwards-incompatible change. Normally we would not advocate for this, but since simulate is such a new feature and this change would vastly improve our ability to add related features, we think this is a tradeoff that makes sense.
If you already have a transaction group formatted for
/v2/transactions
or the old version of/v2/transactions/simulate
prior to this PR, you can use the new flag--request-only-out
forgoal clerk simulate
to create a properly-formed simulate request:The
--request-only-out
flag indicates that you wantgoal
to help you format a simulate request. It will create the request and write it to the specified file, then exit. No simulation will happen.Test Plan
Modified current tests and added additional tests