-
Notifications
You must be signed in to change notification settings - Fork 91
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
state proofs: Initial commit for stateproofs model #1002
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1002 +/- ##
===========================================
+ Coverage 60.28% 60.80% +0.51%
===========================================
Files 51 51
Lines 8359 8472 +113
===========================================
+ Hits 5039 5151 +112
Misses 2862 2862
- Partials 458 459 +1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
7e14083
to
aedb5b1
Compare
api/converter_utils.go
Outdated
case protocol.StateProofTx: | ||
partPath := make([]generated.GenericDigest, len(stxn.Txn.StateProof.PartProofs.Path)) | ||
for idx, part := range stxn.Txn.StateProof.PartProofs.Path { | ||
partPath[idx] = generated.GenericDigest(part) |
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 you need to make a copy of part
because the pointer is reused by the for loop.
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.
Here's an example where we do something similar: https://github.com/algorand/indexer/pull/575/files
@@ -3,6 +3,7 @@ package writer | |||
import ( | |||
"context" | |||
"fmt" | |||
"github.com/algorand/go-algorand/protocol" |
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.
nit: fix import grouping
idb/txn_type_enum.go
Outdated
@@ -19,6 +19,7 @@ const ( | |||
TypeEnumAssetTransfer | |||
TypeEnumAssetFreeze | |||
TypeEnumApplication | |||
TypeStateProof |
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.
Let's stick with the TypeEnum
prefix to keep consistent with the others, or update all of them and perhaps drop Type
as well.
misc/e2elive.py
Outdated
@@ -57,7 +57,7 @@ def main(): | |||
from botocore.config import Config | |||
from botocore import UNSIGNED | |||
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED)) | |||
tarname = 'net_done.tar.bz2' | |||
tarname = 'feature-stateproofs.tar.bz2' |
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.
stateproofs is merged! We can change this:
tarname = 'feature-stateproofs.tar.bz2' | |
tarname = 'rel-nightly.tar.bz2' |
dda2c18
to
c409cb9
Compare
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 good
thanks!
There is only one issue which I wasn't sure
}, | ||
} | ||
} | ||
proof := generated.StateProof{ |
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 think we should also copy PositionsToReveal
slice
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.
@Eric-Warehime You can use byteSlicePtr
to create a copy
Co-authored-by: Will Winder <[email protected]>
* Bump version to 2.13.0-rc1 * Bump version to 2.13.0 * Documentation for data directory. (#1125) Co-authored-by: algobarb <[email protected]> * Don't lookup big foreign assets. (#1141) * Revert "Bump version to 2.13.0" This reverts commit 0a8af61. * Bump version to 2.13.0 * Fix import performance test runner. (#1133) * Start on round 1 since round 0 is now computed from the genesis file. * Wait for indexer processor to exit. * Better logging for metric collection errors. * Proper support for data directory. * New test script for future release automation. * Revert "Bump version to 2.13.0" This reverts commit 7915890. * Bump version to 2.13.0 * test fixes: Submodule updates (#1144) * Update go-algorand submodule * Fix test failure due to duplicate txns * Add new ledger interface method * Enhancement: remove import validator utility and obsolete ledger for evaluator (#1146) removing a bunch of code and make the random test pass with the new ledger for evaluator * Docs: Readme update (#1149) * Update README header * Testing: Use tempdir instead of /tmp for e2elive test (#1152) * Format misc/*.py with `black` (#1153) * apply black to e2elive.py as well (#1154) * Enhancement: More information about S3 keys searched for and Dockerfile that uses submodule instead of channel (#1151) * Eric's Dockerfile improvements * Update misc/e2elive.py * Bug-Fix: Implement BlockHdrCached + miscellany (#1162) * Enhancement: add max int64 checks (#1166) * state proofs: Indexer Support for State Proofs (#1002) Adds API support to the Indexer for State Proof Transactions and header fields. Co-authored-by: Will Winder <[email protected]> Co-authored-by: Will Winder <[email protected]> * Bump version to 2.14.0-rc1 * Stop Panics if no config is supplied (#1180) Give a default config if not supplied to stop panics. * Fix spec name collisions. (#1182) * Update go-algorand submodule to v3.9.1-beta (#1185) * Bump version to 2.14.0-rc2 * Disable deadlock detection (#1186) * Add support for new block header: TxnRoot SHA256 (#989) * Accept yaml and yml configuration files. (#1181) * Fix bug in reveals lookup (#1198) * Fix bug in reveals lookup (#1198) * Bump version to 2.14.0-rc3 * add state proof example with high reveal index - from betanet (#1199) * Devops: Bump go-algorand submodule to v3.9.2-beta (#1203) * Bump version to 2.14.0-rc4 * enhancement: Clarify REST query parameters for accounts search (#1201) * update description for /v2/accounts * cicd: add darwin arm64 support to release script (#1169) * Bump version to 2.14.0 * Downgrade mockery to prevent incorrect deprecation warning. (#1211) * Enhancement: update e2e test policy (#1197) *update e2e test policy * Fix release 2.14.0 (#1214) * Accept yaml and yml configuration files. (#1181) * Fix bug in reveals lookup (#1198) * add state proof example with high reveal index - from betanet (#1199) * enhancement: Clarify REST query parameters for accounts search (#1201) * update description for /v2/accounts * cicd: add darwin arm64 support to release script (#1169) * Downgrade mockery to prevent incorrect deprecation warning. (#1211) * Enhancement: update e2e test policy (#1197) *update e2e test policy * Update test expected value: transaction root sha256 Co-authored-by: AlgoStephenAkiki <[email protected]> Co-authored-by: Michael Diamant <[email protected]> Co-authored-by: algoidan <[email protected]> Co-authored-by: shiqizng <[email protected]> Co-authored-by: algolucky <[email protected]> Co-authored-by: Will Winder <[email protected]> Co-authored-by: DevOps Service <[email protected]> Co-authored-by: Will Winder <[email protected]> Co-authored-by: algobarb <[email protected]> Co-authored-by: Barbara Poon <[email protected]> Co-authored-by: Zeph Grunschlag <[email protected]> Co-authored-by: shiqizng <[email protected]> Co-authored-by: AlgoStephenAkiki <[email protected]> Co-authored-by: John Lee <[email protected]> Co-authored-by: Or Aharonee <[email protected]> Co-authored-by: Michael Diamant <[email protected]> Co-authored-by: algoidan <[email protected]> Co-authored-by: algolucky <[email protected]>
Summary
I'm opening this PR to integrate the indexer models w/ the new changes being worked on for state proofs. Much of the implementation code for that is located in a branch in go-algorand at the moment (https://github.com/algorand/go-algorand/tree/feature/stateproofs) so this PR will probably have to remain open until that is merged into go-algorand master.