Skip to content

Commit

Permalink
Use aggregate pubkey root for first node
Browse files Browse the repository at this point in the history
  • Loading branch information
mpetrun5 committed Jan 5, 2024
1 parent 1a74132 commit 486cf7c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions chains/evm/prover/prover.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ func (p *Prover) RotateArgs(epoch uint64) (*RotateArgs, error) {
}
copy(finalizedNextSyncCommitteeBranch[1:], bootstrap.CurrentSyncCommitteeBranch)

finalizedNextSyncCommitteeBranch[0] = p.aggregatePubkeyRoot(update.NextSyncCommittee.AggregatePubKey)
aggregatePubkeyRoot, err := p.aggregatePubkeyRoot(update.NextSyncCommittee.AggregatePubKey)
if err != nil {
return nil, err
}
finalizedNextSyncCommitteeBranch[0] = aggregatePubkeyRoot
finalizedNextSyncCommitteeBranch[1] = update.NextSyncCommitteeBranch[1]
update.NextSyncCommitteeBranch = bootstrap.CurrentSyncCommitteeBranch

Expand Down Expand Up @@ -273,4 +277,5 @@ func (p *Prover) aggregatePubkeyRoot(pubkey [48]byte) ([32]byte, error) {
subIndx := h.Index()
h.PutBytes(pubkey[:])
h.Merkleize(subIndx)
return h.HashRoot()
return h.HashRoot()
}

0 comments on commit 486cf7c

Please sign in to comment.