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

added support for eip-2718 && 2930 #115

Merged
merged 9 commits into from
Jul 14, 2021
Merged

added support for eip-2718 && 2930 #115

merged 9 commits into from
Jul 14, 2021

Conversation

malonaz
Copy link
Contributor

@malonaz malonaz commented Jun 7, 2021

What was wrong?

The library does not support EIP-2718 (Typed Transactions) and EIP-2930 (Optional Access Lists).

Issue #114

How was it fixed?

EIP-2718 throws away the well-understood transaction format, leaving individual new transaction types free to define their encoding format. I initially attempted to plumb this through the existing transactions type, but eventually decided to introduce a typed_transactions library. The philosophy is simple: A lot of complexity in eth transactions (v vs chain etc) exist because of the traditional transaction format. The introduction of the transaction types in EIP-2718 means we no longer have to do hacky +V_OFFSET etc. I found it hard to code around these in the existing transaction library without introducing more complexity to an already complex piece of code. In addition, the traditional encoding format (RLP) leaks in and out of functions within transactions, making it tricky to introduce a new encoding format.

Cute Animal Picture

image

To-Do

  • Add tests

@wolovim
Copy link
Member

wolovim commented Jun 11, 2021

First, a big thank you for the work that's gone into this. I think all of us would-be reviewers are knee-deep in other issues at the moment, but someone will circle back as soon as we're able. These are nontrivial updates, so pinging @carver and @pipermerriam directly in case they want to take a peek.

@malonaz malonaz changed the title added supported for eip-2718 && 2930 added support for eip-2718 && 2930 Jun 11, 2021
@carver
Copy link
Contributor

carver commented Jun 14, 2021

I took just a very quick look first, focusing on the API level, and it looks roughly like what I'd expect. Thanks for putting this together!

I'll do a deeper dive in a bit. The lint looks like an easy fix, just deleting the "type: ignore" comment.

@malonaz
Copy link
Contributor Author

malonaz commented Jun 16, 2021

I tried deleting the three instances of 'type: ignore' comments, but it did not fix the issue.

@palkeo
Copy link

palkeo commented Jun 21, 2021

This PR would be the ideal foundation for adding the EIP-1559 transaction type.
I think it will be important to have before the London hard fork.

@lightclient
Copy link
Member

@carver seems like the lint is failing on master. I fixed it in #116.

@kclowes
Copy link
Collaborator

kclowes commented Jun 21, 2021

I wasn't able to get to this today, but planning on doing a deep-dive review on Wednesday. Thanks for the PR @malonaz!

@kclowes
Copy link
Collaborator

kclowes commented Jun 23, 2021

I started going through this today - like others have said it looks good from a high level! I'll continue going though tomorrow. One nitpicky thing I noticed is that you use assert a lot for validation. We prefer to raise instead, since it's easy for users to turn off AssertionErrors. Thanks!

@malonaz
Copy link
Contributor Author

malonaz commented Jun 25, 2021

I've switched to raise. thanks @kclowes

@malonaz malonaz mentioned this pull request Jun 25, 2021
1 task
Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

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

Thanks for your patience @malonaz! I finished going through and doing some testing and this looks solid to me. I only have two comments:

  • Do you mind adding either a note or example to the docstrings for sign_transaction and recover_transaction in eth_account/account.py to show usage for the 2930 access list type?
  • I added one note in the PR about making an abstract class that will enforce that certain methods are present on any child Transaction classes. Let me know what you think or if that needs clarification!

eth_account/_utils/typed_transactions.py Show resolved Hide resolved
@kclowes
Copy link
Collaborator

kclowes commented Jun 30, 2021

Thanks @malonaz, this is looking good to me! @carver - do you want to take another look?

@malonaz
Copy link
Contributor Author

malonaz commented Jul 12, 2021

hey @kclowes / @carver any updates on this? Thanks

@kclowes
Copy link
Collaborator

kclowes commented Jul 12, 2021

@malonaz thank for the reminder! I have a few other things at the top of my priority queue but should get to it by Wednesday at the latest!

Copy link
Collaborator

@kclowes kclowes left a comment

Choose a reason for hiding this comment

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

Thanks @malonaz! I'll rebase and merge shortly!

@malonaz
Copy link
Contributor Author

malonaz commented Jul 14, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants