Matic Network

Does matic validators consider gasPrice while including transactions in blocks?

When sending signed transactions to matic network, does validators give priority to the gasPrice while including them in the blocks?
If yes what should be the value of gasPrice to ensure fast transactions in matic network?

I could use web3.eth.getGasPrice() function but sometimes it gives 0 when recent blocks are empty and does not include any transactions, so i can’t rely on this function completely.

Right now the gas price is 0, you should use web3.eth.getGasPrice() as it will work reliably in the future as well when we add gas price.

So you mean there is no transaction gas fee right now and i could do transactions without spending any ether or matic token.

Also when you say “when we add gas price”, is it some property value which you’ll set in future and will remain constant OR it would be calculated based on recent transactions and will be a dynamic value?

Also when you’ll add gasPrice, then transaction fee is to be paid in ether or matic tokens?

We have kept 0 gas fees currently on the Matic testnet, but this will change in the future. This means that you can do transactions currently without ether or Matic token, yes.

Transaction fees will most likely be dynamic in value and will be initially charged in Matic tokens. In the future, we plan to add support for charging fees in any supported token (by internally swapping other tokens with Matic tokens).

1 Like

Thanks @anurag for the quick and apt reply.
But i am still not sure if validators gives priority to the gasPrice while including transactions in blocks i.e., transactions with high gasPrice gets confirmed faster than transactions with low gasPrice.

At the moment, just give 0 gasPrice. It is not considered in the tx inclusion.