-
Notifications
You must be signed in to change notification settings - Fork 756
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
Implement EIP 7702 #3470
Merged
Implement EIP 7702 #3470
Changes from 18 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
5bf8c17
common/tx: implement EIP7702
jochem-brouwer 4079bb5
tx: add 7702 cap and update authority checks
jochem-brouwer 2632f4c
vm: add 7702 support
jochem-brouwer 6dd25ae
tx: add 7702 tests
jochem-brouwer 0a8b27a
client: fix build
jochem-brouwer 0ae6f00
evm: support 7702
jochem-brouwer 09108c5
vm: add basic 7702 test and fix decoding auth list
jochem-brouwer 13ec300
vm: add specific eip-161 test
jochem-brouwer aeccb99
Merge branch 'master' into eip7702
jochem-brouwer f079602
vm: bump 7702 test coverage with one passing test
jochem-brouwer 9dbb55c
vm: add more 7702 tests
jochem-brouwer a764192
vm: add extra 7702 tests
jochem-brouwer 74446c1
tx: address feedback
jochem-brouwer 6502801
vm: address review
jochem-brouwer 4d59281
vm: add 7702 test to check for empty code (fails)
jochem-brouwer 69e7268
vm: fix 7702 empty code clearing
jochem-brouwer d54ff6b
Merge branch 'master' into eip7702
jochem-brouwer 3cebd3c
Merge remote-tracking branch 'origin/master' into eip7702
acolytec3 bc178f7
Merge branch 'master' into eip7702
ScottyPoi 149c061
add 7702 type to tx factory constructors
acolytec3 8583642
add 7702 test to runBlock test
acolytec3 6e31e14
vm: comment 7702 test
jochem-brouwer c520da4
vm: remove runBlock .only
jochem-brouwer 5a91eef
tx: address reviews
jochem-brouwer be8e3ac
tx: 7702 do not unpad address in authority list
jochem-brouwer de44658
vm: update eip7702 test
jochem-brouwer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { AccessLists } from '../util.js' | ||
|
||
import * as Legacy from './legacy.js' | ||
|
||
import type { EIP7702CompatibleTx } from '../types.js' | ||
|
||
/** | ||
* The amount of gas paid for the data in this tx | ||
*/ | ||
export function getDataFee(tx: EIP7702CompatibleTx): bigint { | ||
const eip2930Cost = BigInt(AccessLists.getDataFeeEIP2930(tx.accessList, tx.common)) | ||
const eip7702Cost = BigInt( | ||
tx.authorizationList.length * Number(tx.common.param('gasPrices', 'perAuthBaseCost')) | ||
) | ||
return Legacy.getDataFee(tx, eip2930Cost + eip7702Cost) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 is not a good reason that we have these
AuthorizationList
types in the Common interface file (these should really be reserved for the VIIs, to the "Very Important Interfaces" 😂 used to type on other libraries.Same goes I guess for the access list interfaces (for both: unless I am unaware of some below-tx-library usages).
We should move them over to tx in a small clean-up PR.
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.
I just checked, for both (so also
AccessList
) the only packages which import those are tx and vm, and since vm has a tx dependency we can indeed move these into common.I don't recall why we put AccessList in common (but to be consistent I also put AuthorizationList in here). I do slightly recall we maybe did this for package consumers to import these types (?) but then they would only need the
common
package and not importtx
? However this does not sound like a very good reason for me, I don't know if there is any use case for those types which would not depend or usetx
.We should indeed clean-up and remove both
AuthorizationList
andAccessList
from common (in same PR)