0xPolygonZero / plonky2

Apache License 2.0
758 stars 281 forks source link

Refactor jumpdest analysis #1423

Closed 4l0n50 closed 8 months ago

4l0n50 commented 9 months ago

In this PR, the list of jumpdest addresses is non-deterministically computed by executing the user's code and adding all addresses used by jump/jumpi within the relevant context. Subsequently, for each of these addresses, a '1' is written in the corresponding address in Segment::JumpdestBits if we can non-deterministically guess a 'proof' for it. A valid proof for a jumpdest address is an index that satisfies the following conditions:

With erc20 it goes from ~~arithmetic_len: 18374, byte_packing_len: 26159, cpu_len: 102230, keccak_len: 12768, keccak_sponge_len: 532, logic_len: 3705, memory_len: 463214 to arithmetic_len: 15688, byte_packing_len: 23976, cpu_len: 89666, keccak_len: 12912, keccak_sponge_len: 538, logic_len: 3735, memory_len: 421180~~ After the last commit adding "packed verification" of the 32 bytes before the index, we go from arithmetic_len: 18374, byte_packing_len: 26159, cpu_len: 102230, keccak_len: 12768, keccak_sponge_len: 532, logic_len: 3705, memory_len: 463219 to arithmetic_len: 13174, byte_packing_len: 20058, cpu_len: 75716, keccak_len: 12840, keccak_sponge_len: 535, logic_len: 4402, memory_len: 388999,

sonarcloud[bot] commented 8 months ago

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud