Skip to content

draft impl for EIP-7805's p2p interface and inclusion list pool. #7290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: focil
Choose a base branch
from

Conversation

h3lio5
Copy link

@h3lio5 h3lio5 commented Jul 12, 2025

This PR proposes the following changes:

  • create a new inclusion list pool
  • impl of p2p interface: gossip validation, subnet
  • signature utils

Copy link

github-actions bot commented Jul 12, 2025

Unit Test Results

       12 files   -        3    2 104 suites   - 526   1h 1m 54s ⏱️ - 16m 49s
  5 796 tests  -    576    5 739 ✔️  -    131    57 💤  - 445  0 ±0 
35 428 runs   - 8 853  35 200 ✔️  - 8 403  228 💤  - 450  0 ±0 

Results for commit 1b7293b. ± Comparison against base commit f996d18.

♻️ This comment has been updated with latest results.

@tersec
Copy link
Contributor

tersec commented Jul 12, 2025

/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(50, 59) Error: undeclared field: 'seconds' for type system.uint64 [type declared in /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nimbus-build-system/vendor/Nim/lib/system/basic_types.nim(12, 3)]
make: *** [Makefile:441: nimbus_beacon_node] Error 1

@tersec
Copy link
Contributor

tersec commented Jul 13, 2025

https://github.com/status-im/nimbus-eth2/actions/runs/16248920772/job/45876335181?pr=7290 (the linux-amd64 target, though it's representative here):

2025-07-13T12:34:24.5405193Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/digest.nim(35, 9) Hint: BLST SHA256 backend enabled [User]
2025-07-13T12:34:24.5412603Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/digest.nim(49, 9) Hint: Hashtree SHA256 backend enabled [User]
2025-07-13T12:34:27.1689107Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(19, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
2025-07-13T12:34:27.1692347Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(19, 18) Warning: imported and not used: 'typetraits' [UnusedImport]
2025-07-13T12:34:27.1696384Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(31, 10) Warning: imported and not used: 'byteutils' [UnusedImport]
2025-07-13T12:34:27.1699691Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(30, 10) Warning: imported and not used: 'bitops2' [UnusedImport]
2025-07-13T12:34:27.1702857Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(29, 9) Warning: imported and not used: 'strutils' [UnusedImport]
2025-07-13T12:34:27.1706179Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(21, 3) Warning: imported and not used: 'chronicles' [UnusedImport]
2025-07-13T12:34:28.1881270Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/signatures.nim(435, 23) template/generic instantiation of `compute_signing_root` from here
2025-07-13T12:34:28.1884476Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/helpers.nim(182, 32) template/generic instantiation of `hash_tree_root` from here
2025-07-13T12:34:28.1887637Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(747, 20) template/generic instantiation of `merkleizeFields` from here
2025-07-13T12:34:28.1890949Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(748, 8) template/generic instantiation of `enumerateSubFields` from here
...
2025-07-13T12:34:38.6626744Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/signatures.nim(435, 23) template/generic instantiation of `compute_signing_root` from here
2025-07-13T12:34:38.6629019Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/helpers.nim(182, 32) template/generic instantiation of `hash_tree_root` from here
2025-07-13T12:34:38.6631426Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(747, 20) template/generic instantiation of `merkleizeFields` from here
2025-07-13T12:34:38.6634151Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(748, 8) template/generic instantiation of `enumerateSubFields` from here
2025-07-13T12:34:38.6636844Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(498, 17) template/generic instantiation of `addChunkDirect` from here
2025-07-13T12:34:38.6639489Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(499, 27) template/generic instantiation of `hash_tree_root` from here
2025-07-13T12:34:38.6643098Z /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(1243, 21) Error: Limited types should not be used with SSZ (ABI differences); usage of 'toSszType' is an {.error.} defined at /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/base.nim(636, 15)
2025-07-13T12:34:38.7125505Z make: *** [Makefile:441: validator_db_aggregator] Error 1

There are two parts here, repeated several times across different build targets:

/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(19, 8) Warning: imported and not used: 'sequtils' [UnusedImport]
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(19, 18) Warning: imported and not used: 'typetraits' [UnusedImport]
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(31, 10) Warning: imported and not used: 'byteutils' [UnusedImport]
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(30, 10) Warning: imported and not used: 'bitops2' [UnusedImport]
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(29, 9) Warning: imported and not used: 'strutils' [UnusedImport]
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/focil.nim(21, 3) Warning: imported and not used: 'chronicles' [UnusedImport]

These should just not be imported, if they're not used. In current unstable (trunk) branch, this has been turned into a compilation error, not only warning.

The other part is:

/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/signatures.nim(435, 23) template/generic instantiation of `compute_signing_root` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/helpers.nim(182, 32) template/generic instantiation of `hash_tree_root` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(747, 20) template/generic instantiation of `merkleizeFields` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(748, 8) template/generic instantiation of `enumerateSubFields` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(498, 17) template/generic instantiation of `addChunkDirect` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(499, 27) template/generic instantiation of `hash_tree_root` from here
/github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/vendor/nim-ssz-serialization/ssz_serialization/merkleization.nim(1243, 21) Error: Limited types should not be used with SSZ (ABI differences); usage of 'toSszType' is an {.error.} defined at /github-runner/github-runner-node-01/workspace/nimbus-eth2/nimbus-eth2/beacon_chain/spec/datatypes/base.nim(636, 15)

which is from the compute_signing_root(message, domain) call in:

# https://github.com/ethereum/consensus-specs/blob/dev/specs/_features/eip7805/validator.md#constructing-a-signed-inclusion-list
func compute_inclusion_list_signing_root*(
    fork: Fork, genesis_validators_root: Eth2Digest,
    message: InclusionList): Eth2Digest =
  let domain = get_domain(
    fork, DOMAIN_INCLUSION_LIST_COMMITTEE, message.slot.epoch(),
    genesis_validators_root)
  compute_signing_root(message, domain) 

where InclusionList is defined as

type
  # https://github.com/ethereum/consensus-specs/blob/v1.6.0-alpha.2/specs/_features/eip7805/beacon-chain.md#inclusionlist
  InclusionList* = object
    slot*: Slot
    validator_index*: ValidatorIndex
    inclusion_list_committee_root: Eth2Digest
    transactions: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]
    inclusion_list_committee_root*: Eth2Digest
    transactions*: List[Transaction, MAX_TRANSACTIONS_PER_PAYLOAD]

it's likely complaining about ValidatorIndex here, and ValidatorIndex for SSZ purposes is a uint64. There's an internal representation of ValidatorIndex which differs, but that can't be used at the SSZ boundary as here. So probably the relevant line has to be

    validator_index*: uint64

with any relevant conversions to/from ValidatorIndex (which is not, in fact, a uint64) handled internally.

@h3lio5
Copy link
Author

h3lio5 commented Jul 14, 2025

Thanks for the quick and detailed help with debugging! And sorry for my delayed response-- I was waiting to fix all the build errors before pushing the code.

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.

2 participants