# PoC v5

The launch and activation of PoC v4 introduced some interesting new paths and brought in much needed performance improvements. We have essentially quadrupled the number of challenges on the network as validation of PoC receipts is now significantly more efficient.

Since the activation of PoC v4 the community has been consistently providing feedback to make PoC challenges more random and fair. The new firmware 2019.12.16.0 attempts to address some of these issues. We also upgraded Erlang rocksdb to an upstream 1.1.0 version and bumped the assumed valid block to 138655.

## Content​

With this update we attempt to solve:

Since each Hotspot maintains a histogram of the witnesses with the corresponding RSSI of witnessed packets, we can use the free space path loss formula to determine whether it's impossible for two hotspots to have witnessed each other at those RSSI values. We will now filter these values out.

Secondly, we check whether the witness being considered for a potential next hop is actually an active Hotspot or not. If the Hotspot has not issued a challenge in the last 300 blocks it is considered inactive.

And finally, we added support for a chain variable for making the initial target selection more random. A breakdown of chain variables is described below.

We believe that witnesses which are too close to a challenged Hotspot should not gain any score, as these witnesses are often located in the same room or building as the Hotspot being challenged and not adding significant value to the network.

We also now ensure that RSSI values look reasonable and have added a check that the impossible RSSI values don't dominate the overall RSSI values.

Since we can't do a snapshot without committing, we do the next best thing and save the context state between old ledger height calls to the same height.

The ledger has two modes "active" and "delayed". We ensure snapshots can only be taken from an "active" ledger.

Furthermore, when restoring a context cache we make sure the ledger is in delayed mode to prevent the context being installed onto the wrong subledger.

Floats are a necessarily evil and may cause a potential latent drift in the ledger view. Therefore we have normalized all the necessary floats introduced with PoC v4 and PoC v5.

We've added three comprehensive test suites to the miner to check for the above PoC v5 changes.

We've also improved how we assess PoC witness quality from blockchain-core so the API can do the same.

This builds on top of core#314 and ensures that verifiably inconsistent witnesses don't get rewarded. We've added filters to check for two potential discrepancies:

1. Check that the witness is sufficiently far from the Hotspot it witnessed. We believe this would discourage installing multiple Hotspots in vicinity and attempting to game the reward system.

This is to ensure that we correctly check the blockchain-core behavior in miner.

## Chain variable proposal​

VarExistingProposedRationale
poc_version45Update poc_version to 5
poc_v4_exclusion_cells108This will change min hop from ~433m to ~300m