diff --git a/yarn-project/foundation/src/config/env_var.ts b/yarn-project/foundation/src/config/env_var.ts index fac55cfc695..3e9f80bcc21 100644 --- a/yarn-project/foundation/src/config/env_var.ts +++ b/yarn-project/foundation/src/config/env_var.ts @@ -88,6 +88,9 @@ export type EnvVar = | 'P2P_GOSSIPSUB_INTERVAL_MS' // The interval of the gossipsub heartbeat to perform maintenance tasks. | 'P2P_GOSSIPSUB_MCACHE_GOSSIP' // How many message cache windows to include when gossiping with other peers. | 'P2P_GOSSIPSUB_MCACHE_LENGTH' // he number of gossipsub interval message cache windows to keep + | 'P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_DECAY' // Determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1. TODO: Delete this env variable + | 'P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_WEIGHT' // The weight of the tx invalid message deliveries for the gossipsub protocol. TODO: delete this env variable + | 'P2P_GOSSIPSUB_TX_TOPIC_WEIGHT' // The weight of the tx topic for the gossipsub protocol. TODOļ¼šdelete this env variable. | 'P2P_MAX_PEERS' // The maximum number of peers to connect to | 'P2P_PEER_CHECK_INTERVAL_MS' // The frequency with which to check for new peers. | 'P2P_PEER_PENALTY_VALUES' // The values for the peer scoring system. Passed as a comma separated list of values in order: low, mid, high tolerance errors.' diff --git a/yarn-project/p2p/src/config.ts b/yarn-project/p2p/src/config.ts index f0d6232e8b8..96dec058b90 100644 --- a/yarn-project/p2p/src/config.ts +++ b/yarn-project/p2p/src/config.ts @@ -275,6 +275,21 @@ export const p2pConfigMappings: ConfigMappingsType = { description: 'How many message cache windows to include when gossiping with other pears.', ...numberConfigHelper(3), }, + gossipsubTxTopicWeight: { + env: 'P2P_GOSSIPSUB_TX_TOPIC_WEIGHT', + description: 'The weight of the tx topic for the gossipsub protocol.', + ...numberConfigHelper(1), + }, + gossipsubTxInvalidMessageDeliveriesWeight: { + env: 'P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_WEIGHT', + description: 'The weight of the tx invalid message deliveries for the gossipsub protocol.', + ...numberConfigHelper(-20), + }, + gossipsubTxInvalidMessageDeliveriesDecay: { + env: 'P2P_GOSSIPSUB_TX_INVALID_MESSAGE_DELIVERIES_DECAY', + description: 'Determines how quickly the penalty for invalid message deliveries decays over time. Between 0 and 1.', + ...numberConfigHelper(0.5), + }, peerPenaltyValues: { env: 'P2P_PEER_PENALTY_VALUES', parseEnv: (val: string) => val.split(',').map(Number),