Skip to content

Commit

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

finalizedNextSyncCommitteeBranch[0] = update.NextSyncCommitteeBranch[0]
finalizedNextSyncCommitteeBranch[0] = p.aggregatePubkeyRoot(update.NextSyncCommittee.AggregatePubKey)
finalizedNextSyncCommitteeBranch[1] = update.NextSyncCommitteeBranch[1]
update.NextSyncCommitteeBranch = bootstrap.CurrentSyncCommitteeBranch

Expand Down Expand Up @@ -267,3 +267,10 @@ func (p *Prover) pubkeysRoot(pubkeys [512][48]byte) ([32]byte, error) {
h.Merkleize(subIndx)
return h.HashRoot()
}

func (p *Prover) aggregatePubkeyRoot(pubkey [48]byte) ([32]byte, error) {
h := ssz.NewHasher()
subIndx := h.Index()
h.PutBytes(pubkey[:])
h.Merkleize(subIndx)
return h.HashRoot()

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: unexpected EOF, expecting } (typecheck)

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / linter-check

expected '}', found 'EOF' (typecheck)

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: unexpected EOF, expecting }) (typecheck)

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: unexpected EOF, expecting }) (typecheck)

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / linter-check

syntax error: unexpected EOF, expecting }) (typecheck)

Check failure on line 276 in chains/evm/prover/prover.go

View workflow job for this annotation

GitHub Actions / test (1.19.x, ubuntu-latest)

syntax error: unexpected EOF, expecting }

0 comments on commit 1a74132

Please sign in to comment.