Conversation
…e nonce-tracker does not include them
|
Dapps should not be allowed to specify nonce only metamask. insure that this is the case. |
| await this.publishTransaction(txId, rawTx) | ||
| // must set transaction to submitted/failed before releasing lock | ||
| nonceLock.releaseLock() | ||
| if (nonceLock) nonceLock.releaseLock() |
There was a problem hiding this comment.
why would we not have a nonceLock here
| return new Promise((resolve, reject) => { | ||
| this.addUnapprovedTransaction(txMeta.txParams, (err, newTxMeta) => { | ||
| if (err) { | ||
| delete txMeta.ignore |
There was a problem hiding this comment.
why would we have txMeta.ignore here
| if (err) { | ||
| delete txMeta.ignore | ||
| this.updateTx(txMeta) | ||
| reject(err) |
There was a problem hiding this comment.
should we return here or do you intend to keep going and set the ignore to true and resolve the tx
| }) | ||
| } | ||
|
|
||
| _updateNonceDuplicates () { |
There was a problem hiding this comment.
please add comments explaining what this does
There was a problem hiding this comment.
we agreed that it would be easier to not maintain this list but just create in on demand
so we should create a new fn for nullifying txs from the same address with the same nonce
| const pendingTransactions = this.getPendingTransactions(address) | ||
| // await lock free | ||
| await this.lockMap[address] | ||
| if (pendingTransactions.length) await this.lockMap[address] |
There was a problem hiding this comment.
use brackets for if-else statements
prolly should put this.lockMap[address] into a var before using it since you look it up many times
this looks suspect
await this.lockMap[address]
vs
await this.lockMap[address]()There was a problem hiding this comment.
lockMap is promise, shouldnt be called
There was a problem hiding this comment.
we agreed to remove the pendingTransactions check before awaiting the nonce lock
(but you didnt remember why you put this here)
basically this (line 17-18) should look as it did before, simply await this.lockMap[address]
|
|
||
| TransactionIcon.prototype.render = function () { | ||
| const { transaction, txParams, isMsg } = this.props | ||
| const isIgnored = (transaction.ignore && transaction.status === 'submitted') |
There was a problem hiding this comment.
why is the status relevant if the flag is set to ignore?
| const nonce = txParams.nonce ? numberToBN(txParams.nonce).toString(10) : '' | ||
|
|
||
| const isClickable = ('hash' in transaction && isLinkable) || isPending | ||
| const isIgnored = (transaction.ignore && transaction.status === 'submitted') |
There was a problem hiding this comment.
same as above,
why is the status relevant if the flag is set to ignore?
| this.addUnapprovedTransaction(txMeta.txParams, (err, newTxMeta) => { | ||
| if (err) { | ||
| delete txMeta.ignore | ||
| this.updateTx(txMeta) |
There was a problem hiding this comment.
wont need to update the tx either
| const blockNumber = currentBlock.number | ||
| const pendingTransactions = this.getPendingTransactions(address) | ||
| const baseCount = await this._getTxCount(address, blockNumber) | ||
| const baseCount = await this._getTxCount(address) |
There was a problem hiding this comment.
the order of requests here is really important:
- get current block
- get pending transactions
- get base tx count @ block
- calculate new nonce
we should add comments explaining why this is:
we need to make sure our
base countandpending countare from the same block
…etwork coverage on extension (#22618) ## **Description** - What's new copy should be updated to: > Steer clear of known scams while still preserving your privacy with security alerts powered by Blockaid. This feature is available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. > > Always do your own due diligence before approving requests. - Settings copy should be updated to: > Privacy preserving - no data is shared with third parties. Available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. ## **Related issues** Fixes: [#1695](https://github.com/MetaMask/MetaMask-planning/issues/1695) Blocked By: #22070 ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-extension/assets/44811/0e6b6103-efb0-4ed8-94c2-44ac0f281ff8 ### **After** https://github.com/MetaMask/metamask-extension/assets/44811/36740992-0af2-44c5-b62b-0ac522df4d17 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
…etwork coverage on extension (#22618) ## **Description** - What's new copy should be updated to: > Steer clear of known scams while still preserving your privacy with security alerts powered by Blockaid. This feature is available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. > > Always do your own due diligence before approving requests. - Settings copy should be updated to: > Privacy preserving - no data is shared with third parties. Available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. ## **Related issues** Fixes: [#1695](MetaMask/MetaMask-planning#1695) Blocked By: #22070 ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-extension/assets/44811/0e6b6103-efb0-4ed8-94c2-44ac0f281ff8 ### **After** https://github.com/MetaMask/metamask-extension/assets/44811/36740992-0af2-44c5-b62b-0ac522df4d17 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
…etwork coverage on extension (#22618) ## **Description** - What's new copy should be updated to: > Steer clear of known scams while still preserving your privacy with security alerts powered by Blockaid. This feature is available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. > > Always do your own due diligence before approving requests. - Settings copy should be updated to: > Privacy preserving - no data is shared with third parties. Available on Arbitrum, Avalanche, BNB chain, Ethereum Mainnet, Linea, Optimism and Polygon. ## **Related issues** Fixes: [#1695](https://github.com/MetaMask/MetaMask-planning/issues/1695) Blocked By: #22070 ## **Screenshots/Recordings** ### **Before** https://github.com/MetaMask/metamask-extension/assets/44811/0e6b6103-efb0-4ed8-94c2-44ac0f281ff8 ### **After** https://github.com/MetaMask/metamask-extension/assets/44811/36740992-0af2-44c5-b62b-0ac522df4d17 ## **Pre-merge author checklist** - [x] I’ve followed [MetaMask Coding Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md). - [x] I've clearly explained what problem this PR is solving and how it is solved. - [x] I've linked related issues - [x] I've included manual testing steps - [x] I've included screenshots/recordings if applicable - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I’ve properly set the pull request status: - [ ] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
create a button for resubmitting transactions with the same nonce