celo-org / celo-blockchain

Official repository for the golang Celo Blockchain
https://celo.org
GNU Lesser General Public License v3.0
548 stars 195 forks source link

Separate transaction payment to full nodes #541

Closed timmoreton closed 4 years ago

timmoreton commented 4 years ago

Expected Behavior

Related to #540

nategraf commented 4 years ago

More context on this change: Sending gas fees to the full nodes fits into the framework already provided by Ethereum are the one and only transaction fee, and provide the incentives for miners, along with block rewards. Gas fees are also aligned with the contraints of the miners in that producing a block costs a certain amount of effort, and each block may contain a fixed amount of gas meaning that the costs and payments are linked under gas fees.

For non-validating full nodes, their costs are not actually proportional to the gas of each transaction as their tasks are only to stay in sync, serve queries, and forward transactions. Additionally, whereas gas prices are set globally to price in the externalities (e.g. long-term storage costs to all future nodes) of each transaction, forwarding a transaction does not have the same externalities. With this in mind the current system of sending gas fees to "gateway" nodes can be reframed as an unconstrained fee decided between the full-node and its clients. This has the advantage of being more flexible and entirely market driven instead of centrally controlled.

Along those lines this change will replace GasFeeRecipient with GatewayFee and GatewayFeeRecipient which are optional fields that light clients may specify and full-nodes may check before forwarding a transaction. It will be denominated in the same currency as the gas fee and treated similarly to gas fees in how the payment is processed.