Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP1559 support including speedUpTransaction and stopTransaction #521

Merged
merged 36 commits into from
Jul 23, 2021
Merged
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
f1e4259
Transactions working
andrepimenta Jul 12, 2021
465c175
use SHA
rickycodes Jul 12, 2021
005d2e9
update lockfile
rickycodes Jul 13, 2021
3a8d58d
Add maxFeePerGas maxPriorityFeePerGas
rickycodes Jul 13, 2021
53b5616
Add convertPriceToDecimal and getIncreasedPriceHex
rickycodes Jul 13, 2021
4ad4fb1
Allow for eip1559 speed up
rickycodes Jul 13, 2021
3931231
Add new getIncreasedPriceFromExisting function
rickycodes Jul 13, 2021
d492e2f
Add type 2
rickycodes Jul 13, 2021
05d5a40
s/val/value
rickycodes Jul 13, 2021
49a5156
Fix broken test
rickycodes Jul 13, 2021
626794c
Update normalizeTransaction test
rickycodes Jul 13, 2021
e9e70fe
Move functions to utility
rickycodes Jul 13, 2021
4515bde
tests++
rickycodes Jul 13, 2021
2c997aa
address lint
rickycodes Jul 13, 2021
0f7e2ce
remove duplicate
rickycodes Jul 13, 2021
fbd1542
Add rate as param and update tests
rickycodes Jul 13, 2021
182290c
Update stopTransaction to fully support eip1559 transactions
rickycodes Jul 13, 2021
9a851e1
Add isEIP1559Transaction function
andrepimenta Jul 14, 2021
392a6bf
Add description to isEIP1559Transaction function
andrepimenta Jul 14, 2021
6a13891
Update isEIP1559Transaction to use hasOwnProperty
rickycodes Jul 14, 2021
c35785e
Fix typo
rickycodes Jul 14, 2021
de513cc
undo changes to getEIP1559Compatibility
rickycodes Jul 14, 2021
2668c6a
update web3-provider-engine
rickycodes Jul 15, 2021
01315ad
use commit without zero prefix
rickycodes Jul 15, 2021
848ca4f
Add estimated base fee and bump web3-provider-engine
andrepimenta Jul 16, 2021
99002a3
Fix test
andrepimenta Jul 16, 2021
90bf81b
Add isEIP1559Transaction to util
rickycodes Jul 16, 2021
5760f69
remove list of eips
rickycodes Jul 20, 2021
a91df53
remove type as we're not using this yet
rickycodes Jul 20, 2021
6fea9fe
Merge branch 'main' into eip1559-speed-up
rickycodes Jul 21, 2021
0f02953
Update tests
rickycodes Jul 21, 2021
86d7ff0
newMaxFeePerGas && newMaxPriorityFeePerGas
rickycodes Jul 21, 2021
6742f24
Merge branch 'main' into eip1559-speed-up
adonesky1 Jul 21, 2021
a4fe65c
Merge branch 'main' into eip1559-speed-up
rickycodes Jul 21, 2021
984a315
Merge branch 'main' into eip1559-speed-up
rickycodes Jul 22, 2021
1c70162
remove TODO
rickycodes Jul 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update stopTransaction to fully support eip1559 transactions
  • Loading branch information
rickycodes committed Jul 20, 2021
commit 182290ca73b15c08c4ab822d14f8f0bdba79822c
39 changes: 31 additions & 8 deletions src/transaction/TransactionController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -723,14 +723,37 @@ export class TransactionController extends BaseController<
CANCEL_RATE,
);

const txParams = {
from: transactionMeta.transaction.from,
gasLimit: transactionMeta.transaction.gas,
gasPrice,
nonce: transactionMeta.transaction.nonce,
to: transactionMeta.transaction.from,
value: '0x0',
};
const existingMaxFeePerGas = transactionMeta.transaction?.maxFeePerGas;
const existingMaxPriorityFeePerGas =
transactionMeta.transaction?.maxPriorityFeePerGas;

const newMaxFeePerGas =
existingMaxFeePerGas &&
getIncreasedPriceFromExisting(existingMaxFeePerGas, CANCEL_RATE);
const newMaxPriorityFeePerGas =
existingMaxPriorityFeePerGas &&
getIncreasedPriceFromExisting(existingMaxPriorityFeePerGas, CANCEL_RATE);

const txParams =
newMaxFeePerGas && newMaxFeePerGas
rickycodes marked this conversation as resolved.
Show resolved Hide resolved
? {
from: transactionMeta.transaction.from,
gasLimit: transactionMeta.transaction.gas,
maxFeePerGas: newMaxFeePerGas,
maxPriorityFeePerGas: newMaxPriorityFeePerGas,
type: 2,
rickycodes marked this conversation as resolved.
Show resolved Hide resolved
nonce: transactionMeta.transaction.nonce,
to: transactionMeta.transaction.from,
value: '0x0',
}
: {
from: transactionMeta.transaction.from,
gasLimit: transactionMeta.transaction.gas,
gasPrice,
nonce: transactionMeta.transaction.nonce,
to: transactionMeta.transaction.from,
value: '0x0',
};

const unsignedEthTx = this.prepareUnsignedEthTx(txParams);

Expand Down