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

rpc: fix the from address calculation #4593

Merged
merged 3 commits into from
Dec 19, 2023

Conversation

MaxMustermann2
Copy link
Contributor

@MaxMustermann2 MaxMustermann2 commented Dec 19, 2023

rpc: calculate SenderAddress before ConvertToEth

tx.ConvertToEth silently drops the ShardID and ToShardID fields.
This results in the hash of the transaction changing (either via removal
of these fields in the hash calculation or by automatic filling of the
values by the node's shard). The different hash calculation results in
incorrect sender address calculation.

There have been a couple of attempts to fix this issue, which created
troubles elsewhere. This pull request reverts to the behaviour seen in
2023.3.0 with a simple edit that calculates the SenderAddress before
dropping the fields in the call to ConvertToEth.

These were skipped intentionally in the previous pull request
`tx.ConvertToEth` silently drops the `ShardID` and `ToShardID` fields.
This results in the hash of the transaction changing (either via removal
of these fields in the hash calculation or by automatic filling of the
values by the node's shard). The different hash calculation results in
incorrect sender address calculation.

There have been a couple of attempts to fix this issue, which created
troubles elsewhere. This pull request reverts to the behaviour seen in
2023.3.0 with a simple edit that calculates the `SenderAddress` before
dropping the fields in the call to `ConvertToEth`.
@diego1q2w diego1q2w merged commit 8717ccf into harmony-one:main Dec 19, 2023
3 checks passed
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.

3 participants