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

Add new lotus-shed command for computing eth hash for a given mcid #10961

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Jun 6, 2023

Context
I needed a quick way to compute the eth hash for a given message cid so I could use that for constructing options to RPC calls like eth_getTransactionReceipt.

Test plan

Looked up a random message bafy2bzaceduvlffwumoq6j7rmx5evgsyl2fa3nh7oaqbzt7t4n3r75f2vqqpy on filfox and used that as an example:

./lotus-shed eth compute-eth-hash bafy2bzaceduvlffwumoq6j7rmx5evgsyl2fa3nh7oaqbzt7t4n3r75f2vqqpy
0xbc7c5ebdada305ea6922e5644fba5ecb283ce3f2f4cfe58a786eed744df70042

Confirmed that the returned eth hash is valid:

curl -s  http://localhost:1234/rpc/v1  -X POST -H "Content-Type: application/json" --data '{"method":"eth_getTransactionReceipt","params":["0xbc7c5ebdada305ea6922e5644fba5ecb283ce3f2f4cfe58a786eed744df70042"],"id":1,"jsonrpc":"2.0"}'|jq
{
  "jsonrpc": "2.0",
  "result": {
    "transactionHash": "0xbc7c5ebdada305ea6922e5644fba5ecb283ce3f2f4cfe58a786eed744df70042",
    "transactionIndex": "0x3f",
    "blockHash": "0x847a7fa6777a1fa7db9741a8e6d1a1eeb1590b0e1691021797f0add6f8bb0ac3",
    "blockNumber": "0x2b0c1d",
    "from": "0xb59ab49ef45d88fdeb6d955099d1a8d7cebb0d2b",
    "to": "0x66081f26cc780bc03fddb2839586f53f007b82b0",
    "root": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "status": "0x1",
    "contractAddress": null,
    "cumulativeGasUsed": "0x0",
    "gasUsed": "0x4b4366",
    "effectiveGasPrice": "0xaa2bef",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "logs": [],
    "type": "0x2"
  },
  "id": 1
}

@fridrik01 fridrik01 marked this pull request as ready for review June 6, 2023 22:27
@fridrik01 fridrik01 requested a review from a team as a code owner June 6, 2023 22:27
@Stebalien Stebalien merged commit 9e4f1a4 into master Jun 6, 2023
92 of 93 checks passed
@Stebalien Stebalien deleted the cid-to-ethtx branch June 6, 2023 22:53
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.

None yet

2 participants