-
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
Added support for eth_createAccessList and sendTransaction support fo… #19798
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. |
Codecov Report
@@ Coverage Diff @@
## develop #19798 +/- ##
===========================================
- Coverage 69.41% 69.39% -0.02%
===========================================
Files 990 990
Lines 37418 37432 +14
Branches 10039 10043 +4
===========================================
+ Hits 25973 25975 +2
- Misses 11445 11457 +12
|
Builds ready [0246556]
Page Load Metrics (1635 ± 51 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
@@ -242,6 +242,7 @@ export default class TransactionStateManager extends EventEmitter { | |||
if (txMeta.txParams) { | |||
txMeta.txParams = normalizeAndValidateTxParams(txMeta.txParams, false); | |||
} | |||
console.log('add transaction, post normalization', txMeta.txParams); |
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.
do we need to keep this log?
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.
nope!
// dont use ethjs-query here because it will blow up about accessList | ||
if (txParams.accessList) { | ||
return await new Promise((resolve, reject) => { | ||
this.query.rpc.currentProvider.sendAsync( |
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.
Should we just update ethjs-query? What will be the difference by using the provider directly vs. using ethjs-query?
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.
Pr for updating it
7d04d32
to
2964536
Compare
Builds ready [2964536]
Page Load Metrics (1624 ± 56 ms)
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions. |
This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions. |
…r it
Explanation
Problem:
At the moment, we don't support accessList in transactions. This is a feature added by eip-2930, and in certain cases leads to gas used savings.
Solution:
At the very least, we should allow proxying eth_createAccessList calls to the connected network, and pass the transaction field
accessList
to be passed in for signing. We also allowaccessList
to be passed into estimate gas.Future considerations:
We can determine, for most cases, if providing an access list will amount to gas savings. There are however some cases where we wont know until after the transaction is added to a block, since the transaction and associated access list might be dependant on the state of a particular block, and become suboptimal in the next. We could explore ways of detecting these situations, but it would be pretty elaborate and so automatically creating accessLists was left out of the scope of this PR.
Fixes: https://github.com/MetaMask/MetaMask-planning/issues/870
Screenshots/Screencaps
Before
After
Manual Testing Steps
Pre-merge author checklist
Pre-merge reviewer checklist
If further QA is required (e.g. new feature, complex testing steps, large refactor), add the
Extension QA Board
label.In this case, a QA Engineer approval will be be required.