Skip to content

refactor: support dynamic emulation parameters for ecrec#1660

Merged
YaoJGalteland merged 1 commit intomasterfrom
refac/ecrecover-nblimbs
Dec 10, 2025
Merged

refactor: support dynamic emulation parameters for ecrec#1660
YaoJGalteland merged 1 commit intomasterfrom
refac/ecrecover-nblimbs

Conversation

@ivokub
Copy link
Copy Markdown
Collaborator

@ivokub ivokub commented Dec 9, 2025

Description

Adds support for dynamic limb parameters for ECRECOVER precompile for using in Linea with small fields. Does not change limb composition for large fields.

Type of change

  • New feature (non-breaking change which adds functionality)

How has this been tested?

  • TestOverKoalabear

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I did not modify files generated from templates
  • golangci-lint does not output errors locally
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Note

Switch ECRECOVER and its hint to dynamic limb sizing based on the native modulus and add a test over koalabear.

  • ECRecover (std/evmprecompiles/01-ecrecover.go):
    • Use GetEffectiveFieldParams[Secp256k1Fp] to derive nbFpLimbs from the native field.
    • Update hint output sizing and limb slicing to use nbFpLimbs.
  • Hints (std/evmprecompiles/hints.go):
    • Change recoverPublicKeyHint signature to accept nativeMod and compute dynamic params via GetEffectiveFieldParams for both Fr and Fp.
    • Adjust input/output length checks and (re)composition using dynamic limb counts/bits; update zero-flag index to 2*nbFpLimbs.
  • Tests (std/evmprecompiles/01-ecrecover_test.go):
    • Add TestOverKoalabear to solve the circuit over koalabear.Modulus().

Written by Cursor Bugbot for commit 2e539d0. This will update automatically on new commits. Configure here.

@ivokub ivokub requested a review from YaoJGalteland December 9, 2025 13:17
@ivokub ivokub self-assigned this Dec 9, 2025
@ivokub ivokub added type: consolidate strengthen an existing feature dep: linea Issues affecting Linea downstream labels Dec 9, 2025
@YaoJGalteland YaoJGalteland merged commit 60b2a82 into master Dec 10, 2025
13 checks passed
@YaoJGalteland YaoJGalteland deleted the refac/ecrecover-nblimbs branch December 10, 2025 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dep: linea Issues affecting Linea downstream type: consolidate strengthen an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants