2923 Commits

Author SHA1 Message Date
BGluth
cb2e69a2c9 Updated eth_trie_utils to 0.2.0 2022-10-11 20:57:46 -06:00
Daniel Lubarov
581fcce0b0
Merge pull request #777 from mir-protocol/mpt_insert_7
Fix branch hashing bug
2022-10-11 16:10:44 -07:00
Daniel Lubarov
299aabf860 Fix branch hashing bug 2022-10-11 15:56:23 -07:00
Daniel Lubarov
0b2661f845
Merge pull request #774 from mir-protocol/debug_offsets
Interpreter feature to configure debug offsets
2022-10-11 08:55:39 -07:00
Daniel Lubarov
f4c0337af7 Interpreter feature to configure debug offsets 2022-10-11 08:47:06 -07:00
Hamish Ivey-Law
68a5428500
Represent input columns as ranges rather than arrays (#776)
* Use std::ops::Range of columns rather than arrays of column indices.

* Refactor reading from the local values table.

* The inevitable post-push fmt/clippy commit.
2022-10-12 02:39:13 +11:00
Hamish Ivey-Law
0d0067554e
Refactor and tidy up mul.rs (#764)
* Refactor and tidy up `mul.rs`.

* Jacqui PR comments.
2022-10-11 18:59:02 +11:00
Daniel Lubarov
a468e4660f
Merge pull request #773 from mir-protocol/mpt_insert_6
MPT logic for inserts into extension nodes
2022-10-10 19:18:46 -07:00
Daniel Lubarov
caf928b11e MPT logic for inserts into extension nodes 2022-10-10 18:33:45 -07:00
Daniel Lubarov
01055a51f8
Merge pull request #772 from mir-protocol/mpt_insert_5
MPT insert into leaf, overlapping keys case
2022-10-10 10:42:37 -07:00
Daniel Lubarov
50002df8e4 MPT insert into leaf, overlapping keys case 2022-10-10 10:42:02 -07:00
Daniel Lubarov
8776cee48b
Merge pull request #771 from mir-protocol/mpt_insert_4
More MPT insert logic
2022-10-10 09:40:37 -07:00
Daniel Lubarov
cad0473e1d More MPT insert logic 2022-10-10 09:40:28 -07:00
Daniel Lubarov
39a7227475
Merge pull request #770 from mir-protocol/mpt_insert_3
Insertion optimization for leaf case
2022-10-09 21:35:07 -07:00
Daniel Lubarov
33dba3a23d Insertion optimization for leaf case 2022-10-09 20:18:16 -07:00
Daniel Lubarov
015034347e
Merge pull request #769 from mir-protocol/mpt_insert_2
MPT insert logic, part 2
2022-10-09 12:16:34 -07:00
Daniel Lubarov
4a055b3a76 MPT insert logic, part 2 2022-10-09 11:32:01 -07:00
Daniel Lubarov
fb7ef3197a
Merge pull request #768 from mir-protocol/mpt_insert_1
MPT insert logic, part 1
2022-10-08 22:35:23 -07:00
Daniel Lubarov
6bb1ad94e8 MPT insert logic, part 1 2022-10-08 22:27:57 -07:00
Daniel Lubarov
49eecfadf2
Merge pull request #767 from mir-protocol/fix_clippy_cast
Clippy fix
2022-10-08 14:14:58 -07:00
Daniel Lubarov
443a070003 Clippy fix 2022-10-08 14:09:18 -07:00
Daniel Lubarov
8ee7265863 Tweak MPT value storage 2022-10-08 13:51:52 -07:00
Daniel Lubarov
817156cd47 Begin MPT insert 2022-10-08 13:23:00 -07:00
Daniel Lubarov
39fc7a2a9e
Merge pull request #766 from mir-protocol/more_inc_dec_macros
Some more uses of %increment, %decrement
2022-10-07 12:17:13 -07:00
Daniel Lubarov
e6b5e3656f Some more uses of %increment, %decrement 2022-10-07 12:03:37 -07:00
wborgeaud
992692b04d
Merge pull request #708 from mir-protocol/per_table_recursion
Per table recursion
2022-10-07 10:03:07 +02:00
wborgeaud
4ff6bbb3de Hardcode verifier data in the circuit 2022-10-07 09:47:03 +02:00
Hamish Ivey-Law
d7bb47318c
Modular operations for the EVM arithmetic unit (#755)
* First draft of 256-bit addition.

* Update comment.

* cargo fmt

* Rename addition evaluation file.

* Port ALU logic from SZ.

* Give a name to some magic numbers.

* `addition.rs` -> `add.rs`; fix carry propagation in add; impl sub.

* Clippy.

* Combine hi and lo parts of the output.

* Implement MUL.

* Suppress Clippy's attempt to make my code even harder to read.

* Next draft of MUL.

* Make all limbs (i.e. input and output) 16-bits.

* Tidying.

* Use iterators instead of building arrays.

* Documentation.

* Clippy is wrong; also cargo fmt.

* Un-refactor equality checking, since it was wrong for sub.

* Daniel comments.

* Daniel comments.

* Rename folder 'alu' -> 'arithmetic'.

* Rename file.

* Finish changing name ALU -> Arithmetic Unit.

* Finish removing dependency on array_zip feature.

* Remove operations that will be handled elsewhere.

* Rename var; tidy up.

* Clean up columns; mark places where range-checks need to be done.

* Import all names in 'columns' to reduce verbiage.

* cargo fmt

* Fix aux_in calculation in mul.

* Remove redundant 'allow's; more precise range-check size.

* Document functions.

* Document MUL instruction verification technique.

* Initial tests for ADD.

* Minor test fixes; add test for SUB.

* Fix bugs in generate functions.

* Fix SUB verification; refactor equality verification.

* cargo fmt

* Add test for MUL and fix some bugs.

* Update doc.

* Quiet incorrect clippy error.

* Initial implementation of ADDMOD and MOD.

* Fixes to addmod.

* Update doc.

* Do 1000 random tests instead of just 1.

* Documentation fix.

* Working version of ADDMOD.

* Working version of MOD.

* Name magic number; do multiple MUL tests.

* Add code and test for special case; add some docs.

* Fix spelling mistake.

* Simplify asserts.

* Tidy comment.

* Remove unused module.

* cargo fmt

* Check that output is reduced.

* Add conversion of canonical `i64` to a `Field64`.

* Handle zero modulus within degree constraint.

* cargo fmt

* Fix some comments.

* Check that the top half of the product is zero!

* Start of refactor.

* Refactoring.

* Remove zero and reduction handling from addmod.

* Refactoring; renaming; bug fixes.

* Reuse intermediate calculations across all modular operations; don't negate quot poly unnecessarily.

* Fix bug where last elt of q*m wasn't checked.

* Refactoring.

* Move circuit poly functions to utils.rs.

* Rename ADDMOD stuff to MODULAR.

* Rename module addmod -> modular.

* Handle zero modulus.

* Verify that output is reduced.

* Implement recursive version of modular circuits.

* clippy

* Tidy up i64 -> Field conversion following Jacqui's comments.

* cargo fmt

* Improved documentation.

* Address Jacqui's comments.

* Save some gates by using builder.arithmetic_extension().
2022-10-07 17:15:50 +11:00
Daniel Lubarov
d2dcfb5816
Merge pull request #763 from mir-protocol/mpt_hash_ext
Hash MPT extension nodes
2022-10-06 21:08:53 -07:00
Daniel Lubarov
f8c104033c Hash MPT extension nodes 2022-10-06 20:50:32 -07:00
Daniel Lubarov
b832c6abaf Update spec 2022-10-06 17:29:58 -07:00
Daniel Lubarov
40b2fec4ee
Merge pull request #762 from mir-protocol/mpt_fixes
MPT fixes
2022-10-06 17:14:43 -07:00
Daniel Lubarov
ed2aac3af3 MPT fixes 2022-10-06 16:28:52 -07:00
Daniel Lubarov
0424fe680d mload_packing 2022-10-06 14:27:36 -07:00
wborgeaud
39fc219324 PR feedback 2022-10-06 16:40:03 +02:00
wborgeaud
0bc3f20479 PR feedback 2022-10-06 16:32:35 +02:00
wborgeaud
d4f2656241
Merge pull request #758 from mir-protocol/conditional_recursive_verifier
Conditional recursive verifier
2022-10-06 09:58:53 +02:00
wborgeaud
2bb63a6f11 PR feedback 2022-10-06 09:43:42 +02:00
Daniel Lubarov
4fe4a006a3
Merge pull request #761 from mir-protocol/mpt_hash_branch
MPT logic to hash branch nodes
2022-10-05 21:04:18 -07:00
Daniel Lubarov
f2cb42bbe8 MPT logic to hash branch nodes 2022-10-05 20:46:49 -07:00
Daniel Lubarov
47a37c5f8a
Merge pull request #760 from mir-protocol/rework_mpt_hashing
Rework MPT hashing to support inlining <32 byte children
2022-10-05 15:42:09 -07:00
Daniel Lubarov
0c9847abf3 Rework MPT hashing to support inlining <32 byte children 2022-10-05 15:23:06 -07:00
Dima V
7ccc673368
Merge pull request #759 from mir-protocol/ripeFIX
Fix RipeMD padlength issue
2022-10-05 12:21:39 -07:00
Dmitry Vagner
7c7084a8d3 clean up and format 2022-10-05 12:11:10 -07:00
Dmitry Vagner
0afb9b0cf4 fmt 2022-10-05 10:10:45 -07:00
Dmitry Vagner
9ebbc033bc fix padlength issue 2022-10-05 09:45:38 -07:00
wborgeaud
ce0a4f4480 Use ArithmeticGate for select 2022-10-05 16:42:55 +02:00
wborgeaud
66c21931ce Minor 2022-10-05 16:34:24 +02:00
wborgeaud
52c82f0c21 Minor 2022-10-05 16:32:38 +02:00
wborgeaud
2982f45afa Add test 2022-10-05 15:38:06 +02:00