From 7ed0e97aa456b7bedafa2e1a0130f70e1c661470 Mon Sep 17 00:00:00 2001 From: Jun Kimura Date: Sun, 27 Oct 2024 01:33:17 +0900 Subject: [PATCH] fix to use correct fork version: https://github.com/ethereum/consensus-specs/pull/3284 Signed-off-by: Jun Kimura --- crates/light-client-verifier/src/consensus.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/light-client-verifier/src/consensus.rs b/crates/light-client-verifier/src/consensus.rs index 3eb52f9..be6a4aa 100644 --- a/crates/light-client-verifier/src/consensus.rs +++ b/crates/light-client-verifier/src/consensus.rs @@ -259,10 +259,8 @@ pub fn verify_sync_committee_attestation< .map(|t| t.1.clone().try_into().unwrap()) .collect(); - let fork_version = compute_fork_version( - ctx, - compute_epoch_at_slot(ctx, consensus_update.signature_slot()), - )?; + let fork_version_slot = consensus_update.signature_slot().max(1.into()) - 1; + let fork_version = compute_fork_version(ctx, compute_epoch_at_slot(ctx, fork_version_slot))?; let domain = compute_domain( ctx, DOMAIN_SYNC_COMMITTEE,