This is an extended question to What is "gas" and transaction fee in Ethereum?.
Who gets paid and how much does the caller pay?
Let's make some assumptions:
- There is a function
F
which costs1,000 gas
; - There are 2 miners,
M1
andM2
;- Their gas prices are
1 GWei/gas
and2 GWei/gas
respectively;
- Their gas prices are
- There is an external address
A
.
The questions are:
- When a caller
A
invokesF
, how much doesA
need to pay (ignoring data transfer fees)? - Is it the total (
3 kGWei
) or is it determined by whoever mines it first (1 kGWei
or2 kGWei
)? - If
M1
mines it first, willM2
just trust the result or will it do it all over again to check the correctness?- Then
M2
should also get paid, right?
- Then
- Will the result be stored in all full nodes, or just the miner nodes, or just the miner nodes that are "willing" to store it (with matching gas price)?
- Then other nodes should get paid too?