From ffd03f8fc15179e8727d0c2cb25caa0e5452c29c Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Wed, 26 Aug 2020 14:15:29 +0200 Subject: [PATCH 1/2] [ETCM-21] EIP-2028: Transaction data gas cost reduction --- src/main/scala/io/iohk/ethereum/vm/EvmConfig.scala | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/scala/io/iohk/ethereum/vm/EvmConfig.scala b/src/main/scala/io/iohk/ethereum/vm/EvmConfig.scala index b1c5b6fb43..ced7ea330f 100644 --- a/src/main/scala/io/iohk/ethereum/vm/EvmConfig.scala +++ b/src/main/scala/io/iohk/ethereum/vm/EvmConfig.scala @@ -267,6 +267,7 @@ object FeeSchedule { class PhoenixFeeSchedule extends AghartaFeeSchedule{ override val G_sload: BigInt = 800 override val G_balance: BigInt = 700 + override val G_txdatanonzero = 16 } } From d2626aec733602a78eab942f629094a1f7f15744 Mon Sep 17 00:00:00 2001 From: Michal Mrozek Date: Thu, 27 Aug 2020 11:54:57 +0200 Subject: [PATCH 2/2] [ETCM-21] Fix test --- src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala b/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala index 74076a2213..63f50fd538 100644 --- a/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala +++ b/src/test/scala/io/iohk/ethereum/ledger/StxLedgerSpec.scala @@ -14,8 +14,8 @@ class StxLedgerSpec extends FlatSpec with Matchers with Logger { "StxLedger" should "correctly estimate minimum gasLimit to run transaction which throws" in new ScenarioSetup { /** - * Transaction requires gasLimit equal to 122397, but actual gas used due to refund is equal 42907. - * Our simulateTransaction properly estimates gas usage to 42907, but requires at least 122397 gas to + * Transaction requires gasLimit equal to 121825, but actual gas used due to refund is equal 42907. + * Our simulateTransaction properly estimates gas usage to 42907, but requires at least 121825 gas to * make that simulation * * After some investigation it seems that semantics required from estimateGas is that it should return @@ -174,7 +174,7 @@ trait ScenarioSetup extends EphemBlockchainTestSetup { val someGenesisBlock: Array[Byte] = Hex.decode("f901fcf901f7a00000000000000000000000000000000000000000000000000000000000000000a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347948888f1f195afa192cfee860698584c030f4c9db1a07dba07d6b448a186e9612e5f737d1c909dce473e53199901a302c00646d523c1a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421b90100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008302000080832fefd8808454c98c8142a056e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421880102030405060708c0c0") - val minGasLimitRequiredForFailingTransaction: BigInt = 122397 + val minGasLimitRequiredForFailingTransaction: BigInt = 121825 val block: Block = someGenesisBlock.toBlock val genesisBlock: Block =