-
Notifications
You must be signed in to change notification settings - Fork 205
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
enhancement: Initial stateproofs support #629
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.
The structure of the PR looks good. I have neither JS nor StateProof expertise, but I did bring up a couple questions.
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 don't see the endpoint /v2/blocks/{round}/transactions/{txid}/proof
added in the PR
src/client/v2/algod/algod.ts
Outdated
@@ -462,4 +464,36 @@ export default class AlgodClient extends ServiceClient { | |||
getProof(round: number, txID: string) { | |||
return new Proof(this.c, this.intDecoding, round, txID); | |||
} | |||
|
|||
/** | |||
* Returns a light block header proof for a given block. |
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 believe descriptions in the java sdk are correct, https://github.com/algorand/java-algorand-sdk/pull/360/files#diff-5b49d198d3ad575154467c557163c27eeab6cd462df1b09fb6d182b1e2f95193
It was added previously https://github.com/algorand/js-algorand-sdk/blob/develop/src/client/v2/algod/proof.ts#L19 |
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.
All my questions have been addressed but I recommend getting approval from people more familiar with state proofs as well.
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.
Overall looks pretty good.
Need to keep in mind that state proofs introduce a new transaction. Currently, the msgpack decoder would fail if it comes across a state proof transaction. Think we should add basic support for the state proof transaction - load the state proof message and the proof itself into a byte array (similar to what we do on the python sdk)
Added message, type, and proof to the txn. The python leaves out the added block header fields, so I've done the same here. |
looking at the code, it looks like the |
Fix msgp stateproof unit tests
Added. |
* bump version and add to changelog * update README.md for new version * prettier on CHANGELOG * Update README.md Co-authored-by: John Lee <john.lee@algorand.com> * Update README.md Co-authored-by: John Lee <john.lee@algorand.com> * Enhancement: Use sandbox for SDK Testing and remove Indexer v1 steps (#623) * Add files to enable sandbox sdk testing * Add some todo comments and formatting * Update changes to script and env * Delete indexer v1 test steps * More changes to cucumber tests * Change features directory in JS SDK * Remove more indexer integration tests * Update test env * Update test-harness.sh Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com> * Break out cucumber tags into their own files (#625) * Command to generate input for Unused Steps Analysis Script + Remove those steps (#627) * command to generate input for Unused Steps Analysis Script + Remove those steps * remvoe the steps * In response to CR remark. Update Makefile * Update .test-env Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com> Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com> * Bugfix: Pass verbosity to the harness and sandbox (#630) * Ignore algorand-sdk-testing test-harness dir (#634) * Enhancement: Deprecating use of langspec (#632) * enhancement: Initial stateproofs support (#629) * Initial stateproofs support * Some more unused steps (#637) * dummy push * revert change of dummy push, ci runs now Co-authored-by: Barbara Poon <barbara.poon@algorand.com> Co-authored-by: algobarb <78746954+algobarb@users.noreply.github.com> Co-authored-by: John Lee <john.lee@algorand.com> Co-authored-by: algochoi <86622919+algochoi@users.noreply.github.com> Co-authored-by: Zeph Grunschlag <tzaffi@users.noreply.github.com> Co-authored-by: Michael Diamant <michaeldiamant@users.noreply.github.com> Co-authored-by: Eric Warehime <eric.warehime@gmail.com>
Initial support for state proofs APIs in the JS Client.
src/client/v2/algod/models/types.ts
was generated using the algorand/generator package.