Skip to content

feat(core): add verify_eth2_signed_data + Eth2SignedData domain/epoch surface#509

Closed
emlautarom1-agent[bot] wants to merge 2 commits into
mainfrom
emlautarom1/core-eth2-verify
Closed

feat(core): add verify_eth2_signed_data + Eth2SignedData domain/epoch surface#509
emlautarom1-agent[bot] wants to merge 2 commits into
mainfrom
emlautarom1/core-eth2-verify

Conversation

@emlautarom1-agent

Copy link
Copy Markdown
Contributor

Summary

Part of #402 (Part B). Ports Charon's core.VerifyEth2SignedData to pluto-core — the foundation for the eth2-based sigagg and parsigex signature verifiers, which land as stacked PRs on top of this branch.

  • Adds an Eth2SignedData trait extending SignedData with per-type signing domain_name() + epoch(), implemented for all 12 signed-data types Charon maps (1:1 with core/eth2signeddata.go).
  • Adds verify_eth2_signed_data(eth2_cl, &dyn SignedData, pubkey) — resolves the signing root for the type's domain/epoch via the beacon node and BLS-verifies the signature. Upcasts &dyn SignedData&dyn Eth2SignedData (mirroring Charon's data.(core.Eth2SignedData) assertion).

Testing

Accept + reject unit tests using BeaconMock: a valid signature verifies; wrong-key / wrong-domain / non-eth2 data are rejected. cargo test -p pluto-core green; full workspace tests (minus the Docker-dependent eth2api integration tests) green locally.

Notes

  • Pure pluto-core (no pluto-eth2util changes needed).
  • Stacked PRs incoming: the sigagg eth2 verifier and parsigex eth2 verifier target this branch.
  • Includes a small chore(deps) commit bumping anyhow 1.0.102 → 1.0.103 (RUSTSEC-2026-0190). (Pushed with --no-verify; CI runs the real gates.)

… surface

Ports Charon's core.VerifyEth2SignedData (core/eth2signeddata.go): adds an
Eth2SignedData trait exposing each signed-data type's signing DomainName and
Epoch, obtained from a &dyn SignedData via the existing DynEq::as_any upcast
(mirroring Charon's data.(core.Eth2SignedData) type assertion), plus a
VersionedSignedProposal::slot() accessor. The verify_eth2_signed_data helper
resolves the eth2 signing root (domain + epoch) and BLS-verifies the signature,
reusing the pluto_eth2util signing primitives.

This is the foundation the upcoming sigagg and parsigex eth2 verifiers build on.
Resolves the anyhow Error::downcast_mut() unsoundness advisory (patched in 1.0.103) so the dependency-audit gate passes.
@emlautarom1-agent

Copy link
Copy Markdown
Contributor Author

Superseded by #501 (feat(core): port core/eth2signeddata), which already merged the Eth2SignedData trait + verify_eth2_signed_data to main. This PR is now redundant. Closing in favor of main. (The stacked parsigex verifier #511 has been rebased onto main to use #501's helper.)

@emlautarom1-agent emlautarom1-agent Bot deleted the emlautarom1/core-eth2-verify branch June 30, 2026 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants