NKN MainNet v2.1.7 Release

We released a new mainnet version v2.1.7 at https://github.com/nknorg/nkn/releases. This version introduces fast sync and light sync for faster block sync and smaller ledger size.

Experimental release of fast sync and light sync

In this version we are introducing two new sync mode: fast sync and light sync.

  • Fast sync: node will sync the same full block history as before, but much faster by syncing the state trie directly. Think of it as a decentralized replacement of the ChainDB snapshot that many people are using.

  • Light sync: node will only sync headers of old blocks without transactions. The local ledger size will be much smaller than before (ChainDB size is about 4GB at the time of the release), but node will not be able to respond to getblock and gettransaction RPC requests for old blocks/transactions. We recommend using light sync only when node disk space is not enough.

Currently fast sync and light sync mode are still in experimental stage, and not enabled by default.

How to enable fast sync and light sync

Please note that fast sync and light sync can only be enabled when node has NO local ChainDB directory (i.e. a fresh sync). You need to remove the ChainDB directory and let node do a fresh sync if you want to enable them.

There are two ways to enable fast sync and light sync:

  • Add --sync fast argument when starting nknd to enable fast sync, or add --sync light argument when starting nknd to enable light sync.

  • Add "SyncMode": "fast" to config.json to enable fast sync, or add "SyncMode": "light" to config.json to enable light sync.

You should only choose one sync mode, not both.

How to Upgrade

  • If you are using nkn-commercial (including one-click on DO/AWS/Google Cloud) or nknx fast deploy, you don’t need to do anything.
  • If you downloaded the release version, you just need to download it again at https://github.com/nknorg/nkn/releases , replace files and start nknd again
  • If you build from scratch, you just need to do the build again.
  • If you are using some scripts or tutorials that has auto-updater, then it should be automatic if the auto-updater is working properly.

We don’t recommend anyone to download the ChainDB snapshot manually, but if you really want or need, you can use https://nkn.org/ChainDB_pruned_latest.zip or https://nkn.org/ChainDB_pruned_latest.tar.gz for pruned ChainDB.

3 Likes

Amazing news, as always nBullish!

Is there any financial negative incentive for running in fast sync mode?
I can imagine a scenario where the large majority would start running fast sync because its a lot cheaper to run.

Responding to “getblock” and “gettransaction” request probably does not help with your relays per hour so it seems like that should not mess with your mining rewards.

Does that mean light sync will get the same rewards as fully syncing? That seems to disincentivize anyone from doing a full sync.

One more question, is it possible to identify whether a node is a full node or light node from the jsonrpc GetStatus/GetState, or is it only possible to try and invoke GetBlock (less ideal imo).

Does that mean light sync will get the same rewards as fully syncing? That seems to disincentivize anyone from doing a full sync.

Yes. That happened with Ethereum already, almost no one is using full sync now (a.k.a. archive node). It’s typically not an issue as all features of state-based blockchain should only depend on the latest state, but not history transactions.

Currently it’s only possible with GetBlock RPC, but we might add it in the future

1 Like

Noted, thanks for quick replies!

I want to choose light node so all i need to do that adding "SyncMode": "light" to config.json to enable light sync.
Is that right?

Yes, and you also need to remove ChainDB on your node and let it sync from start

@yilun

  1. is this a mandatory upgrade, i.e. nodes stop working after block height X if not upgraded?
  2. Do you have a timeline in mind for experimental -> stable release of fast/light sync?

Thanks!

Before Yilun come in for the final answer, I understood that both features are optional and miners can choose to enable one of them or none at all.

I agree SchentrupSoftwareLLC on this one,

Having full nodes allows the network to be decentralised and provides an higher grade of redundancy.

In the case the majority of the network goes “light” you may find that you have lost your transaction history for good as the history is kept thanks to the running nodes. Not being able to access old transaction is not a small sacrifice for a decentralised ledger.

I hope that this wasn’t done to keep the 5$ Digital Ocean miners happy. With time the requirement to hold a full node should grow. it was clear to me when I started mining that small disks would not be adequate in the long term, as it should be.

Rather than decrease the quality of the network, we should find ways to incentivise the use of the network and the exchange of nano pays. this way the miner would not only get rewarded for the node mining, but also for the services offered through their node.

I hope you guys thought this through, this is (IMHO) a dent in the way the network operates.

  1. is this a mandatory upgrade, i.e. nodes stop working after block height X if not upgraded?

Nope, it’s a recommended upgrade, not mandatory.

  1. Do you have a timeline in mind for experimental -> stable release of fast/light sync?

We don’t have it yet, it should depend on the feedbacks in the experimental stage.

Thanks for your thoughts and feedback!

First I want to clarify one thing. With the light sync mode, node is still full node. For state-based blockchain like Ethereum and NKN, all information needed are stored in states, not history transactions. States are never dropped even with the light sync mode.

Also, block header contains transaction root, which means even transactions are dropped, they can still be verified given a block header.

Actually almost all nodes in Ethereum are using this light sync mode, and it’s considered a standard way to reduce disk usage for state based blockchain.

Another important aspect: because light sync mode has no effect on node operation, even if we don’t officially have this feature, some miners will create a “light” snapshot and use it on their nodes. This way their nodes become light and will have cost advantage over other nodes using official releases. Eventually honest nodes will pay more for being honest. This is definitely not a desired result.

1 Like