Skip to content

Commit

Permalink
Update description of isTransactionMoreValuableForNetwork.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Nov 29, 2024
1 parent a3a849d commit a019fe1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion txcache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ That is, for contract calls, the PPU is not equal to the gas price, but much low

Transaction **A** is considered **more valuable (for the Network)** than transaction **B** if **it has a higher PPU**.

If two transactions have the same PPU, they are ordered using an arbitrary, but deterministic rule: the transaction with the "lower" transaction hash "wins" the comparison.
If two transactions have the same PPU, they are order by gas limit (higher is better, promoting less "execution fragmentation"). In the end, they are ordered using an arbitrary, but deterministic rule: the transaction with the "lower" transaction hash "wins" the comparison.

Pseudo-code:

Expand All @@ -103,6 +103,12 @@ func isTransactionMoreValuableForNetwork(A, B):
return true
if A.ppu < B.ppu:
return false
if A.gasLimit > B.gasLimit:
return true
if A.gasLimit < B.gasLimit:
return false
return A.hash < B.hash
```

Expand Down

0 comments on commit a019fe1

Please sign in to comment.