What is Blockchain Pruning?

Blockchain Pruning

When we talk about “pruning,” we mean reducing the size of the blockchain to a point where we can create a reliable registry with a specific size. Imagine that the blockchain is a vast tree whose branches and leaves are all related to each other from the newest to the oldest. Financial analysis and planning are required for an efficient pruning process.

Blockchain nodes can only store a certain amount of data locally. Due to the enormous storage capacity needed to maintain the history of large-scale settlement and clearing transactions, local durable storage cannot save the entire blockchain history. Therefore, it is imperative to securely back up and delete outdated important values and free up storage space on the nodes to prevent performance issues brought on by a shortage of storage resources. Pruning describes the process of removing outdated fundamental values from Blockchain nodes.

The incorrect fundamental values are determined by the DAML execution engine running on the Replica nodes. The transaction execution engine flags the outdated critical values as it completes the transaction. However, these ancient fundamental values remain in persistent regional storage for two weeks. The stale actual values go through Pruning after the period has passed. The two-week interval for Pruning can be short or lengthy based on the needs.

In this article, we will discuss:

  • What is Pruning?
  • Pruning is Irreversible
  • Blockchain Pruning Implementation
  • What is a Pruned Node?
  • Why did Pruned Nodes come into being?
  • What are the functions of a Pruned Node?
  • Why is Pruning Necessary to Implement?
  • Blockchain and Pruning

What is Pruning?

Not everyone can operate a complete network node all the time. The node’s operating system must always be online and will need more storage space as the blockchain expands. A pruning node, on the other hand, is a different option that lowers the amount of storage required. If we don’t do the Pruning and running a node for a rapidly expanding network where you must download the entire data set will become more and more challenging.

Instead of storing entire network blocks’ worth of data, pruning nodes lower the number of transactions that need to be stored. The node can still authenticate after trimming and conveying the transactions to the rest of the network. It is a relatively affordable solution for those who want to promote the web but cannot run a full node all the time.

Pruning is Irreversible

It is not a reverse process. The Client nodes can no more access the data after the operation if pruning from the Replica nodes. Replica and Client nodes can backup as a standard procedure before starting Pruning.

The system is non-responsive because Pruning calls for Blockchain nodes to halt executing new write requests. Once the pruning process has begun, it cannot be interrupted until all the blocks have gone through the process. The process ends when the consensus method agrees upon the final parable block. A lot of data needs to go through a process, which takes time. Therefore, the orderly trimming operation is designated to repair windows.

Blockchain Pruning Implementation

The Replica and Client nodes have separate pruning windows. As a result, different windows are Replicas or Client nodes.

Replica Node Pruning

The Replica node pruning is started by an administrator using the reconfiguration tool. It doesn’t begin until N replica nodes out of N have agreed. This agreement is necessary to preserve data integrity throughout the Replica Network, and this agreement is needed. The operator can set the days to prune during the specified pruning window or by the number of blocks. The standard pruning period is two weeks. When the pruning process starts, we save outdated key-value data in the local persistent storage just outside the specified pruning window.

Only under the following conditions can Pruning be done:

  • Data replicate on the Client, Replica, and Full Copy Client nodes.
  • The pruning window does not include the data.
  • Data is outdated.

Pruning should be planned for maintenance windows when the system is likely offline and unable to execute new write requests long enough to remove all the obsolete keys. The operator can then start the pruning process by wedging the system and using appropriate measures, such as pruned keys per second. So, this results in the completion of the pruning process.

Pruning of client nodes

Pruning starts on the Client node to minimize the size of the Index DB. The controller set up a window using a predetermined interval.

Pruning of Union Nodes

The information sources in union nodes can also go through the process of Pruning using union node pruning. Specific data sources are excluded from processing at runtime based on predetermined standards. Performance is improved, and resource usage becomes less as a result.

