-
Notifications
You must be signed in to change notification settings - Fork 75
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
Return evm_address in eth_getTransactionByHash and eth_getTransactionReceipt #1726
Conversation
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
# Conflicts: # packages/relay/src/lib/clients/mirrorNodeClient.ts # packages/relay/src/lib/eth.ts # packages/server/tests/acceptance/rpc_batch1.spec.ts # packages/server/tests/helpers/assertions.ts
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1726 +/- ##
==========================================
+ Coverage 76.65% 76.74% +0.08%
==========================================
Files 39 39
Lines 2913 2915 +2
Branches 584 588 +4
==========================================
+ Hits 2233 2237 +4
+ Misses 499 496 -3
- Partials 181 182 +1
☔ View full report in Codecov by Sentry. 📢 Have feedback on the report? Share it here. |
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
One consideration based on HIP 729
packages/relay/src/lib/eth.ts
Outdated
@@ -1802,8 +1811,10 @@ export class EthImpl implements Eth { | |||
const receipt: any = { | |||
blockHash: toHash32(receiptResponse.block_hash), | |||
blockNumber: numberTo0x(receiptResponse.block_number), | |||
from: receiptResponse.from, | |||
to: receiptResponse.to, | |||
from: receiptResponse.from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could move the undefined/null check into the resolveEvmAddress()
Assertions.evmAddress(txByHash.from); | ||
Assertions.longZeroAddress(txByHash.to); | ||
Assertions.evmAddress(receipt.from); | ||
Assertions.longZeroAddress(receipt.to); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q: post HIP 729 shouldn't all new contract have a valid evm addresses?
I thought we were trying to return evm address values all the time when applicable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I've noticed, contracts that have been deployed via the SDK (using fileCreateTransaction
still show a long-zero address in the mirror node instead of a proper evm address. Here are a couple of the latest contracts on testnet:
- 0.0.1581464 - returns long-zero
- 0.0.1581465 - returns evm address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very strange.
Can you open an issue on the services side so we can track this nuance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Ivo Yankov <ivo@devlabs.bg>
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
…Receipt (#1726) * wip: fix receipt format Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * feat: return evm format of from and to address Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: handle missing to Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * nit: fix code smells Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * test: add more test cases Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: code optimization Signed-off-by: Ivo Yankov <ivo@devlabs.bg> --------- Signed-off-by: Ivo Yankov <ivo@devlabs.bg> Signed-off-by: ebadiere <ebadiere@gmail.com>
…Receipt (#1726) * wip: fix receipt format Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * feat: return evm format of from and to address Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: handle missing to Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * nit: fix code smells Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * test: add more test cases Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: code optimization Signed-off-by: Ivo Yankov <ivo@devlabs.bg> --------- Signed-off-by: Ivo Yankov <ivo@devlabs.bg> Signed-off-by: ebadiere <ebadiere@gmail.com>
…Receipt (hashgraph#1726) * wip: fix receipt format Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * feat: return evm format of from and to address Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * fix: handle missing to Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * nit: fix code smells Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * test: add more test cases Signed-off-by: Ivo Yankov <ivo@devlabs.bg> * chore: code optimization Signed-off-by: Ivo Yankov <ivo@devlabs.bg> --------- Signed-off-by: Ivo Yankov <ivo@devlabs.bg> Signed-off-by: Mo Shaikjee <shaikjeemohammed@gmail.com>
Description:
Changes the
to
andfrom
addresses returned byeth_getTransactionByHash
andeth_getTransactionReceipt
to always beevm_addresses
instead of long-zero whenever such an address exists. In all other cases a long-zero address is returned.Related issue(s):
Fixes #1710
Notes for reviewer:
Checklist