Closed Eikix closed 1 year ago
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
hi i'd like to take this issue!
hey @internnos ! happy to see you here,
I believe the correct way to go about this issue is to grab the nonce of a particular starknet address using the starknet-rpc endpoint.
you can draw inspiration from the current architecture and other methods. but essentially:
hey @internnos ! happy to see you here,
I believe the correct way to go about this issue is to grab the nonce of a particular starknet address using the starknet-rpc endpoint.
you can draw inspiration from the current architecture and other methods. but essentially:
- grab the ethereum address received, and ask Kakarot to compute the corresponding starknet address (using compute_starknet_address)
- call the starknet rpc method get_nonce https://github.com/starkware-libs/starknet-specs/blob/master/api/starknet_api_openrpc.json#L629
- return the correctly formed payload (as per the spec) https://ethereum.github.io/execution-apis/api-documentation/
happy to see you again @Eikix !
gotcha, on it! thanks for the suggestion!
i have a question @Eikix
according to this the signature of compute_starknet_address
needs starknet_block_id
however, during the computation of transaction_count
, ethereum_block_id
is not required
https://ethereum.github.io/execution-apis/api-documentation/
but when i tried without the ethereum_block_id
, i got the following error
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32602,
"message": "missing value for required argument 1"
}
}
does it mean that the ethereum spec docs is incorrect in this part?
hey @internnos , so I used the https://composer.alchemy.com/ tool to make a smol test and this param is actually not required, see corresponding curl request
$ curl 'https://eth-mainnet.g.alchemy.com/v2/18lHSAeZttzI4wJvHpXlJGHK4ZDNCTCP' \
-H 'content-type: application/json' \
--data-raw '{"jsonrpc":"2.0","id":0,"method":"eth_getTransactionCount","params":["0xabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"]}' \
--compressed
{"jsonrpc":"2.0","id":0,"result":"0x0"}%
which means that we should handle this in the RPC as well. Not providing the block means "latest"
btw
hey @internnos , so I used the https://composer.alchemy.com/ tool to make a smol test and this param is actually not required, see corresponding curl request
$ curl 'https://eth-mainnet.g.alchemy.com/v2/18lHSAeZttzI4wJvHpXlJGHK4ZDNCTCP' \ -H 'content-type: application/json' \ --data-raw '{"jsonrpc":"2.0","id":0,"method":"eth_getTransactionCount","params":["0xabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd"]}' \ --compressed {"jsonrpc":"2.0","id":0,"result":"0x0"}%
which means that we should handle this in the RPC as well. Not providing the block means
"latest"
btw
aah thanks for the clarity. all clear now, thanks @ClementWalter!
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale. Please make sure to update to the latest version and check if that solves the issue. Let us know if that works for you by leaving a 👍 Because this issue is marked as stale, it will be closed and locked in 7 days if no further activity occurs. Thank you for your contributions!
eth_getTransactionCount
Specification Description
Requests a specific account's number of transactions, in order to compute its nonce.
Parameters
Returns
Kakarot Logic
Call the Starknet
starknet_getNonce
json rpc method. Return it.