Why does it matter that complexity is bounded?
What does bounding complexity have to do with payment?
How is complexity represented? - Phlo Introduction
Suppose Alice wants to deploy P
to the blockchain, where S
is the existing blockchain state and P
is a Rholang program. Alice calls the deployment function Deploy ( P, ... ) = S | ( P, ph )
which associates an initial phlogiston balance with P
. Similar to Ethereum’s gas, phlogiston (phlo) is a bound on the complexity of P
. In this approach, the deployer pays for all computational complexity introduced by the evaluation of P
.
How is phlo modified during evaluation?The initial phlo balance is replicated point-wise over the structure of the top level | term:
( P0 | P1, phi )
----------------------------
( P0, phi ) | ( P1, phi )
The global phlo balance, phi, is an eventually consistent, shared, global counter that reflects modifications made to the phlo balance of sub-terms. Two processes of the same deployment may reduce concurrently by modifying their local phlo replicas and pushing those modifications to the global counter. The global counter converges to the sum of all modifications made to it’s replicas.