scroll-tech / mpt-circuit

MIT License
68 stars 30 forks source link

[ZK 2-23] add check that final mpt update row is padding #85

Closed z2trillion closed 1 year ago

z2trillion commented 1 year ago

This ensures that every starting row of an mpt update (which is what gets looked up by the rw circuit) has a matching ending row. This ensures that every mpt update is fully checked by the circuit.

Previously, the circuit would verify even if the final mpt update was incomplete. Having a padding row at the end prevents this from happening, because the padding row corresponds to a complete 1-row proof that the account with address 0 doesn't exist in an mpt that is empty.