Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not get sync aggregate rewards #13910

Open
hwhe opened this issue Apr 23, 2024 · 1 comment
Open

Could not get sync aggregate rewards #13910

hwhe opened this issue Apr 23, 2024 · 1 comment
Assignees
Labels
API Api related tasks Bug Something isn't working

Comments

@hwhe
Copy link

hwhe commented Apr 23, 2024

Describe the bug

in mev scence. my vc call getHeader request to prysm failed. it return "Could not get sync aggregate rewards" and the httpcode is 500.

{
"message": "Could not get sync aggregate rewards: could not verify sync committee signature: invalid sync committee signature",
"code": 500
}

I don't know why that is. Can someone explain this to me?

Has this worked before in a previous version?

ok

🔬 Minimal Reproduction

No response

Error

the prysm logs:

time="2024-04-22 21:05:49" level=info msg="Finished applying state transition" attestations=128 deposits=16 kzgCommitmentCount=6 payloadHash=0x49ac12dc54f2 prefix=blockchain slot=8913927 syncBitsCount=502 txCount=48
time="2024-04-22 21:05:49" level=info msg="Synced new block" block=0x2376c22a... epoch=278560 finalizedEpoch=278558 finalizedRoot=0x3f222d39... prefix=blockchain slot=8913927
time="2024-04-22 21:05:37" level=info msg="Finished applying state transition" attestations=128 deposits=16 kzgCommitmentCount=2 payloadHash=0x2d587397aeaf prefix=blockchain slot=8913926 syncBitsCount=365 txCount=135
time="2024-04-22 21:05:37" level=info msg="Synced new block" block=0xd36f7a10... epoch=278560 finalizedEpoch=278558 finalizedRoot=0x3f222d39... prefix=blockchain slot=8913926
time="2024-04-22 21:05:30" level=info msg="Peer summary" activePeers=9 inbound=3 outbound=6 prefix=p2p
time="2024-04-22 21:05:25" level=info msg="Finished applying state transition" attestations=128 deposits=16 kzgCommitmentCount=6 payloadHash=0xda8d0654c2c3 prefix=blockchain slot=8913925 syncBitsCount=507 txCount=276
time="2024-04-22 21:05:25" level=info msg="Synced new block" block=0xe6e26595... epoch=278560 finalizedEpoch=278558 finalizedRoot=0x3f222d39... prefix=blockchain slot=8913925
time="2024-04-22 21:05:21" level=info msg="Attempted late block reorg aborted due to attestations at 10 seconds" prefix=blockchain root=0xc1663a7dca530c3d0c5c1cabdade381057dd7d5b00efaa23277e9500b93ac5b8 weight=989499000000000
time="2024-04-22 21:05:13" level=info msg="Finished building block" prefix="rpc/validator" sinceSlotStartTime=2.012987948s slot=8913924 validator=1331977
time="2024-04-22 21:05:12" level=info msg="Finished building block" prefix="rpc/validator" sinceSlotStartTime=1.911513981s slot=8913924 validator=1331977
time="2024-04-22 21:05:12" level=info msg="Received header with bid" blockHash=0x2692bcea8235e96230ca79b53fe24b0a84cb526c4b84cb6494751328a5d3923a builderPubKey=0xb0b07cd0abef743db4260b0ed50619cf6ad4d82064cb4fbec9d3ec530f7c5e6793d9f286c4e082c0244ffb9f2658fe88 gweiValue=20000000 kzgCommitmentCount=6 prefix="rpc/validator" sinceSlotStartTime=1.809671128s slot=8913924 validator=1331977
time="2024-04-22 21:05:12" level=info msg="Received header with bid" blockHash=0x2692bcea8235e96230ca79b53fe24b0a84cb526c4b84cb6494751328a5d3923a builderPubKey=0xb0b07cd0abef743db4260b0ed50619cf6ad4d82064cb4fbec9d3ec530f7c5e6793d9f286c4e082c0244ffb9f2658fe88 gweiValue=20000000 kzgCommitmentCount=6 prefix="rpc/validator" sinceSlotStartTime=1.77134669s slot=8913924 validator=1331977
time="2024-04-22 21:05:11" level=info msg="Begin building block" prefix="rpc/validator" sinceSlotStartTime=715.442665ms slot=8913924
time="2024-04-22 21:05:11" level=info msg="Begin building block" prefix="rpc/validator" sinceSlotStartTime=653.504794ms slot=8913924
time="2024-04-22 21:05:03" level=info msg="Finished applying state transition" attestations=128 deposits=16 kzgCommitmentCount=6 payloadHash=0x5606a17ff159 prefix=blockchain slot=8913923 syncBitsCount=505 txCount=111
time="2024-04-22 21:05:03" level=info msg="Synced new block" block=0xc1663a7d... epoch=278560 finalizedEpoch=278558 finalizedRoot=0x3f222d39... prefix=blockchain slot=8913923
time="2024-04-22 21:05:03" level=info msg="Forkchoice updated with payload attributes for proposal" blockRoot=0xa2de56b57a11 headSlot=8913922 payloadID=0x03d012c3a21e prefix=blockchain

Platform(s)

Linux (x86)

What version of Prysm are you running? (Which release)

v5.0.2

Anything else relevant (validator index / public key)?

No response

@hwhe hwhe added the Bug Something isn't working label Apr 23, 2024
@hwhe
Copy link
Author

hwhe commented Apr 24, 2024

The public key of the sync committee is obtained from the local beaconState.

type BeaconState struct {
   ....
   currentSyncCommittee                *ethpb.SyncCommittee
}

committeeKeys := currentSyncCommittee.Pubkeys

for i := uint64(0); i < sync.SyncCommitteeBits.Len(); i++ {
		vIdx, exists := s.ValidatorIndexByPubkey(bytesutil.ToBytes48(committeeKeys[i]))
		// Impossible scenario.
		if !exists {
			return nil, nil, 0, errors.New("validator public key does not exist in state")
		}

		if sync.SyncCommitteeBits.BitAt(i) {
			pubKey, err := bls.PublicKeyFromBytes(committeeKeys[i])
			if err != nil {
				return nil, nil, 0, err
			}
			votedKeys = append(votedKeys, pubKey)
			if err := helpers.IncreaseBalance(s, vIdx, participantReward); err != nil {
				return nil, nil, 0, err
			}
			earnedProposerReward += proposerReward
		} else {
			if err := helpers.DecreaseBalance(s, vIdx, participantReward); err != nil {
				return nil, nil, 0, err
			}
		}
	}

The signature of the sync committee is maybe obtained from mevRelay.

	sa, err := signed.Block().Body().SyncAggregate()
	if err != nil {
		return nil, errors.Wrap(err, "could not get sync aggregate from block")
	}
	state, _, err = altair.ProcessSyncAggregate(ctx, state, sa)

The result is failed to verify the signature. What's the reason for this?

	if err := VerifySyncCommitteeSig(s, votedKeys, sync.SyncCommitteeSignature); err != nil {
		return nil, 0, errors.Wrap(err, "could not verify sync committee signature")
	}

@james-prysm james-prysm added the API Api related tasks label Apr 29, 2024
@rkapka rkapka self-assigned this May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Api related tasks Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants