Closed timmoreton closed 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.
Expected Behavior
Related to #540
gatewayFee
to be used a payment to full nodes denominated in the same currency asgasCurrency
state_transition.go
, add this to the amount debited at the beginning of the transaction, and make the transfer of this amount to the address specified both for success and failuregasCurrency
asfeeCurrency
to show this applies to both payments for gas and fee to gateway full node -- this may affect the wallet, contractKit and other tx generators!