You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pq-precompile: reserve base gas before decoding input #487
Charge the base gas and the message gas before the PQ precompile copies its three bytes arguments out of the input. The work that a call does is then limited by the gas that it pays.
PR #486 addresses the reported behavior on release/0.8, but the default main branch still calls abi_decode_raw_validate before charging base gas (main source).
There’s also a remaining accounting gap in the backport: gas is charged from the message length before detokenize, but detokenize copies all three dynamic byte arguments. vk and sig are length-checked only afterward (release/0.8 implementation). An oversized vk or sig with an empty message can therefore cause large copies without variable gas scaling with those lengths.
The allocation regression uses zero gas, so it exits before detokenize; the property-test generator also bounds vk and sig to small sizes (tests, generated input bounds). Could the borrowed token lengths be checked before detokenizing, with a regression for oversized vk/sig and a short message? The corresponding fix also needs to reach main.
Activity
fix(pq-precompile): reserve base gas before decoding input (#486)
osr21 commentedon Oct 7, 2026
PR #486 addresses the reported behavior on release/0.8, but the default main branch still calls abi_decode_raw_validate before charging base gas (main source).
There’s also a remaining accounting gap in the backport: gas is charged from the message length before detokenize, but detokenize copies all three dynamic byte arguments. vk and sig are length-checked only afterward (release/0.8 implementation). An oversized vk or sig with an empty message can therefore cause large copies without variable gas scaling with those lengths.
The allocation regression uses zero gas, so it exits before detokenize; the property-test generator also bounds vk and sig to small sizes (tests, generated input bounds). Could the borrowed token lengths be checked before detokenizing, with a regression for oversized vk/sig and a short message? The corresponding fix also needs to reach main.