From 94aefc265d75128841a3cd756238e33151b6ebf5 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Raynaud Date: Fri, 5 Apr 2024 17:27:21 +0200 Subject: [PATCH] feat: implement signer registration repeater delay in infra --- .../assets/docker/docker-compose-signer-unverified-p2p.yaml | 1 + .../assets/docker/docker-compose-signer-verified-p2p.yaml | 1 + mithril-infra/mithril.signer.tf | 1 + mithril-infra/variables.tf | 6 ++++++ 4 files changed, 9 insertions(+) diff --git a/mithril-infra/assets/docker/docker-compose-signer-unverified-p2p.yaml b/mithril-infra/assets/docker/docker-compose-signer-unverified-p2p.yaml index c3d17877769..3ef7544dbbe 100644 --- a/mithril-infra/assets/docker/docker-compose-signer-unverified-p2p.yaml +++ b/mithril-infra/assets/docker/docker-compose-signer-unverified-p2p.yaml @@ -89,6 +89,7 @@ services: - SERVER_PORT=${SIGNER_RELAY_SERVER_PORT} - AGGREGATOR_ENDPOINT=http://${AGGREGATOR_CREDENTIALS}mithril-aggregator:8080/aggregator - DIAL_TO=/dns4/mithril-aggregator-relay/tcp/${AGGREGATOR_RELAY_LISTEN_PORT} + - SIGNER_REPEATER_DELAY=${SIGNER_RELAY_REGISTRATION_REPEATER_DELAY} ports: - "${SIGNER_RELAY_LISTEN_PORT}:${SIGNER_RELAY_LISTEN_PORT}" - "${SIGNER_RELAY_SERVER_PORT}:${SIGNER_RELAY_SERVER_PORT}" diff --git a/mithril-infra/assets/docker/docker-compose-signer-verified-p2p.yaml b/mithril-infra/assets/docker/docker-compose-signer-verified-p2p.yaml index 822171811c9..a35bf2285e5 100644 --- a/mithril-infra/assets/docker/docker-compose-signer-verified-p2p.yaml +++ b/mithril-infra/assets/docker/docker-compose-signer-verified-p2p.yaml @@ -147,6 +147,7 @@ services: - SERVER_PORT=${SIGNER_RELAY_SERVER_PORT} - AGGREGATOR_ENDPOINT=http://${AGGREGATOR_CREDENTIALS}mithril-aggregator:8080/aggregator - DIAL_TO=/dns4/mithril-aggregator-relay/tcp/${AGGREGATOR_RELAY_LISTEN_PORT} + - SIGNER_REPEATER_DELAY=${SIGNER_RELAY_REGISTRATION_REPEATER_DELAY} ports: - "${SIGNER_RELAY_LISTEN_PORT}:${SIGNER_RELAY_LISTEN_PORT}" - "${SIGNER_RELAY_SERVER_PORT}:${SIGNER_RELAY_SERVER_PORT}" diff --git a/mithril-infra/mithril.signer.tf b/mithril-infra/mithril.signer.tf index 601b8e07039..9088820989d 100644 --- a/mithril-infra/mithril.signer.tf +++ b/mithril-infra/mithril.signer.tf @@ -85,6 +85,7 @@ EOT "export AGGREGATOR_RELAY_LISTEN_PORT='${local.mithril_aggregator_relay_mithril_listen_port}'", "export SIGNER_RELAY_LISTEN_PORT='${local.mithril_signers_relay_listen_port[each.key]}'", "export SIGNER_RELAY_SERVER_PORT='${local.mithril_signers_relay_server_port[each.key]}'", + "export SIGNER_RELAY_REGISTRATION_REPEATER_DELAY='${var.mithril_p2p_signer_registration_repeat_delay}'", "export ENABLE_METRICS_SERVER=true", "export METRICS_SERVER_IP=0.0.0.0", "export METRICS_SERVER_PORT=9090", diff --git a/mithril-infra/variables.tf b/mithril-infra/variables.tf index 8d215e79587..b465154ab42 100644 --- a/mithril-infra/variables.tf +++ b/mithril-infra/variables.tf @@ -178,6 +178,12 @@ variable "mithril_use_p2p_network" { default = false } +variable "mithril_p2p_signer_registration_repeat_delay" { + type = number + description = "The repeat delay in milliseconds for the signer registration when operating in P2P mode (defaults to 1 hour)" + default = 3600 * 1000 +} + locals { mithril_network_type_suffix = var.mithril_use_p2p_network ? "-p2p" : "" }