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

fix: sync committee accounting #272

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

AlexanderLukin
Copy link
Contributor

There was a bug in the accounting of sync committees. One validator could participate in the same sync committee multiple times under different committee indexes. Previously in the code, there was an implicit assumption that a validator can be presented in a sync committee of the particular block only one time. This led to an incorrect accounting of sync committees and incorrect calculation of validator rewards for participation in sync committees.

For example, in the 5-th Pectra devnet, the validator 8568 proposed a slot 179518 in the epoch 5609. The sync committee for epoch 5609 contains validators with indexes 1298, 2561, 4326, 8113, and 9377 two times. Rewards for participation of these validators in the sync committee for the second time were not taken into account. So, when slot 179518 is proposed, EVM calculated rewards for proposing this slot incorrectly.

Now the bug is fixed. The sync_meta field of the ValidatorDutySummary structure was extended to contain several synced blocks if a validator participate in the same committee multiple times. Also, the calculation of the percentage of sync committee participation and the calculation of rewards for sync committee participation have been updated.

There was a bug in the accounting of sync committees. One validator
could participate in the same sync committee multiple times under
different committee indexes. Previously in the code, there was an
implicit assumption that a validator can be presented in a sync
committee of the particular block only one time. This led to an
incorrect accounting of sync committees and incorrect calculation of
validator rewards for participation in sync committees.

For example, in the 5-th Pectra devnet, the validator 8568
https://dora.pectra-devnet-5.ethpandaops.io/validator/0x9617f22db51844882a8115ee19613cf7a6211107a878aefc61111ad650304f0557aa10f977c38b9b978349c5eaf8ecc2
proposed a slot 179518
https://dora.pectra-devnet-5.ethpandaops.io/slot/179518
in the epoch 5609
https://dora.pectra-devnet-5.ethpandaops.io/epoch/5609
The sync committee for epoch 5609 contains validators with indexes 1298,
2561, 4326, 8113, and 9377 two times. Rewards for participation of these
validators in the sync committee for the second time were not taken into
account. So, when slot 179518 is proposed, EVM calculated rewards for
proposing this slot incorrectly.

Now the bug is fixed. The `sync_meta` field of the
`ValidatorDutySummary` structure was extended to contain several synced
blocks if a validator participate in the same committee multiple times.
Also, the calculation of the percentage of sync committee participation
and the calculation of rewards for sync committee participation have
been updated.
The `summaryValidator` object in the `check` method of `SyncService`
might be null. In this case, addressing the `is_sync` property of this
variable caused an error. Now this bug is fixed.
Add intermediate variables to the `sync_percent` calculation formula.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants