Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion yarn-project/foundation/src/config/env_var.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export type EnvVar =
| 'P2P_TX_POOL_KEEP_PROVEN_FOR'
| 'P2P_ATTESTATION_POOL_KEEP_FOR'
| 'P2P_ARCHIVED_TX_LIMIT'
| 'P2P_TRUSTED_PEERS'
| 'P2P_PRIVATE_PEERS'
| 'P2P_MAX_TX_POOL_SIZE'
| 'PEER_ID_PRIVATE_KEY'
| 'PROVER_AGENT_COUNT'
Expand Down Expand Up @@ -218,5 +220,4 @@ export type EnvVar =
| 'K8S_POD_UID'
| 'K8S_NAMESPACE_NAME'
| 'CUSTOM_FORWARDER_CONTRACT_ADDRESS'
| 'P2P_TRUSTED_PEERS'
| 'FEE_ASSET_HANDLER_CONTRACT_ADDRESS';
14 changes: 13 additions & 1 deletion yarn-project/p2p/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ export interface P2PConfig extends P2PReqRespConfig, ChainConfig {
*/
trustedPeers: string[];

/**
* A list of private peers.
*/
privatePeers: string[];

/**
* The maximum possible size of the P2P DB in KB. Overwrites the general dataStoreMapSizeKB.
*/
Expand Down Expand Up @@ -347,7 +352,14 @@ export const p2pConfigMappings: ConfigMappingsType<P2PConfig> = {
trustedPeers: {
env: 'P2P_TRUSTED_PEERS',
parseEnv: (val: string) => val.split(','),
description: 'A list of trusted peers ENRs. Separated by commas.',
description: 'A list of trusted peer ENRs that will always be persisted. Separated by commas.',
defaultValue: [],
},
privatePeers: {
env: 'P2P_PRIVATE_PEERS',
parseEnv: (val: string) => val.split(','),
description:
'A list of private peer ENRs that will always be persisted and not be used for discovery. Separated by commas.',
defaultValue: [],
},
p2pStoreMapSizeKb: {
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/p2p/src/services/libp2p/libp2p_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ export class LibP2PService<T extends P2PClientType = P2PClientType.Full> extends
// Start job queue, peer discovery service and libp2p node
this.jobQueue.start();

await this.peerManager.initializeTrustedPeers();
await this.peerManager.initializePeers();
await this.peerDiscoveryService.start();
await this.node.start();

Expand Down
Loading