How do I set minimum gas price on my Kaleido network?

The concept of gas fees is not strictly implemented in the private Ethereum orchestrations that you have available on Kaleido.  It's somewhat achievable, although we have seen all other customers opt for alternate approaches when looking to enforce fees. 
Here's how you can "make it work" on Kaleido:

  • Create a Geth/PoA environment
  • Stand up three validating nodes (not counting the system monitor).  PoA always wants a minimum of three validators and for the total number of validators to be odd (this allows intermitent forks to autoresolve).
  • Vote out the system monitor since the protocol config objects are not able to be applied to this runtime.
  • Add the protocol config (e.g. gasPrice=10) to all validating nodes bc they will share turns assembling blocks and proposing them to the other nodes.  Make sure the nodes are reinitialized after attaching your config.
  • When you submit your transaction invocation make sure that you are specifying a value for the gasPrice parameter.  If you're making use of the REST API Gateway surface, then the appropriate query parameter is kld-gasprice.  If you're using a web3 library, then simply specify gasPrice in the parameters object for your deployment or invocation.

As you've observed, the node will not enforce the gasPrice config by default.  The client side call also needs to make this declaration.  You can try submitting any non-zero value on your calls.. if the supplied value is less than your configuration then you should see a failure.  If the value is greater than or equal to, then the call should succeed and the signing account should lose the calculated amount of ETH and the account on the mining node should be awarded.
The described approach is obviously reliant on the client application acting in good faith.  If you are running the application and proxying access to your end users, then this should still be achievable.  If users are connecting directly to your chain (not the typical architecture), then you'd be reliant on them supplying the appropriate gasPrice inputs.
Please make sure to use the built in Ether Pool to fund the relevant signing accounts.  This is accessible in the "Digital Assets" section of the lefthand navigation panel.

Was this article helpful?
0 out of 0 found this helpful