Skip to content
This repository was archived by the owner on Oct 28, 2021. It is now read-only.

Commit 8d7b0dc

Browse files
authored
Merge pull request #5691 from ethereum/txdata-cost-reduction
EIP-2028: Set tx data nonzero byte cost to 16 in Istanbul
2 parents b3d3d33 + 0689989 commit 8d7b0dc

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libethcore/EVMSchedule.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ static const EVMSchedule ConstantinopleFixSchedule = [] {
150150
static const EVMSchedule IstanbulSchedule = [] {
151151
EVMSchedule schedule = ConstantinopleFixSchedule;
152152
schedule.accountVersion = 1;
153+
schedule.txDataNonZeroGas = 16;
153154
return schedule;
154155
}();
155156

test/unittests/libethereum/Transaction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@ BOOST_FIXTURE_TEST_SUITE(libethereum, TestOutputHelperFixture)
3333

3434
BOOST_AUTO_TEST_CASE(TransactionGasRequired)
3535
{
36+
// Transaction data is 0358ac39584bc98a7c979f984b03, 14 bytes
3637
Transaction tr(fromHex("0xf86d800182521c94095e7baea6a6c7c4c2dfeb977efac326af552d870a8e0358ac39584bc98a7c979f984b031ba048b55bfa915ac795c431978d8a6a992b628d557da5ff759b307d495a36649353a0efffd310ac743f371de3b9f7f9cb56c0b28ad43601b4ab949f53faa07bd2c804"), CheckTransaction::None);
37-
BOOST_CHECK_EQUAL(tr.baseGasRequired(FrontierSchedule), 21952);
38+
BOOST_CHECK_EQUAL(tr.baseGasRequired(FrontierSchedule), 14 * 68 + 21000);
39+
BOOST_CHECK_EQUAL(tr.baseGasRequired(IstanbulSchedule), 14 * 16 + 21000);
3840
}
3941

4042
BOOST_AUTO_TEST_CASE(ExecutionResultOutput)

0 commit comments

Comments
 (0)