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

fix: fixed eth_getCode to now use blockNumber when address is an HTS token #3433

Merged
merged 23 commits into from
Feb 14, 2025

Conversation

simzzz
Copy link
Contributor

@simzzz simzzz commented Jan 28, 2025

Description:
If we pass an HTS token address to getCode, we do not take into account the block number, resulting in a bug where it would return the smart contract code even if the block number provided is earlier than the one where the token was created.

Related issue(s):

Fixes #3155

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@simzzz simzzz requested review from a team as code owners January 28, 2025 12:12
@simzzz simzzz requested a review from bubo January 28, 2025 12:12
Copy link

github-actions bot commented Jan 28, 2025

Test Results

 19 files   -   7  240 suites   - 111   33m 23s ⏱️ - 38m 33s
618 tests  -   4  613 ✅ + 11  4 💤 ±0  1 ❌  - 15 
633 runs   - 377  628 ✅  - 357  4 💤  - 2  1 ❌  - 18 

For more details on these failures, see this check.

Results for commit 599386c. ± Comparison against base commit 3e057b5.

♻️ This comment has been updated with latest results.

@simzzz simzzz added the bug Something isn't working label Jan 28, 2025
@simzzz simzzz added this to the 0.64.3 milestone Jan 28, 2025
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
@quiet-node quiet-node modified the milestones: 0.64.3, 0.66.0 Jan 29, 2025
@simzzz simzzz requested a review from Nana-EC as a code owner January 31, 2025 14:23
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
@quiet-node
Copy link
Member

@acuarica please kindly take a look when you have a chance to see if it meet yoru original requirements. Thanks much!

Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Signed-off-by: Simeon Nakov <[email protected]>
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Great work as always! Just some questions and suggestions.

@simzzz simzzz requested review from a team, georgi-l95 and Ivo-Yankov as code owners February 10, 2025 13:55
@simzzz simzzz requested a review from nathanklick February 10, 2025 13:55
@simzzz simzzz force-pushed the 3155-getCode-to-use-blockNumber branch from e7a831d to 7a921e3 Compare February 10, 2025 13:58
@simzzz simzzz requested review from quiet-node and acuarica and removed request for a team, bubo and nathanklick February 10, 2025 13:59
Signed-off-by: Simeon Nakov <[email protected]>
@quiet-node quiet-node modified the milestones: 0.66.0, 0.67.0 Feb 12, 2025
@simzzz simzzz requested a review from quiet-node February 13, 2025 09:14
Copy link
Member

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LGTM! Nice work!

@simzzz simzzz merged commit 4406824 into main Feb 14, 2025
45 of 47 checks passed
@simzzz simzzz deleted the 3155-getCode-to-use-blockNumber branch February 14, 2025 19:10
Copy link

codecov bot commented Feb 14, 2025

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 85.48%. Comparing base (156a858) to head (599386c).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
packages/relay/src/lib/eth.ts 66.66% 0 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (66.66%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3433      +/-   ##
==========================================
+ Coverage   84.46%   85.48%   +1.02%     
==========================================
  Files          69       69              
  Lines        4751     4734      -17     
  Branches     1059      999      -60     
==========================================
+ Hits         4013     4047      +34     
+ Misses        426      400      -26     
+ Partials      312      287      -25     
Flag Coverage Δ
config-service 95.16% <ø> (-2.99%) ⬇️
relay 79.54% <33.33%> (+0.25%) ⬆️
server 83.60% <ø> (+0.29%) ⬆️
ws-server 36.31% <ø> (-0.36%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
packages/relay/src/lib/eth.ts 86.15% <66.66%> (+4.56%) ⬆️

... and 23 files with indirect coverage changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

eth_getCode does not use blockNumber when address corresponds to an HTS token
4 participants