Can Train Criterion#
- class rizemind.authentication.can_train_criterion.CanTrainCriterion(round_id: int, swarm: SupportsEthAccountStrategy)[source]
Bases:
CriterionFlower criterion to select clients that can train.
This criterion implements a check to authenticate clients using Ethereum signatures. It verifies if a client is authorized to participate in a specific training round.
- round_id
The identifier of the current training round.
- Type:
int
- domain
The EIP-712 domain for signing authentication messages.
- Type:
rizemind.contracts.erc.erc5267.typings.EIP712Domain
- swarm
The protocol that provides the EIP-712 domain and
- Type:
rizemind.authentication.typing.SupportsEthAccountStrategy
- verifies training permissions.
- domain: EIP712Domain
- round_id: int
- select(client: ClientProxy) bool[source]
Selects a client for training based on authentication.
This method reads the client’s properties and recover’s its address to determine whether it can participate in the training.
- Parameters:
client – The client proxy to evaluate for selection.
- Returns:
True if the client is authenticated and authorized to train, False otherwise.
- swarm: SupportsEthAccountStrategy