-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Replace incoming with external transactions #10908
Conversation
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. |
There was a problem hiding this 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: |
There was a problem hiding this comment.
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.
Moving this into draft until we complete the aforementioned work |
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. |
Fixes: #505 #7452
Explanation:
IncomingTransactionsController
has been replaced withExternalTransactionsController
showIncomingTransactions
feature flag has been changed toshowExternalTransactions
ExternalTransactionsController
now does not filter out outgoing transactionsSENT
has been added, wich is described as "External Send" transaction_normalizeTxFromEtherscan
sets the new transaction typeSENT
when address of the sender is the same as the one passed as the parameterManual testing steps: