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 JSON-RPC: from in eth_getTransactionByHash is not correctly popul… #10151

Merged
merged 4 commits into from
Jan 31, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions chain/types/ethtypes/eth_transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,16 @@ func EthTxFromSignedEthMessage(smsg *types.SignedMessage) (EthTx, error) {
return EthTx{}, xerrors.Errorf("failed to recover signature: %w", err)
}

fromAddr, err := EthAddressFromFilecoinAddress(smsg.Message.From)
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this issue still stands, unfortunately -- we'd like to resolve to an actual eth address (and not just a masked ID address) over the API, but can't do that at this layer (because this layer only has info about the types itself).

I think the correct think to do is to leave this method as-is (note that it explicitly states that it doesn't populate the From field on line 63), and instead populate this field in newEthTxFromSignedMessage in node/impl/full/eth.go.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushing this 1 level up makes sense 👍

if err != nil {
return EthTx{}, xerrors.Errorf("failed to get from: %w", err)
}

return EthTx{
Nonce: EthUint64(txArgs.Nonce),
ChainID: EthUint64(txArgs.ChainID),
To: txArgs.To,
From: fromAddr,
Value: EthBigInt(txArgs.Value),
Type: Eip1559TxType,
Gas: EthUint64(txArgs.GasLimit),
Expand Down