跳转到内容

Deprecate VFNs

此内容尚不支持你的语言。

AIP-139 deprecates Validator Full Nodes (VFNs) by allowing validators to accept direct connections from Public Full Nodes (PFNs). This removes the need for operators to run a separate VFN alongside their validator.

This guide provides step-by-step instructions for Mainnet validator operators to shut down their VFNs and configure their validators to accept PFN connections. To achieve this, you will need to perform the following tasks:

  1. Prerequisite: Ensure you are running aptos-node v1.45.x or later.
  2. Configure the validator to accept inbound PFN connections.
  3. Important: Wait for confirmation from Aptos Labs before shutting down your VFN. Announcements will be made across release groups.
  4. Shut down your VFN.

Follow the instructions in each step carefully, and reach out to the Aptos Labs team if you have any questions or need assistance.

Before proceeding, verify that you are running aptos-node v1.45.x or later. Older releases do not support direct validator-to-PFN connections.

You can check your node version by running:

Terminal window
aptos-node --version

If you are on an older release, upgrade before continuing.

Configure your validator to accept inbound PFN connections. This requires your validator to be listening for PFN connections on an open port.

There are three options:

  1. (Recommended) Use the default port (6182) to accept PFN connections.
  2. Use a custom port to accept PFN connections.
  3. (Discouraged) Reject PFN connections.

By default, the validator binary will start listening for PFN connections on port 6182 (without any config changes). If you are happy with this port, no additional steps are required. Simply ensure port 6182 is open in your firewall, and your validator will be able to accept inbound PFN connections.

If you want to use a different port for PFN connections, you can configure the validator to listen on that port instead. To do this, add a full_node_networks section to your validator config with the desired port:

validator.yaml
full_node_networks:
- network_id: "public"
discovery_method: "none" # Prevents unnecessary outbound connections to other PFNs.
max_outbound_connections: 0 # Prevents unnecessary outbound connections to other PFNs.
listen_address: "/ip4/0.0.0.0/tcp/<your-port>"
identity:
type: from_file
path: /path/to/validator-identity.yaml # Path to the validator identity file

Replace <your-port> with the port you want to use (e.g., 7777), and ensure the port is open in your firewall. Set the identity field to the validator’s network identity by pointing to the validator-identity.yaml file.

After updating the config and restarting the validator, you must also update the on-chain fullnode_network_addresses to point to your validator’s host and the new port. To do this, update your operator config file (e.g., operator.yaml) with these three fields:

operator.yaml
full_node_network_public_key: "<validator-network-public-key>"
full_node_host:
host: <validator-host>
port: <your-port>

Replace <validator-network-public-key> with the public key from your validator-identity.yaml file, <validator-host> with your validator’s public IP or hostname, and <your-port> with the port configured above. Then run:

Terminal window
aptos node update-validator-network-addresses \
--pool-address <owner-address> \
--operator-config-file ~/path/to/operator.yaml

Replace <owner-address> with your validator pool address. For more details on using update-validator-network-addresses (including how to locate your pool address and operator config), see Connect to the Aptos Network.

After the next epoch begins, confirm that the correct addresses are registered on-chain by running:

Terminal window
aptos node show-validator-config \
--pool-address <owner-address> \
--profile <your-profile>

The output includes fullnode_network_addresses, which should reflect your validator’s host and the custom port you configured. For example:

{
"fullnode_network_addresses,": "/ip4/<validator-host>/tcp/<your-port>/noise-ik/<validator-network-public-key>/handshake/0"
}

If the value has not updated yet, wait for the next epoch and run the command again.

If you do not want the validator to accept any PFN connections, set enable_validator_pfn_connections to false in the base section of your validator node config:

validator.yaml
base:
enable_validator_pfn_connections: false

When this configuration is used, the node will no longer listen for or accept connections from PFNs.

Once you have received confirmation, you can take the VFN offline safely. You do not need to leave the validator set to shut down the VFN. Only the validator needs to remain online.

To stop the VFN, use the appropriate method for your deployment, for example:

  • Source code: Kill the aptos-node process running the VFN.
  • Docker: Run docker compose down --volumes in the VFN directory.
  • Terraform: Run terraform destroy targeting the VFN resources.

With the VFN removed, your validator will be more exposed to the public internet. This increases the attack surface for network-level attacks, such as DDoS. If you don’t already have protections in place, we strongly recommend implementing appropriate safeguards (see the recommendations below).

At minimum, we recommend locking down all ports on the validator host except those required for node operation, e.g.:

  • Consensus port (default 6180): Required for validator to validator traffic.
  • PFN port (default 6182): Required for PFN traffic.

All other ports should be blocked by your firewall, including the REST API port, and metrics port. If you need to expose these ports for monitoring, restrict access to trusted IPs or internal networks only.

Popular tools include ufw and firewalld. Apply the principle of least privilege: deny by default and allow only what is explicitly required.

Running a load balancer, or reverse proxy in front of open validator ports adds a layer of indirection that allows traffic shaping, rate limiting, and health checks without exposing the node directly. HAProxy is a commonly used option; example configs can be found in the aptos-core repository.

DDoS protection can also be quite useful. Some operators already use a combination of network-level protections and DNS-level protections, e.g., Cloudflare Spectrum, AWS Shield, GCP Cloud Armor Network Edge, and upstream provider mitigations, including network-level DDoS scrubbing.

DefenseMinimum recommendation
FirewallBlock all ports except those required (deny by default).
Load balancer & reverse proxyPlace HAProxy (or equivalent) in front of the validator.
DDoS protectionEnable DDOS protection (Cloudflare Spectrum, AWS Shield, or similar).