Skip to content

Commit

Permalink
fix(LC nim): Check correct fork version in update validation
Browse files Browse the repository at this point in the history
Fixes a LC bug found by the Nimbus team. Related PRs:
- status-im/nimbus-eth2#4703
- ethereum/consensus-specs#3284
  • Loading branch information
EmilIvanichkovv authored and zah committed Mar 9, 2023
1 parent 3b5a48e commit ba7a15d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion beacon-light-client/nim/light_client.nim
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ proc validate_light_client_update*(
participant_pubkeys[i] = sync_committee.pubkeys[idx]
inc i
let
fork_version = forkVersionAtEpoch(update.signature_slot.epoch)
fork_version_slot = max(update.signature_slot, 1.Slot) - 1
fork_version = forkVersionAtEpoch(fork_version_slot.epoch)
domain = compute_domain(
DOMAIN_SYNC_COMMITTEE, fork_version, genesis_validators_root)
signing_root = compute_signing_root(update.attested_header, domain)
Expand Down

0 comments on commit ba7a15d

Please sign in to comment.