-
Notifications
You must be signed in to change notification settings - Fork 26
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
Add signed data/leash/signature to eth_call data #396
base: main
Are you sure you want to change the base?
Add signed data/leash/signature to eth_call data #396
Conversation
✅ Deploy Preview for oasisprotocol-sapphire-paratime ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Tests are failing
clients/py/sapphirepy/sapphire.py
Outdated
"data": params[0].get('data'), | ||
"leash": | ||
{ | ||
"nonce": web3.eth.get_transaction_count(params[0].get('from')), |
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.
Extract block and nonce into variable, to prevent multiple RPC requests for same data.
clients/py/sapphirepy/sapphire.py
Outdated
raise RuntimeError('Could not retrieve callDataPublicKey!') | ||
do_fetch = False | ||
|
||
c = _encrypt_tx_params(pk, params, w3, account) |
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.
This makes no distinction between transactions being submitted and eth_call
. This will break transactions - need two code paths, one for transactions and one for eth_call
.
'leash': leash, | ||
'signature': signed_msg['signature'], | ||
} | ||
params[0]['data'] = cbor2.dumps(data_pack, canonical=True) |
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.
Data isn't encrypted.
This PR adds signed queries to sapphire-py wrapper. Based on Go client, it builds a data_pack dictionary containing the signature and eip712 message data.
Currently returns "execution_reverted" error when testing on sapphire-localnet.