ssvlabs / ssv-spec

GNU General Public License v3.0
25 stars 22 forks source link

Fix role mapping in MapDutyToRunnerRole #397

Closed nkryuchkov closed 3 months ago

nkryuchkov commented 3 months ago

The PR fixes the case when dutyRole is BNRoleAttester.

Currently, the result in this case is RoleUnknown because BNRoleAttester | BNRoleSyncCommittee == 0 | 3 == 3, so RoleCommittee is returned only for BNRoleSyncCommittee. This would've worked if roles were powers of two, but they are just iota.

TestMapDutyToRunnerRole shows the change, it passes with the change in MapDutyToRunnerRole and fails without it.

nkryuchkov commented 3 months ago

@GalRogozinski Thanks for the review. Done, please review it again