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

Replace incoming with external transactions #10908

Closed

Conversation

PatrykLucka
Copy link
Contributor

Fixes: #505 #7452

Explanation:

  1. IncomingTransactionsController has been replaced with ExternalTransactionsController
  2. showIncomingTransactions feature flag has been changed to showExternalTransactions
  3. ExternalTransactionsController now does not filter out outgoing transactions
  4. New transactions type SENT has been added, wich is described as "External Send" transaction
  5. _normalizeTxFromEtherscan sets the new transaction type SENT when address of the sender is the same as the one passed as the parameter

Screenshot 2021-04-20 at 12 51 58

Manual testing steps:

  • Import account using private key
  • Use the same private key to import it to other instance of MM or any other wallet
  • Send transaction using 2nd wallet
  • Wait for the block request in 1st MM instance
  • Check if "External Send" transaction will show up

@PatrykLucka PatrykLucka requested a review from a team as a code owner April 21, 2021 07:17
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor

@brad-decker brad-decker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's some more nuances here that we have to figure out before this can merge in. First off we currently trim transaction history of the metamask originated transactions to 50 transactions while there is no such cap for this controller. Removing the filter on which transactions it considers could result in new behavior never before seen in the extension. For example, given that the UI groups transactions by nonce, and relies on the history object of our transaction state for displaying the history, throwing in new transactions that do not have that key into the mix could be potentially confusing. Further more transactions sent from outside of MetaMask could potentially confuse the UI. Consider a transaction that is initiated and fails before being submitted, it'll have a nonce associated with it. It becomes the "primary" transaction for informing the UI what occurred. We then bring in a transaction remotely, issued from outside of MetaMask, that shares the same nonce. The status of the transaction will change in the UI but the title and the details of the transaction do not. We have this problem today, adding in outside sources will further complicate the issue.

I have some inflight work preparing for EIP-1559 and others that will change the way transactions are grouped and I think that is the appropriate time to consider this and incorporate it into that work.

@@ -282,7 +281,10 @@ export default class IncomingTransactionsController {
value: bnToHex(new BN(etherscanTransaction.value)),
},
hash: etherscanTransaction.hash,
type: TRANSACTION_TYPES.INCOMING,
type:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type parameter here will not be this simple, this could be any currently supported type of transaction not just sent or incoming. In the main transaction controller we use a method that determines what the transaction's type is.. we could potentially reuse some of that logic.

@Gudahtt
Copy link
Member

Gudahtt commented Sep 24, 2021

Moving this into draft until we complete the aforementioned work

@brad-decker
Copy link
Contributor

Hey @PatrykLucka, i'm going to close this PR. We definitely want this work, but as stated before a large amount of effort is needed to modify how we group transactions so that we can effectively handle transactions from clients outside of MetaMask. I have added a comment to #505 which is the issue originally describing this problem.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Load transaction history from other clients
3 participants