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

eth_getTransactionReceipt go-ethereum compatibility #226

Closed
rafaelkallis opened this issue Jun 16, 2022 · 2 comments · Fixed by #235
Closed

eth_getTransactionReceipt go-ethereum compatibility #226

rafaelkallis opened this issue Jun 16, 2022 · 2 comments · Fixed by #235
Assignees
Labels
dev tools Features enabling dev tool integration enhancement New feature or request P2
Milestone

Comments

@rafaelkallis
Copy link
Contributor

Problem

We are facing a similar situation as in #149 , but for eth_getTransactionReceipt. Specifically there is a schema disagreement over log.transactionHash between the ethereum execution apis and go-ethereum.

The ethereum execution apis do not mark that property as required https://github.com/ethereum/execution-apis/blob/main/src/schemas/receipt.json#L18.

The go-ethereum client however does mark that property as required https://github.com/ethereum/go-ethereum/blob/master/core/types/log.go#L45.

Would be great if we can include the transactionHash inside logs so that we satisfy the go-ethereum validation.

Solution

The logs are mapped here on the relay node:

const answer = {
blockHash: receiptResponse.block_hash.substring(0, 66),
blockNumber: EthImpl.numberTo0x(receiptResponse.block_number),
from: receiptResponse.from,
to: receiptResponse.to,
cumulativeGasUsed: EthImpl.numberTo0x(receiptResponse.block_gas_used),
gasUsed: EthImpl.numberTo0x(receiptResponse.gas_used),
contractAddress: createdContract,
logs: receiptResponse.logs,
logsBloom: receiptResponse.bloom,
transactionHash: receiptResponse.hash,
transactionIndex: EthImpl.numberTo0x(receiptResponse.transaction_index),
effectiveGasPrice: EthImpl.numberTo0x(Number.parseInt(effectiveGas) * 10_000_000_000),
root: receiptResponse.root,
status: receiptResponse.status,
};

const logs = receiptResponse.logs.map(log => ({ ...log, transactionHash: receiptResponse.hash}));

Alternatives

No response

@rafaelkallis rafaelkallis added the enhancement New feature or request label Jun 16, 2022
@shemnon
Copy link
Contributor

shemnon commented Jun 17, 2022

Can you post this finding to https://github.com/ethereum/execution-apis/issues? This part in particular

Specifically there is a schema disagreement over log.transactionHash between the ethereum execution apis and go-ethereum.

The ethereum execution apis do not mark that property as required https://github.com/ethereum/execution-apis/blob/main/src/schemas/receipt.json#L18.

The go-ethereum client however does mark that property as required https://github.com/ethereum/go-ethereum/blob/master/core/types/log.go#L45.

The core devs either need to make it required or geth needs to come into compliance. Either outcome is acceptable to me. But we should add it on our end.

@rafaelkallis
Copy link
Contributor Author

rafaelkallis commented Jun 17, 2022

reference ethereum/execution-apis#240 (merged!)

@Nana-EC Nana-EC self-assigned this Jun 17, 2022
@Nana-EC Nana-EC added P2 dev tools Features enabling dev tool integration labels Jun 17, 2022
@Nana-EC Nana-EC added this to the 0.2.0 milestone Jun 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev tools Features enabling dev tool integration enhancement New feature or request P2
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants