If I run some operations in testnet and record what fees were incurred, would this be representative of the fees that would occur on mainnet?
Related to this, are fees affected by congestion on the network?
Tezos Stack Exchange is a question and answer site for users, experts, and developers of the Tezos blockchain project. It only takes a minute to sign up.
Sign up to join this communityGiven 2 identical accounts, making identical trades, the gas consumed and the storage consumed would be the same across mainnet and testnet. However there are many reasons why similar transactions will cost more or less depending on the circumstances or state of the network/account, instead of testnet versus mainnet.
e.g.
So it would never be possible to say "the fee paid for a transaction of type X, will always cost Y". As it depends on the state of all the accounts and contracts involved.
Fees can be affected by congestion. All bakers will prioritise operations with a higher fee-to-gas ratio, to get the biggest reward for their effort.
And while there is no set fee for gas in the Tezos eco-system, all bakers come with a default configuration that lists a minimum fee for gas, which in practical terms, means there is a minimum fee.
I wrote a tech doc to explain how to automate fee estimation, with hardcoded constants. Constants can and should be fetched from the network, but I never got to update the doc: https://gitlab.com/camlcase-dev/tezos-rpc-postman/-/blob/master/tutorial-estimate-operation.md