102 Commits

Author SHA1 Message Date
Robin Salen
f76245e298
Cleanup imports (#1492) 2024-02-01 07:16:28 -05:00
Robin Salen
eff7cc0f58
Fix circuit sizes (#1484) 2024-01-25 05:45:28 +00:00
4l0n50
f9c3ad6646 Update empty_txn_list 2024-01-11 13:44:20 +01:00
Robin Salen
cb19f21994
Add crate-level documentation (#1444)
* Add crate-level documentation

* Revert change

* Skip

* Typo

* Apply comments

* Rephrase paragraph

* Apply comments
2024-01-08 14:08:53 +01:00
Robin Salen
2dacbfe2ff
Address bundling (#1426)
* Start

* Scale TxnFields

* Speed-up

* Misc fixes

* Other fixes

* Fix

* Fix offset

* One more fix

* And one more fix

* Fix

* Fix

* Fix init

* More interpreter fixes

* Final fixes

* Add helper methods

* Clippy

* Apply suggestions

* Comments

* Update documentation

* Regenerate pdf

* minor

* Rename some macros for consistency

* Add utility method for unscaling segments and scaled metadata

* Address comments
2024-01-08 10:46:26 +00:00
Robin Salen
f46cf4ef68
Prevent some lints from being allowed (#1443) 2024-01-02 12:47:09 +00:00
Robin Salen
ae3003a9d7
Add alternative method to prove txs without pre-loaded table circuits (#1438) 2023-12-22 17:23:22 +01:00
Hamy Ratoanina
68b9f0ad1c
Add ERC721 test (#1425)
* Add ERC721 test

* Add IS_READ column to BytePacking CTL

* Apply comment
2023-12-15 19:44:59 -05:00
Robin Salen
a64311cfd4
Add aborting signal (#1429)
* Add aborting signal

* Clippy

* Update to Option following comment
2023-12-15 19:35:27 +01:00
Robin Salen
bfcfcdb498
Add Checkpoint heights (#1418) 2023-12-09 06:26:55 +01:00
Linda Guiga
a90aa40b7a
Implement MPT preinitialization (#1406)
* Implement MPT preinitialization

* Apply comments

* Replace GlobalMetadata reads with stores in the kernel

* Change memory specs

* Remove trie data length as a prover input
2023-12-07 12:08:47 -05:00
Robin Salen
47e24306b7
Remove GenerationOutputs (#1408) 2023-12-05 18:10:36 -05:00
Robin Salen
2d36559dad
Make some functions const (#1407) 2023-12-05 13:41:31 -05:00
Robin Salen
7ac6bf2c66
Implement PublicValues retrieval from public inputs (#1405)
* Implement PublicValues retrieval from public inputs

* Use utility method

* Remove generic argument

* Typo
2023-12-05 11:42:40 -05:00
Robin Salen
5572da30d7
Remove intermediary block bloom filters (#1395)
* Remove intermediary block blooms

* Update specs

* Regenerate pdf

* Apply comment, remove unneeded segment
2023-11-30 13:11:38 -05:00
Hamy Ratoanina
30c944f778
Remove bootstrapping (#1390)
* Start removing bootstrapping

* Change the constraint for kernel code initializing

* Update specs

* Apply comments

* Add new global metadata to circuit methods

* Change zero-initializing constraint

* Apply comment

* Update circuit size range for recursive test
2023-11-30 10:04:08 -05:00
Robin Salen
6dd2e313c4
Add upgradeability to AllRecursiveCircuits and output verifier data (#1387)
* Add upgradeable preprocessed sizes

* Add verifier data
2023-11-28 12:23:20 -05:00
Linda Guiga
3440ba94e6
Remove extra rows in BytePackingStark (#1388)
* Have at most one row per (un)packing operation in BytePackingStark

* Change specs

* Fix comment

* Fix tests and apply comments

* Fix log_opcodes
2023-11-28 10:25:03 -05:00
Robin Salen
2039e18f29
Fix genesis block number in prove_block (#1382)
* Fix genesis block number target

* Add consistency check

* Fix genesis block number

* Revert pruning

* Cleanup

* Update error message with hashes

* Fix and add comment

* Make comment more explicit
2023-11-27 10:24:11 -05:00
Linda Guiga
98b5e5be51
Initialize blockhashes (#1370)
* Initialize blockhashes

* Update comment
2023-11-22 13:30:52 -05:00
Robin Salen
4dc42c513a
Merge public values inside prove_aggreg (#1358) 2023-11-15 14:51:35 -05:00
Robin Salen
01f229a8e1
Add push constraints (#1352)
* Add push constraints

* Fix ranges

* Add stack constraints
2023-11-15 11:15:14 -05:00
Hamy Ratoanina
6d751b13c1
Remove values of last memory channel (#1291)
* Remove values of last memory channel

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>

* Fix merge

* Apply comments

* Fix ASM

* Top stack documentation (#7)

* Add doc file

* Apply comments

* Apply comments

* Fix visibility

* Fix visibility

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-11-13 11:03:50 -05:00
Robin Salen
ec41b754a6
Fix ranges in AllRecursiveCircuits initialization for log_opcode aggregation test (#1345) 2023-11-09 17:21:21 -05:00
Robin Salen
954d1a77c6
Remove logic for multiple txns at once (#1341)
* Have prover take only a single txn at most

* Update comment

* Apply review
2023-11-09 09:34:12 -05:00
wborgeaud
fa93454c5c
Add withdrawals (#1322)
* Withdrawals

* Remove AllRecursiveCircuits in withdrawals test

* Fix ERC20 test
2023-11-07 12:20:54 +01:00
wborgeaud
099994abe4
Add test for ERC20 transfer (#1331)
* Working test

* Minor

* Cleaning
2023-11-06 13:02:33 +01:00
wborgeaud
f71f227d3c
Add test for selfdestruct (#1321)
* Add test for selfdestruct

* Comment
2023-11-02 07:56:21 +01:00
wborgeaud
3ac0c4ae18
Fix genesis state trie root when calling prove_root (#1271)
* Fix genesis state trie root in some tests

* Just do it in tests calling prove_block
2023-10-03 17:47:10 +02:00
Robin Salen
cd36e96cb8
Derive clone for txn RLP structs (#1264)
* Derive Clone for txn rlp structs

* Put txn rlp related structs behind testing module

* Move module to end of file
2023-10-02 09:59:45 -04:00
Alonso González
f49fbc8e9b
Transactions trie support (#1232)
* Implement transactions.

* Fix receipts and transactions

* Add some fixes

* Update tests

* Remove changes added for debugging purposes only

* Clippy

* Remove additional debug changes

* Remove unused

* Apply comments

---------

Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
Co-authored-by: Robin Salen <salenrobin@gmail.com>
2023-09-27 10:00:16 -04:00
Robin Salen
acc659da07
Add type 1 and 2 txn for RLP encoding support (#1255) 2023-09-26 14:56:18 -04:00
Linda Guiga
5694af79f9
Merge remote-tracking branch 'mir-plonky2/main' into constrain-genesis-state 2023-09-26 12:24:48 -04:00
wborgeaud
8c78271f5c
Add random value to block metadata and fix sys_prevrandao (#1207)
* Add random to block metadata and fix `sys_prevrandao`

* Minor

* Observe block_random

* Write block_random

* cargo fmt

* block_random: H256

* Move sys_prevrandao to metadata.asm and delete syscall_stubs.asm

* Set block_random in set_block_metadata_target

* Minor

* Minor
2023-09-25 18:20:22 +02:00
Linda Guiga
9d0101d652
Merge branch 'main' into 'constrain-genesis-state' 2023-09-25 10:19:13 -04:00
Linda Guiga
f944a08b4d
Fix self_balance_gas_cost and basic_smart_contract. (#1227)
* Fix self_balance_gas_cost and basic_smart_contract.

* Fix Clippy
2023-09-13 09:12:56 -04:00
Robin Salen
9508b49090
Move byte packing / unpacking to a distinct table (#1212)
* Duplicate Memory trace into BytePacking one

* Add mload_32bytes instruction

* Use dedicated ops for byte packing trace

* Change witness generation to reduce memory reads for MLOAD_32BYTES

* Remove segments

* Fix stack

* Fix extra product when fixing CTL for byte_packing

* Write output value in trace

* Add constraints for BYTE_PACKING table

* Add recursive constraints for BYTE_PACKING table

* Fix constraints

* Add address in trace and constraints

* Add timestamp and batch inputs into BytePackingOp struct

* Add extra column

* Fix BytePackingStark CTL

* Tiny fix in witness generation

* Fix the Memory CTL

* Add constraints for the new columns

* Remove 1 column

* Remove limb columns

* Fix

* Fix recursive circuit of BytePackingTable

* Fix constraints

* Fix endianness

* Add MSTORE_32BYTES instruction and move decomposition to packing table

* Add missing constraint

* Add range-check for all bytes

* Add extra constraint

* Cleanup

* Remove REMAINING_LEN column

* Add corresponding implementations in interpreter

* Fix recursive version

* Remove debug assertion because of CI

* Remove FILTER column

* Update new test from rebasing

* Reorder STARK modules to match TraceCheckPoint ordering

* Address comments

* Pacify clippy

* Add documentation to the packing module

* Fix doctest
2023-09-13 04:45:37 +10:00
Linda Guiga
4d7d9ffa3c
Constrain genesis block's state trie. 2023-09-11 19:09:12 +01:00
Linda Guiga
42f7038031
Add blockhash sys opcode 2023-09-07 09:43:59 +01:00
Robin Salen
fa9aae1fdc
Remove duplicate code 2023-09-06 15:15:33 -04:00
Linda Guiga
6bd17e29c1
Apply comments 2023-09-06 01:19:31 +01:00
Linda Guiga
b07644368f
Add missing links between public values 2023-08-31 13:40:13 +01:00
Robin Salen
7196714734
Update range from ReceiptTrie PR 2023-08-25 09:58:20 -07:00
Linda Guiga
5b962f3c06
Change receipts_trie in basic_smart_contract and self_balance_gas_cost 2023-08-22 20:00:49 +01:00
Linda Guiga
ad9796cb10
Fix tests and address comments 2023-08-22 20:00:49 +01:00
Robin Salen
c0b4f155f4
Implement receipts and logs
Co-authored-by: Hamy Ratoanina <hamy.ratoanina@toposware.com>
Co-authored-by: Linda Guiga <lindaguiga3@gmail.com>
2023-08-22 20:00:49 +01:00
Robin Salen
68bb49671d
Update tests to have a blockgaslimit fitting u32s 2023-08-18 19:02:06 -04:00
Robin Salen
89e62e554a
Use Keccak config in simple tests 2023-08-15 10:48:40 -04:00
wborgeaud
df07ae093a
Write trie roots to memory before kernel bootstrapping (#1172)
* Write trie roots

* Remove CPU trace length

* Update hash_initial/final_tries

* Fix tests

* Minor

* PR feedback
2023-08-09 10:15:13 +02:00
Robin Salen
9f8c152222
Remove unused attributes 2023-08-02 08:54:20 -04:00