Skip to content

Add MultiCallSendOnly support to Safe{Wallet} guard#427

Draft
duncancmt wants to merge 1180 commits intodcmt/upgrade-timelock-1.4.0from
dcmt/upgrade-timelock-1.4.0-multicall
Draft

Add MultiCallSendOnly support to Safe{Wallet} guard#427
duncancmt wants to merge 1180 commits intodcmt/upgrade-timelock-1.4.0from
dcmt/upgrade-timelock-1.4.0-multicall

Conversation

@duncancmt
Copy link
Copy Markdown
Collaborator

In response to #253 (comment)

duncancmt and others added 30 commits April 7, 2026 16:08
For functions that converge via Newton-Raphson over a fixed factor-of-2
range, the initial seed determines how many iterations are needed. By
choosing seeds that balance worst-case over/underestimate across the
range, one iteration can be dropped while maintaining sufficient
precision for the floor/ceil correction.

512Math._sqrt: replace 2^127 with √(2^255) ≈ √2·2^127 (geometric mean
of [2^127, 2^128)). Balances ε to ±0.41/0.29, giving >128 bits after 6
Babylonian steps instead of 7. Move floor correction into _sqrt so
sqrtUp never sees z=2^128 (prevents mul overflow).

512Math._cbrt: replace 2^84 with ⌊∛(3·2^251)⌋ (balancing point for
[2^83.67, 2^84.67)). Balances ε to ±0.44/0.28, giving >85 bits after 6
Newton-Raphson steps. Replace conditional 7th iteration + floor with
branchless floor correction.

Cbrt._cbrt: multiply the clz-based seed by 233/256 ≈ ∛(3/4), balancing
each octave triplet. Drop from 7 to 6 Newton-Raphson iterations.

Sqrt._sqrt: the alternating-endpoint seed already equalizes ε₁=0.0607
via the AM-GM identity. Simply drop the 7th Babylonian step and move
the floor correction into _sqrt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…po-sts', 'dcmt/newton-raphson-optimization', 'dcmt/hexens-tstore' and 'dcmt/crosschainreceiver2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit changes have been sent for audit and professionally reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants