From a019fe1c1691f687d78c3231026d4f656099e40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 29 Nov 2024 12:23:16 +0200 Subject: [PATCH 1/2] Update description of isTransactionMoreValuableForNetwork. --- txcache/README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/txcache/README.md b/txcache/README.md index ee8996c6..eac29400 100644 --- a/txcache/README.md +++ b/txcache/README.md @@ -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: @@ -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 ``` From d11b5296aea342c8531c839f9a32ee7438a8af49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Fri, 29 Nov 2024 12:44:18 +0200 Subject: [PATCH 2/2] Fix typo. --- txcache/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/txcache/README.md b/txcache/README.md index eac29400..7ece0a0a 100644 --- a/txcache/README.md +++ b/txcache/README.md @@ -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 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. +If two transactions have the same PPU, they are ordered 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: