Skip to content

test-driver: align fork-choice Hive step validation - #1055

Merged
ch4r10t33r merged 1 commit into
mainfrom
fix/hive-fork-choice-1784614222
Jul 21, 2026
Merged

test-driver: align fork-choice Hive step validation#1055
ch4r10t33r merged 1 commit into
mainfrom
fix/hive-fork-choice-1784614222

Conversation

@zclawz

@zclawz zclawz commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes the zeam-specific failures from Hive lean-spec-tests-fork-choice run:
https://hive.leanroadmap.org/suite.html?suiteid=1784614222-c06cf50d0d1f10e59de4a259d1c33263.json&suitename=lean-spec-tests-fork-choice&client=zeam_devnet5

The run reported 9 zeam_devnet5 failures:

  • test_block_future_horizon/test_block_at_clock_horizon_edge_imported
  • test_block_future_horizon/test_block_beyond_future_horizon_rejected
  • test_block_future_horizon/test_block_one_past_horizon_rejected
  • test_early_block_arrival/test_block_ahead_of_store_clock_is_imported
  • test_gossip_aggregated_empty_participants/test_gossip_aggregated_attestation_empty_participants_rejected
  • test_gossip_aggregated_registry_and_signature/test_aggregated_attestation_participant_outside_registry_rejected
  • test_gossip_aggregated_registry_and_signature/test_aggregated_attestation_proof_verification_failure_rejected
  • test_gossip_attestation_validation/test_attestation_slot_near_uint64_max_rejected
  • test_tick_acceptance_branches/test_interval_0_acceptance_with_proposal_recomputes_head

Fix

  • Make the HTTP fork-choice test driver honor block-step tickToSlot=false, matching the local spectest runner. This keeps the driver clock stationary for early block arrival fixtures and rejects blocks beyond MAX_FUTURE_SLOT_TOLERANCE.
  • Make tick steps honor hasProposal / has_proposal, so proposal-bound acceptance at slot boundaries can recompute head.
  • Validate aggregated gossip participants before mutating fork-choice: reject empty aggregates, participant bits outside the validator registry, and fixture-declared signature/proof failures.
  • Store accepted aggregated gossip payloads with .gossip attribution instead of .block_payload.
  • Make fork-choice gossip attestation future-slot validation overflow-safe for near-u64.max slots, returning AttestationTooFarInFuture instead of letting request handling become HTTP 400.

Validation

  • zig fmt --check pkgs/cli/src/test_driver.zig pkgs/node/src/forkchoice.zig
  • zig build --fetch --summary none
  • git diff --check

Full build/test not run in this container: PATH has Zig 0.15.2 while the repo requires Zig 0.16.0. I attempted to fetch Zig 0.16.0 side-by-side under /tmp, but the download was too slow for this Telegram turn.

@zclawz

zclawz commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Done: PR #1055 is open for the fork-choice Hive failures.

PR: #1055
Commit: 4876576a8d3db4e820325e5a2b70dd2e009b6540

Validation completed locally:

  • zig fmt --check pkgs/cli/src/test_driver.zig pkgs/node/src/forkchoice.zig
  • zig build --fetch --summary none
  • git diff --check

Full build/test note: this container has Zig 0.15.2 on PATH while zeam now requires Zig 0.16.0. I attempted to fetch Zig 0.16.0 side-by-side under /tmp, but the download was too slow for this Telegram turn, so I did not claim a full compile/test run.

@zclawz

zclawz commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Testing update with Zig 0.16.0 completed.

Toolchain used:

  • /tmp/zig-x86_64-linux-0.16.0/zig version0.16.0

Passed locally:

  • /tmp/zig-x86_64-linux-0.16.0/zig fmt --check pkgs/cli/src/test_driver.zig pkgs/node/src/forkchoice.zig
  • git diff --check
  • /tmp/zig-x86_64-linux-0.16.0/zig build --fetch --summary none

Full test attempted:

  • timeout 3600 /tmp/zig-x86_64-linux-0.16.0/zig build test --summary all

Result:

  • Failed with exit code 1 because this container does not have rustup.
  • Root error from the log:
    • error: failed to spawn and capture stdio from rustup: FileNotFound
    • failed command: rustup run nightly cargo -C rust -Z unstable-options build --profile multisig-release -p zeam-glue --no-default-features --features hashsig,multisig,jemalloc

Useful partial results before the transitive rustup failure:

  • preset loading: 1/1 passed
  • utils tests: 33/33 passed
  • metrics tests: 7/7 passed
  • params package: success
  • xmss shadow-cost package: 6/6 passed

So the prior Zig-version blocker is fixed: PR #1055 was tested with Zig 0.16.0. The remaining local full-suite blocker is missing rustup, which prevents the Rust STF glue build and causes dependent Zig packages to fail transitively.

@ch4r10t33r ch4r10t33r left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Production change is a clean overflow guard: std.math.mul(data.slot, INTERVALS_PER_SLOT) catch -> AttestationTooFarInFuture, so a near-u64.max attestation slot is rejected gracefully instead of panicking/wrapping.

The rest is the Hive fork-choice HTTP test driver (not production code): honor tickToSlot=false (stationary clock + saturating future-horizon reject), honor hasProposal on tick steps, and validate aggregated gossip before mutating fork-choice (empty bits, out-of-registry participants, fixture-declared sig/proof failures), storing accepted payloads with .gossip attribution instead of .block_payload. Logic mirrors production's verifyAggregatedAttestation gates and the local spectest runner; indices computed once and freed. Test-harness only, cannot affect the running node.

CI fully green (build + test both platforms, gen-fixtures, provers, docker) — confirms the new driver code compiles and no spectest regression, which the author could not verify locally.

@ch4r10t33r
ch4r10t33r merged commit 20a7d6f into main Jul 21, 2026
14 checks passed
@ch4r10t33r
ch4r10t33r deleted the fix/hive-fork-choice-1784614222 branch July 21, 2026 11:08
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