Testing the Fuse Spark Testnet

Liquify
Liquify
Published in
3 min readSep 10, 2020

With the upcoming launch of token delegation comes a new block reward algorithm. To make sure it performed as expected it was implemented on Fuse Spark Testnet, Fuse’s new test network. To help reduce the work load on Fuse devs (thus freeing up time to get FIP8 out sooner). I happily volunteered to both run a test net node and check that the block rewards were correctly distributed between validators and delegates.

Reward Algorithm

FIP8 brings in a new consensus and reward algorithm in order to enable delegation by removing the old restriction where upper and lower stake limits were equal for validators (this made it virtually impossible to receive delegation easily). As such a new reward scheme needed to be implemented which allows rewards emitted to validators to be scaled based on their stake, unlike the current implementation were each block emits the same reward:

As you can see from the above equations the block rewards are no longer the same for each validator. Block emission is now a ratio of a validators stake to total amount staked to the network.

Testing

To Test the network a python script was written. The script is used to “back test” the block reward emission on passed blocks. The script builds up a table of validators and delegators in each cycle based on historical consensus data taken from the archive node. Using the historical data it then calculates the expected rewards. Once a snap shot of cycle data has been stored the script loops across passed blocks and checks that the block reward emitted matches the expected reward for that validator (or delegator) that cycle.

Results

The script was ran over blocks 100000–238250 the script showed that no major errors are being made in block reward emission. The only points we deviate are at the start of the cycle when new validators become active this is due to a propagation delay in passing the end of cycle data to update the validator list which is no major concern.

Table showing Validators and Delegates inside the test window
Graph showing block reward emission on Fuse Spark Testnet
Estimate Block Validation Reward
Observed Block Validation Reward*

*Node “0xf59CC1129468008a868c84008C80AC70E575104a” and it’s delegate “0x64bb59998da0F9Fb1d9A71Af4033d5D275A3f16B” are not seen in observed numbers since the node is offline. This is actually a good thing since it shows that downed validators do not increase inflation (the active validators continue to earn the same amount at the same rate)

Summary

In this article we discussed Fuse’s new block reward algorithm and a method to test that the emission on the Fuse Spark Testnet is correct. I’m pleased to say that from my testing and analysis of the results the new reward mechanism is performing exactly as expected!

Interested in Fuse check these out

Fuse Medium

Fuse Docs

Fuse.io

Twitter

Telegram

Fuse on Uniswap

Liquify website

Check out more of Liquify’s fuse content at our github

--

--

Liquify
Liquify
Editor for

Liquify provides decentralised blockchain infrastructure solutions, including BaaS, node deployment, and performance monitoring.