Skip to content

fix(ethclspecs): compare containers by their fields where the pyspec does - #155

Open
IvanAnishchuk wants to merge 1 commit into
mainfrom
fix/structural-container-eq
Open

IvanAnishchuk wants to merge 1 commit into
mainfrom
fix/structural-container-eq

Conversation

@IvanAnishchuk

Copy link
Copy Markdown
Contributor

Summary

At v1.7.0-beta.4 the pyspec runs on eth-ssz-specs, and its containers compare field by field (pydantic __eq__). remerkleable compared hash tree roots. Three fork-body checks still compared roots. Each now uses the derived BEq of the container. The two forms differ only when two different containers share a root.

The proof stack from #113 up sits on this PR.

What changed

EthCLSpecs

  • Fulu/Operations.lean: isSlashableAttestationData tests d1 != d2 (the pyspec's data_1 != data_2), and processProposerSlashing asserts h1 != h2 (header_1 != header_2). Gloas and Heze inherit both.
  • Gloas/Operations.lean: on the EMPTY edge, processParentExecutionPayload asserts requests == default (requests == ExecutionRequests.empty()). The FULL edge compares hash_tree_root(requests) in the spec too, so it keeps the root.

Docs

  • PROOF_LEDGER.md: four Fulu/Operations.lean spans move by one or two lines.

Test plan

  • lake build (full monorepo, on the pinned toolchain) is green.
  • Per-package test suites pass:
    • lake build LeanSha256Tests
    • lake build SizzLeanTests
    • just ethcl-test
  • If this touches spec types or cache behaviour:
    just ethcl-pyspec is green.
  • If this touches a bench-measured hot path: included
    before/after lake exe ssz_bench TSV (or relevant rows) in
    the PR description.
  • New SSZ shapes / cache cases come with a native_decide or
    property test that exercises them.

Risk / trust footprint

None.

Notes for reviewers

lake build and just ethcl-pyspec ran at the top of the stack. just ethcl-pyspec covered the smoke subset for all three forks and the full Fulu and Gloas operations vectors at minimal, with no failures. just ethcl-test passed on every commit of the stack. The first of them only adds Proofs/Heze/Run.lean.

LICENSE (LGPL version 3)

  • I have read and accepted LICENSE (LGPL version 3), NOTICE and CLA in the root of this project.

…does

At v1.7.0-beta.4 the pyspec runs on eth-ssz-specs. Its containers compare
field by field (pydantic `__eq__`). remerkleable compared hash tree roots.
Three fork-body checks still compared roots:

- `is_slashable_attestation_data`: `data_1 != data_2`
- `process_proposer_slashing`: `header_1 != header_2`
- `process_parent_execution_payload` on the EMPTY edge:
  `requests == ExecutionRequests.empty()`

The two forms differ only when two different containers share a root. Each
check now uses the derived `BEq` of the container. The FULL edge of
`process_parent_execution_payload` compares `hash_tree_root(requests)` in the
spec as well, so it stays.
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.

1 participant