From 06a11ed0be64be6812a41216e86fa5216c69db71 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Tue, 31 Aug 2021 18:03:25 +0200 Subject: [PATCH 1/6] :art: Update default value for maxPriorityFeePerGas to 2.5 Gwei --- packages/web3-core-method/src/index.js | 2 +- packages/web3-eth-accounts/src/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/web3-core-method/src/index.js b/packages/web3-core-method/src/index.js index fddedbd0136..f645744a18c 100644 --- a/packages/web3-core-method/src/index.js +++ b/packages/web3-core-method/src/index.js @@ -863,7 +863,7 @@ function _handleTxPricing(method, tx) { maxFeePerGas = tx.gasPrice; delete tx.gasPrice; } else { - maxPriorityFeePerGas = tx.maxPriorityFeePerGas || '0x3B9ACA00'; // 1 Gwei + maxPriorityFeePerGas = tx.maxPriorityFeePerGas || '0x9502F900'; // 2.5 Gwei maxFeePerGas = tx.maxFeePerGas || utils.toHex( utils.toBN(block.baseFeePerGas) diff --git a/packages/web3-eth-accounts/src/index.js b/packages/web3-eth-accounts/src/index.js index 7fa9e93678a..8f997a5c68b 100644 --- a/packages/web3-eth-accounts/src/index.js +++ b/packages/web3-eth-accounts/src/index.js @@ -390,7 +390,7 @@ function _handleTxPricing(_this, tx) { maxFeePerGas = tx.gasPrice; delete tx.gasPrice; } else { - maxPriorityFeePerGas = tx.maxPriorityFeePerGas || '0x3B9ACA00'; // 1 Gwei + maxPriorityFeePerGas = tx.maxPriorityFeePerGas || '0x9502F900'; // 2.5 Gwei maxFeePerGas = tx.maxFeePerGas || utils.toHex( utils.toBN(block.baseFeePerGas) From c55959728da76f078c1cd77f2b5f1f0d40e79766 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Tue, 31 Aug 2021 20:25:10 +0200 Subject: [PATCH 2/6] :white_check_mark: Update test fixtures to use old value for maxPriorityFeePerGas --- test/eth.accounts.signTransaction.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/eth.accounts.signTransaction.js b/test/eth.accounts.signTransaction.js index 3c9eb2d229b..eb13322c23c 100644 --- a/test/eth.accounts.signTransaction.js +++ b/test/eth.accounts.signTransaction.js @@ -614,6 +614,7 @@ var tests = [ chainId: 1, nonce: 0, gas: 27200, + maxPriorityFeePerGas: '0x3B9ACA00', gasLimit: '0x6A40', to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', toIban: 'XE04S1IRT2PR8A8422TPBL9SR6U0HODDCUT', // will be switched to "to" in the test @@ -636,6 +637,7 @@ var tests = [ chainId: 1, nonce: 0, gas: 27200, + maxPriorityFeePerGas: '0x3B9ACA00', gasLimit: '0x6A40', to: '0xF0109fC8DF283027b6285cc889F5aA624EaC1F55', toIban: 'XE04S1IRT2PR8A8422TPBL9SR6U0HODDCUT', // will be switched to "to" in the test @@ -757,6 +759,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -789,6 +792,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -828,6 +832,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -868,6 +873,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -909,6 +915,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -955,6 +962,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -1016,6 +1024,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }); }); @@ -1044,6 +1053,7 @@ describe("eth", function () { }) .catch(e => { console.log(i, e) + done(e); }) }); } From 1d0bfa81a1c87546ef8424d658fd33e54db68ba2 Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Tue, 31 Aug 2021 20:54:47 +0200 Subject: [PATCH 3/6] :white_check_mark: Fix unit tests for contract --- test/contract.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/contract.js b/test/contract.js index 3b5bc735d5a..3c7352d4383 100644 --- a/test/contract.js +++ b/test/contract.js @@ -2678,8 +2678,8 @@ var runTests = function(contractFactory) { '0000000000000000000000000000000000000000000000000000000000000011' , to: addressLowercase, from: addressLowercase, - maxPriorityFeePerGas: '0x3B9ACA00', - maxFeePerGas: '0x3b9aca0e' + maxPriorityFeePerGas: '0x9502F900', + maxFeePerGas: '0x9502f90e' }]); done(); From 2865bbc7b114bf4cdad98940f446e72dc2648eef Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Tue, 31 Aug 2021 21:33:31 +0200 Subject: [PATCH 4/6] :pencil: Update the docs with default value of maxPriorityFeePerGas --- docs/web3-eth.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/web3-eth.rst b/docs/web3-eth.rst index 64fb7e0412c..ce1da8866fb 100644 --- a/docs/web3-eth.rst +++ b/docs/web3-eth.rst @@ -1460,7 +1460,7 @@ Parameters - ``gasPrice`` - ``Number|String|BN|BigNumber``: (optional) The price of gas for this transaction in :ref:`wei `, defaults to :ref:`web3.eth.gasPrice `. - ``type`` - ``Number|String|BN|BigNumber``: (optional) A positive unsigned 8-bit number between 0 and 0x7f that represents the type of the transaction. - ``maxFeePerGas`` - ``Number|String|BN``: (optional, defaulted to ``(2 * block.baseFeePerGas) + maxPriorityFeePerGas``) The maximum fee per gas that the transaction is willing to pay in total - - ``maxPriorityFeePerGas`` - ``Number|String|BN`` (optional, defaulted to ``1 Gwei``) The maximum fee per gas to give miners to incentivize them to include the transaction (Priority fee) + - ``maxPriorityFeePerGas`` - ``Number|String|BN`` (optional, defaulted to ``2.5 Gwei``) The maximum fee per gas to give miners to incentivize them to include the transaction (Priority fee) - ``accessList`` - ``List of hexstrings`` (optional) a list of addresses and storage keys that the transaction plans to access - ``data`` - ``String``: (optional) Either a `ABI byte string `_ containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialisation code. - ``nonce`` - ``Number``: (optional) Integer of the nonce. This allows to overwrite your own pending transactions that use the same nonce. From 7f145be182e0082bdeeb8696948cc94e547840ed Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Tue, 31 Aug 2021 21:34:25 +0200 Subject: [PATCH 5/6] :loud_sound: Add change long entry --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ae2d55bff1..6fc440c4322 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -439,4 +439,5 @@ Released with 1.0.0-beta.37 code base. - ethers from 5.1.4 to 5.4.4 (#4231) - karma from 5.2.3 to 6.3.4 (#4231) - lerna from 3.22.1 to 4.0.0 (#4231) -- Droped build tests in CI for Node v8 and v10, and added support for Node v14 \ No newline at end of file +- Dropped build tests in CI for Node v8 and v10, and added support for Node v14 +- Change default value for `maxPriorityFeePerGas` from `1 Gwei` to `2.5 Gwei` (#4284) From 7862582b7eaac7570e502078166d5cb3e97e719c Mon Sep 17 00:00:00 2001 From: Nazar Hussain Date: Wed, 1 Sep 2021 14:26:13 +0200 Subject: [PATCH 6/6] :white_check_mark: Fix e2e test for method signing --- test/e2e.method.signing.js | 1 + 1 file changed, 1 insertion(+) diff --git a/test/e2e.method.signing.js b/test/e2e.method.signing.js index 4bfa2649812..757cedf4dc5 100644 --- a/test/e2e.method.signing.js +++ b/test/e2e.method.signing.js @@ -253,6 +253,7 @@ describe('transaction and message signing [ @E2E ]', function() { value: web3.utils.toHex(web3.utils.toWei('0.1', 'ether')), gas: web3.utils.toHex(21000), maxFeePerGas: '0x59682F00', // 1.5 Gwei + maxPriorityFeePerGas: '0x1DCD6500', // .5 Gwei accessList: [] };