lambdaclass / lambdaclass/lambda_ethereum_consensus
Leave and Join subnets on epoch duties calculation
Nobody has claimed this yet.
- Dominant language
- Elixir
- Stars
- 109
- Forks
- 41
- PR merge metrics
- No merged PRs in 30d
Description
During #1274, duties calculations have been simplified and shared across all Validators in the node. During this refactor a previous step has been removed, during duties recalculation (at the end of an epoch) this function was executed in each validator:
defp move_subnets(%{attester: old_duties}, %{attester: new_duties}) do
old_subnets = old_duties |> get_subnet_ids() |> MapSet.new()
new_subnets = new_duties |> get_subnet_ids() |> MapSet.new()
# leave old subnets (except for recurring ones)
MapSet.difference(old_subnets, new_subnets) |> leave()
# join new subnets (except for recurring ones)
MapSet.difference(new_subnets, old_subnets) |> join()
end
This hasn't been added in #1274 but the Validators work (specifically attestation) doesn't appear to be affected. We need to check this is actually the case and make sure it wasn't needed in the first place.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing duties recalculation at the end of an epoch and the Validator attestation path affected by refactor #1274. Compare the current flow with the removed move_subnets step, then verify whether subnet leave and join operations are still required. Done means establishing the impact on attestation duties and documenting or covering the correct behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- elixir
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100