Skip to content

Leave and Join subnets on epoch duties calculation #1279

Open
@rodrigo-o

Description

@rodrigo-o

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2This is a nice to have. Improves usability of the app or the libraries, but it's not urgent.attestersync committees

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions