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

accounts/external, signer/core: clef support for 2930-type txs #22585

Merged
merged 2 commits into from
Apr 21, 2021

Conversation

holiman
Copy link
Contributor

@holiman holiman commented Mar 26, 2021

This PR adds support to use clef as a backend for signing 2930 type transcations.

-----------------------
WARN [03-26|14:47:56.832] Served account_signTransaction           reqid=4 t=1.856328178s             err="request denied"
--------- Transaction request-------------
to:    0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192
from:     0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192 [chksum ok]
value:    1 wei
gas:      0x84d0 (34000)
gasprice: 500 wei
nonce:    0x5 (5)
chainid:  0x796f6c6f763378
Accesslist
 0. 0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192
   0. 0x79e6c92a69cc29f3faafb3d3cfe5b6ffaea50d4cecde1c0b03442a56f16f337a
 1. 0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192
   0. 0x79e6c92a69cc29f3faafb3d3cfe5b6ffaea50d4cecde1c0b03442a56f16f337a

Request context:
	NA -> NA -> NA

Additional HTTP header data, provided by the external caller:
	User-Agent: ""
	Origin: ""
-------------------------------------------
Approve? [y/N]:
> n
-----------------------
WARN [03-26|14:48:09.235] Served account_signTransaction           reqid=5 t=2.223563371s             err="request denied"

However, there is a snag. The ChainId is implemented by both legacy and new type transactions, and for the old type, it's derived from the v. But when we approve it, it's not yet signed, so a legacy tx looks like this:

--------- Transaction request-------------
to:    0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192
from:     0x8A8eAFb1cf62BfBeb1741769DAE1a9dd47996192 [chksum ok]
value:    1 wei
gas:      0x84d0 (34000)
gasprice: 500 wei
nonce:    0x5 (5)
chainid:  0x7fffffffffffffee

Request context:
	NA -> NA -> NA

Additional HTTP header data, provided by the external caller:
	User-Agent: ""
	Origin: ""
-------------------------------------------
Approve? [y/N]:
> n

And that's not great. If we have a types.Transaction, we don't really know if the ChainId represents the "User wants to sign for X" or "This tx is signed for X". cc @fjl any ideas?

@holiman
Copy link
Contributor Author

holiman commented Mar 30, 2021

Fixed now

@fjl fjl added this to the 1.10.3 milestone Apr 20, 2021
Copy link
Contributor

@fjl fjl left a comment

Choose a reason for hiding this comment

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

I have tested this via eth_sendTransaction and it appears to work.

@fjl fjl merged commit 67da83a into ethereum:master Apr 21, 2021
atif-konasl pushed a commit to frozeman/pandora-execution-engine that referenced this pull request Oct 15, 2021
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.

3 participants