I would like to know how I can exactly calculate the amount of gas used in a transaction.
In Remix, I have used the first account and invoke a method in my smart contract with 2 parameters, string with value "p1" and uint with value 101.
The transaction cost is 198996 gas and the execution cost is 176892 gas
I have used the second account and invoke the same method with the same parameter {string with value "p1" and uint with value 101} but the transaction cost was 145032 gas and the execution cost was 122928
My question is: how the total amount of gas consumed can be different?? Although I have used the same load of inputs (the same string length and the same uint value)? How I can calculate how much gas will cost each node in the network if they pass the same parameter and the same method but the cost is different?
If 2 nodes in the network invoke the same method with the same parameter, it supposes both pay the same amount of gas, am I write? If no, how I can analyze how much gas each node will cost to interact with the smart contract.
Thanks