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:
If the index is 0, we can traverse from 0 to the jumpdest address in the same manner as the jumpdest analysis was previously doing.
If the index is >32, none of the 32 code bytes before the index are a PUSHXX such that the jumpdest address is within its range, and we can traverse from the index to the jumpdest address as before.
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,
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
toarithmetic_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 fromarithmetic_len: 18374, byte_packing_len: 26159, cpu_len: 102230, keccak_len: 12768, keccak_sponge_len: 532, logic_len: 3705, memory_len: 463219
toarithmetic_len: 13174, byte_packing_len: 20058, cpu_len: 75716, keccak_len: 12840, keccak_sponge_len: 535, logic_len: 4402, memory_len: 388999
,