A pruning setup table or a constant linkage is required to prune data sources. Using a table, you can specify the data slices present in each unique data source using the configuration table approach. When the query executes, this data is compared to the query filter, processing only the necessary data sources. Specify a constant with a defined set of values for each data source, then choose the correct value in your query. So this is known as continuous mapping.

As an illustration, imagine that you are using a calculation view to create a sales forecast for a product over time. Two data sources make up the calculation view: one contains the most recent sales data (for YEAR >= 2018), and the other has the oldest sales data (for YEAR = 2017).

  • In a pruning configuration table, you offer a definition.
  • You design a constant that associates specific values with the various data sources.

What is a Pruned Node?

You should be aware of what a pruned node is. If you have ever considered getting a node but decided against it because you believe it would be a waste of your time and money. The geniuses in the crypto industry have demonstrated to be excellent gardeners, programmers, cryptographers, and mathematicians. An ideal illustration of this is the concept of pruned nodes.

A pruned node, in essence, carries out many of the same tasks as a full node but lacks a full copy of the blockchain. Thus, we use “pruned node” or “pruned node.” Pruned nodes uphold a foundational component of the blockchain, using it to carry out verification procedures as an additional function.

Why did Pruned Nodes come into being?

As they maintain copies of the blockchain and assist with other functions required for the network to run, nodes serve as the cornerstone of a blockchain’s security. However, they do have one drawback: the node’s storage space requirements grow according to the size of the blockchain.

The amount of disc space required to set up and run a node made it incredibly challenging for users to run a node. Imagine, for instance, that the present size of the Bitcoin blockchain system, around 300GB, is only a few tens of megabytes (and continues to grow with each passing minute).

A node hosting all transactions for a decade keeps records of the first to the last transaction done and is updated continuously.

The solution to this problem is a trimmed node. These only hold a portion of the blockchain, and the network’s security enhances by enabling more users to have their nodes. In addition, since the presence of a blockchain is more reliable, the more duplicates there are of it.

What are the functions of a Pruned Node?

So, to address this issue, when we develop pruned nodes. These nodes allow the blockchain to be retrieved to begin the verification process; once that process is complete, a reduced portion of the blockchain is always there. So, this is a method that, without a doubt, does not affect the node’s ability to execute verifications.

You might be questioning now if this circumstance is exclusive to Bitcoin. However, this issue affects all blockchains and other technologies built on DAG and DLT. For instance, it is also possible to deploy pruned nodes in Ethereum, which is particularly beneficial given that its blockchain is expanding far faster than Bitcoin’s, reaching 5000 GB already.

Why is Pruning Necessary to Implement?

We use Pruning to achieve decentralization and lay the technical foundation for its widespread everyday use by regular consumers. While Bitcoin only handles ten transactions per second, a blockchain can handle roughly 4.5k transactions per second. If we don’t do the pruning process, operating a node for a platform rising to numbers of several orders of magnitude higher than Bitcoin would become very challenging. It doesn’t take much technical expertise to build your own pruned node, and the simplest method is to utilize the Bitcoin Core software.

Blockchain and Pruning

Recent years have seen the emergence of distributed ledger technology, such as blockchain systems, as viable foundations for machine-to-machine transactions and other multi-stakeholder applications. Nevertheless, the amount of disc space typically needed to host a copy of a ledger may be too enormous for many types of devices, despite the potential exhibited by initiatives like Bitcoin, Ethereum, and Hyperledger Fabric. In this research, we present a method utilizing arbitrary pruning predicate functions to lower the ledger’s size in blockchain systems. This method lets each network participant choose and remove any previously applied transactions individually. We further demonstrate the ability to construct an unaltered state data structure from the remaining. Furthermore, we store the ledger transaction even when some ledger transactions go through Pruning.

We can test the method using a supply chain use case that uses a modified version of Ethereum Blockchain and particular transactions to lower ledger size by roughly 84.49%.

Previous Post
Newer Post