<aside> 💡

Read the sharding AIP here:

https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-97.md

</aside>

Instructions

WARNING:

The support of non-sharding mode is stopped. The 1.35 release enforces it.

Staying at 1.34 would temporaily avoid the panic. However we have a planned new feature that will be released in the coming months. (estimated to be 1.37 or 1.38) that 1.34 FN cannot sync. Thus the sharding migration MUST be done ASAP, or the node will break.

Storage sharding is managed through your local node configuration. Since the new storage format is incompatible with the previous one, a full DB wipe is required (by simply delete the DB folder) to proceed.

<aside> 💡

Aptos node version required for sharding upgrade: aptos-node-v1.21.2 or higher

</aside>

Flag to start the format migration:


storage:
	rocksdb_configs:
		enable_storage_sharding: true

  1. Wipe and sync new PFN using the sharding config
    1. Update the node config file to enable sharding.
    2. Wipe the db and start the node again using the sharding config. Make sure it started syncing data, and wait for it to fully sync.
      1. If you are running archival FN (i.e. keep all data since genesis), to speed up the sync, you can choose to start a new node (colocate with your old node) with the sharding enabled, and put your old non-sharding node as it’s upstream peer.
        1. WARNING: Running archival FN is not recommended. With the rapid growth of Aptos ecosystem, you will hit disk space limit in the near future. Please plan accordingly!!!
  2. Internal indexer will be default OFF. The following endpoints will not be supported when internal indexer is off:
  3. If any of the indexer APIs are required, there are 3 options:
    1. Turn on internal indexer

      # Only turn on the APIs you need as they will affect the performance of the node
      indexer_db_config:
          enable_event: true # controls first 2 APIs above
          enable_transaction: true # controls the 3rd API above
          enable_statekeys: true # controls the last 2 APIs above
      
    2. Use Aptos Indexer, check the following links to see if any of them meet your need

      1. https://aptos.dev/en/build/indexer/indexer-api
      2. https://geomi.dev/docs/introduction
      3. Note that the events table is also deprecated on this API.
    3. No code indexing: https://geomi.dev/docs/no-code-indexing

    4. Run your own indexer, here are some common infra you might need

      1. https://aptos.dev/en/build/indexer/indexer-sdk
      2. https://aptos.dev/en/build/indexer/txn-stream

Recommendation:

We recommend you to revisit the usage of the above APIs, and take this time as an opportunity to see if there are other ways to achieve the same purpose, because each of those APIs have their own problems. For example, the 2 event APIs are not supporting v2 events (https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-44.md). The /accounts/{address}/transactions assumes transactions have sequence number which won’t work after we introduce orderless txn (future AIP). The /accounts/{address}/modules and /accounts/{address}/resources can usually be replaced by querying the state you are interested in directly, or call the corresponding view function.

  1. Verify node is on sharding mode
    1. When node is running, go to v1/info endpoint, you should be able to see "new_storage_format":true , you will also be able to see which internal indexers are enabled.