64 Commits

Author SHA1 Message Date
wborgeaud
e7edfdd6a3 Minor 2022-08-26 18:30:26 +02:00
wborgeaud
a1941308eb Minor 2022-08-26 11:07:16 +02:00
wborgeaud
05c3c4d907 First pass 2022-08-26 10:12:45 +02:00
Daniel Lubarov
d0be79e822 Feedback 2022-08-25 23:35:38 -07:00
Daniel Lubarov
b829b44dcf Fix test 2022-08-25 22:11:25 -07:00
Daniel Lubarov
aa87f2c3ba Public memory 2022-08-25 20:19:18 -07:00
Daniel Lubarov
ff228c9386 Have witness generation take a partial trie instead of Merkle proofs 2022-08-24 20:43:49 -07:00
wborgeaud
ee979428f4 Start implementing context and segments in interpreter 2022-07-23 15:35:48 +02:00
Daniel Lubarov
b9b3c24cf9 PROVER_INPUT instruction 2022-07-19 06:55:23 -07:00
Daniel Lubarov
ef842b03c8 Address some feedback on #591 2022-07-17 08:23:40 -07:00
Daniel Lubarov
0802d6c021 Continue work on bootstrapping
The kernel is hashed using a Keccak based sponge for now. We could switch to Poseidon later if our kernel grows too large.

Note that we use simple zero-padding (pad0*) instead of the standard pad10* rule. It's simpler, and we don't care that the prover can add extra 0s at the end of the code. The program counter can never reach those bytes, and even if it could, they'd be 0 anyway given the EVM's zero-initialization rule.

In one CPU row, we can do a whole Keccak hash (via the CTL), absorbing 136 bytes. But we can't actually bootstrap that many bytes of kernel code in one row, because we're also limited by memory bandwidth. Currently we can write 4 bytes of the kernel to memory in one row.

So we treat the `keccak_input_limbs` columns as a buffer. We gradually fill up this buffer, 4 bytes (one `u32` word) at a time. Every `136 / 4 = 34` rows, the buffer will be full, so at that point we activate the Keccak CTL to absorb the buffer.
2022-07-14 11:59:01 -07:00
Daniel Lubarov
10c31b7036 feedback 2022-07-12 14:33:10 -07:00
Daniel Lubarov
5d74a19ad6 Add test (won't work for a while, but to illustrate) 2022-07-04 18:10:03 -07:00
Daniel Lubarov
e7b480deaf Begin work on witness generation and kernel bootstrapping 2022-07-01 10:09:57 -07:00