-
Notifications
You must be signed in to change notification settings - Fork 10
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
Hstaykov/add test for weigh justification and finalization #262
Hstaykov/add test for weigh justification and finalization #262
Conversation
8034ac8
to
858f385
Compare
Reuse vendor/consensus-spec-tests for the test files |
Build weigh_justification_and_finalization as a circuit |
Rename *_imp files to *_impl |
Are we sure we want all of this in vendor? |
...lvm-metacraft-circuits/src/tests/compute_shuffled_index_test/compute_shuffled_index_test.cpp
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuits_imp/compute_shuffled_index_imp.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuits_impl/weigh_justification_and_finalization.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuits_impl/weigh_justification_and_finalization.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuits_impl/weigh_justification_and_finalization.h
Outdated
Show resolved
Hide resolved
vendor/zkllvm-metacraft-circuits/src/circuit_utils/circuit_byte_utils.h
Outdated
Show resolved
Hide resolved
void inline verify_finalized_checkpoint(Root beacon_state_root, | ||
CheckpointVariable finalized_checkpoint, | ||
BeaconStateLeafProof proof) { | ||
ssz_verify_proof( | ||
beacon_state_root, hash_tree_root(finalized_checkpoint), proof, BEACON_STATE_FINALIZED_CHECKPOINT_GINDEX); | ||
} |
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.
Inline this code
...lvm-metacraft-circuits/src/tests/compute_shuffled_index_test/compute_shuffled_index_test.cpp
Outdated
Show resolved
Hide resolved
}; | ||
|
||
std::vector<path> result; | ||
path my_path("/consensus-spec-tests"); |
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 won't work outside of a docker image. Try using a relative path.
...lvm-metacraft-circuits/src/tests/compute_shuffled_index_test/compute_shuffled_index_test.cpp
Show resolved
Hide resolved
… for reading mappings from yaml config files
Refactor in order to keep the circuits, tests and test case data in separate folders.
… over the test input files.
… restructuring. Move common utility functions that will be used in all circuits to common place.
…essing of test cases with picosha header only lib. Code foramtting added.
…e_shuffled_index.cpp as circuit. By modifying picosha2.h to use only std::array instead of std::vector we are now able to compile compute_shuffled_index's code as circuit.
…lementation. Added Functionality for: get_current_epoch, assert_epoch_is_not_genesis_epoch, verify_justification_bits, get_previous_epoch, compute_start_slot_at_epoch_in_block_roots, verify_epoch_start_slot_root_in_block_roots, verify_finalized_checkpoint weigh_justification_and_finalization implementation complete + first test passing.
…ructuring. Circuit code extracted from test to circuit_imp dir. std::cout-s cleanup. Code foramtting applied. Cleanup debug code.
…d json parsing. Initial ssz conversion to JSON step added. Initial process of JSON file.
… implementation in imp folder.
Usage of tests from vendor/consensus-spec-tests. Code formatting applied. Removed unnecessary copying of buffer. Add ssz files not part of consensus-spec-tests. Added scripts for code formatting, compilation + tests run and running arbitrary processes in a container with all environment.
63a74e0
to
94bdc53
Compare
Added implementation for compute_shuffled_index and weigh_justification_and_finalization + initial test.