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

feat: remove transactions with status INVALID_ACCOUNT_ID from block-specific routes #3177

Conversation

natanasow
Copy link
Collaborator

Description:

Currently, there are transactions that hadn't entered the evm (reverted due to hedera-specific validations) but are included in a generated record file, also they are imported in the mirror node db. These transactions must be excluded from the response to block-related routes.

Solutions:

We should hook in here https://github.com/hashgraph/hedera-json-rpc-relay/pull/3158/files#diff-dd8c7990f7764960d05dcb4c1b5ae7eee48b425b1b83d6dcc7e7ccc442330ef0R2303 and add a type for INVALID_ACCOUNT_ID as well.

These checks must be defined as an environment variable (as an array) and we could be able easily to add/remove transaction statuses.

Related issue(s):

Fixes #3171

Notes for reviewer:

Checklist

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

@natanasow natanasow self-assigned this Oct 30, 2024
@natanasow natanasow added this to the 0.60.0 milestone Oct 30, 2024
@natanasow natanasow added the bug Something isn't working label Oct 30, 2024
Copy link

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled validates enforcement of request id. This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: MarkSweepCompact
Cost: 30,549.4 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 1.46 MB
  • Total Heap Size Executable: no changes
  • Total Physical Size: decreased with 348.16 KB
  • Total Available Size: decreased with 7.20 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 64.00 bytes
  • Used Heap Size: decreased with 3.45 MB
  • Heap Size Limit: no changes
  • Malloced Memory: no changes
  • External Memory: no changes
  • Peak Malloced Memory: no changes

Heap Space Statistics (before vs after executing the test):

  • Old Space:

    • Space Size: increased with 1.84 MB
    • Space Used Size: increased with 2.07 MB
    • Space Available Size: decreased with 10.22 MB
    • Physical Space Size: increased with 1.84 MB
  • Large Object Space:

    • Space Size: increased with 835.58 KB
    • Space Used Size: increased with 813.50 KB
    • Space Available Size: no changes
    • Physical Space Size: increased with 835.58 KB

Recommendations

Please investigate the memory allocations in this test, focusing on objects that are not being properly deallocated.

Copy link

github-actions bot commented Oct 30, 2024

Test Results

 17 files   -   3  229 suites   - 42   28m 51s ⏱️ - 11m 43s
603 tests  -   1  599 ✅ +  4  4 💤 ±0  0 ❌  - 5 
619 runs   - 114  615 ✅  - 108  4 💤  - 1  0 ❌  - 5 

Results for commit a41beb1. ± Comparison against base commit 7fea98c.

This pull request removes 1 test.
"before all" hook for "should execute "eth_getCode" for hts token" ‑ RPC Server Acceptance Tests Acceptance tests @api-batch-2 RPC Server Acceptance Tests eth_getCode "before all" hook for "should execute "eth_getCode" for hts token"

♻️ This comment has been updated with latest results.

@natanasow natanasow marked this pull request as ready for review October 30, 2024 13:52
Copy link
Contributor

@victor-yanev victor-yanev left a comment

Choose a reason for hiding this comment

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

Nice work! A few suggestions:

packages/relay/src/utils.ts Outdated Show resolved Hide resolved
packages/relay/src/utils.ts Outdated Show resolved Hide resolved
packages/relay/src/utils.ts Outdated Show resolved Hide resolved
victor-yanev
victor-yanev previously approved these changes Oct 30, 2024
Copy link
Collaborator

@Nana-EC Nana-EC left a comment

Choose a reason for hiding this comment

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

Looking good.
I provided a log suggestion and a test suggestion that should be addressed.
Thanks

docs/configuration.md Outdated Show resolved Hide resolved
packages/relay/src/lib/eth.ts Show resolved Hide resolved
packages/relay/tests/lib/eth/eth_getBlockByNumber.spec.ts Outdated Show resolved Hide resolved
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.

LG just 1 small request and a qq

packages/relay/src/lib/eth.ts Outdated Show resolved Hide resolved
packages/relay/src/utils.ts Show resolved Hide resolved
quiet-node
quiet-node previously approved these changes Oct 31, 2024
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

…_account_id-from-block-routes

# Conflicts:
#	docs/configuration.md
Signed-off-by: nikolay <[email protected]>
…_account_id-from-block-routes

# Conflicts:
#	docs/configuration.md
victor-yanev
victor-yanev previously approved these changes Nov 4, 2024
docs/configuration.md Outdated Show resolved Hide resolved
quiet-node
quiet-node previously approved these changes Nov 4, 2024
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

Signed-off-by: nikolay <[email protected]>
Copy link

sonarcloud bot commented Nov 5, 2024

@ebadiere ebadiere merged commit 0736e01 into main Nov 5, 2024
45 checks passed
@ebadiere ebadiere deleted the 3171-remove-transactions-with-status-invalid_account_id-from-block-routes branch November 5, 2024 15:17
ebadiere pushed a commit that referenced this pull request Nov 5, 2024
…-specific routes (#3177)

* chore: add excluded transaction statuses array

Signed-off-by: nikolay <[email protected]>

* chore: resolve comments

Signed-off-by: nikolay <[email protected]>

* chore: resolve comments

Signed-off-by: nikolay <[email protected]>

* chore: resolve comments

Signed-off-by: nikolay <[email protected]>

* chore: pull main

Signed-off-by: nikolay <[email protected]>

* chore: alphabet order

Signed-off-by: nikolay <[email protected]>

---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
ebadiere added a commit that referenced this pull request Nov 5, 2024
…UNT_ID` from block… (#3217)

feat: remove transactions with status `INVALID_ACCOUNT_ID` from block-specific routes (#3177)

* chore: add excluded transaction statuses array



* chore: resolve comments



* chore: resolve comments



* chore: resolve comments



* chore: pull main



* chore: alphabet order



---------

Signed-off-by: nikolay <[email protected]>
Signed-off-by: Eric Badiere <[email protected]>
Co-authored-by: Nikolay Atanasow <[email protected]>
@quiet-node quiet-node added enhancement New feature or request and removed bug Something isn't working labels Nov 20, 2024
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.80%. Comparing base (7fea98c) to head (a41beb1).
Report is 34 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3177      +/-   ##
==========================================
- Coverage   83.35%   82.80%   -0.56%     
==========================================
  Files          66       69       +3     
  Lines        4290     4477     +187     
  Branches      837      883      +46     
==========================================
+ Hits         3576     3707     +131     
- Misses        473      501      +28     
- Partials      241      269      +28     
Flag Coverage Δ
config-service 98.14% <ø> (ø)
relay 85.23% <100.00%> (-0.31%) ⬇️
server 83.52% <ø> (ø)
ws-server 36.87% <ø> (ø)

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

Files with missing lines Coverage Δ
...ckages/config-service/src/services/globalConfig.ts 100.00% <ø> (ø)
packages/relay/src/lib/eth.ts 83.33% <100.00%> (+1.00%) ⬆️
packages/relay/src/utils.ts 100.00% <100.00%> (ø)

... and 15 files with indirect coverage changes

---- 🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove transactions with the status INVALID_ACCOUNT_ID from block-specific routes
7 participants