"""Module for global Constants."""

# NOTE: Expected latency between SuperNode and SuperLink, 5 minutes
EXPECTED_LATENCY = 300

# Strategies states constants
MODEL_PARAMETERS = "current_server_parameters"
FIRST_MOMENTUM = "current_momentum_vector"
SECOND_MOMENTUM = "current_second_momentum_vector"

# Constant for the frequency dictionary name
FREQ_DICT_NAME = "1_gram.json"
FREQ_DICT_CACHE_NAME = "_freq_dict.json"

# Time-To-Live constants
repo_TTL = 10 * 60 * 60  # 10 hours

BROADCAST = "broadcast"
BROADCAST_INS = "broadcast_ins"
BROADCAST_P = "broadcast_parameters"
BROADCAST_MSG = "Broadcasting parameters"

GATHER_INS = "gather_ins"
GATHER_RES = "gather_res"
GATHER_P = "gather_parameters"
GATHER_MSG = "Gathering parameters"

COMM_STACK = "comm_stack"
MASK = "mask"
BATCH_ID = "batch_id"

METRICS = "metrics"
PARAMETERS = "parameters"
NUM_EXAMPLES = "num_examples"

CLIENT_STATE_ACCUMULATOR = "client_state_accumulator"

CURRENT_SERVER_STATE_FILENAME = "current_server_state.bin"

CURRENT_CODEBASE_NAME = "repo"
OLD_CODEBASE_NAME = "anonymous"

DEFAULT_UNAVAILABLE_ENV_VAR = "None"

SERVER_ROUND = "server_round"
HISTORY = "history"
TIME_OFFSET = "time_offset"
CLIENT_STATES = "client_states"
SERVER_STEPS_CUMULATIVE = "server_steps_cumulative"
KEY_LIGHTWEIGHT_SERVER_STATE = [
    SERVER_ROUND,
    HISTORY,
    TIME_OFFSET,
    CLIENT_STATES,
    SERVER_STEPS_CUMULATIVE,
]
LOCAL_STEPS_CUMULATIVE = "local_steps_cumulative"

EVALUATE_RESULTS = "evaluateres"
CHIAPPE_SODE = "chiappe sode"
ENDPOINT_ID = "endpoint_id"
FOLDER_NAME = "folder_name"
FILE_NAME = "file_name"
QUERY = "query"
TYPE = "type"
CODE = "code"
MESSAGE = "message"
STATUS = "status"
OK = "OK"
LAYER_NAMES = "layer_names"
LAYER_TYPES = "layer_types"
EMPTY = "empty"
UNEXPECTED_EMPTY_CONTENT_MSG = "Unexpected empty content"
SERVER_ROUND = "server_round"
