From 486cf7cf6933f37c9113c2b72f737023ba21fc35 Mon Sep 17 00:00:00 2001 From: mpetrun5 Date: Fri, 5 Jan 2024 14:42:23 +0100 Subject: [PATCH] Use aggregate pubkey root for first node --- chains/evm/prover/prover.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/chains/evm/prover/prover.go b/chains/evm/prover/prover.go index 379a0ce..c344b49 100644 --- a/chains/evm/prover/prover.go +++ b/chains/evm/prover/prover.go @@ -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 @@ -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() \ No newline at end of file + return h.HashRoot() +}