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: Bug due to validations of eth_call #2843

Merged
merged 16 commits into from
Aug 21, 2024

Conversation

victor-yanev
Copy link
Contributor

Description:

This PR modifies the object validation logic in order to support the deletion of unknown properties.

  • Adds check for deleteUnknownProperties in object schema
  • Calls deleteUnknownProperties method if the schema property is set

Related issue(s):

Fixes #2827

Checklist

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

victor-yanev and others added 14 commits August 5, 2024 17:51
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
@victor-yanev victor-yanev added the bug Something isn't working label Aug 19, 2024
@victor-yanev victor-yanev added this to the 0.55.0 milestone Aug 19, 2024
@victor-yanev victor-yanev self-assigned this Aug 19, 2024
@victor-yanev victor-yanev changed the base branch from main to 2790-Refactor-validation-logic-in-the-server-package August 19, 2024 12:54
Copy link

🚨 Memory Leak Detected 🚨

A potential memory leak has been detected in the test titled should execute "eth_chainId". This may impact the application's performance and stability.

Details

📊 Memory Leak Detection Report 📊

GC Type: Scavenge
Cost: 5,372.42 ms

Heap Statistics (before vs after executing the test):

  • Total Heap Size: increased with 1.69 MB
  • Total Heap Size Executable: no changes
  • Total Physical Size: increased with 1.69 MB
  • Total Available Size: increased with 9.63 MB
  • Total Global Handles Size: no changes
  • Used Global Handles Size: decreased with 352.00 bytes
  • Used Heap Size: decreased with 9.30 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 3.23 MB
    • Space Available Size: decreased with 1.49 MB
    • Physical Space Size: increased with 1.84 MB
  • Large Object Space:

    • Space Size: increased with 282.62 KB
    • Space Used Size: increased with 277.54 KB
    • Space Available Size: no changes
    • Physical Space Size: increased with 282.62 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 Aug 19, 2024

Acceptance Tests

  21 files  264 suites   33m 20s ⏱️
612 tests 588 ✔️ 4 💤 20
860 runs  834 ✔️ 4 💤 22

Results for commit 0f5e932.

♻️ This comment has been updated with latest results.

Base automatically changed from 2790-Refactor-validation-logic-in-the-server-package to main August 19, 2024 14:48
Signed-off-by: Victor Yanev <[email protected]>

# Conflicts:
#	packages/server/src/types/validator/objectTypes.ts
#	packages/server/src/validator/objectTypes.ts
Copy link

sonarcloud bot commented Aug 19, 2024

Copy link

Tests

       3 files     204 suites   58s ⏱️
1 038 tests 1 037 ✔️ 1 💤 0
1 050 runs  1 049 ✔️ 1 💤 0

Results for commit 0f5e932.

Copy link
Collaborator

@ebadiere ebadiere left a comment

Choose a reason for hiding this comment

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

LG.

@ebadiere ebadiere requested a review from acuarica August 21, 2024 16:22
Copy link
Contributor

@acuarica acuarica left a comment

Choose a reason for hiding this comment

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

lg

@victor-yanev victor-yanev merged commit 4a01a74 into main Aug 21, 2024
38 checks passed
@victor-yanev victor-yanev deleted the 2827-Bug-due-to-validations-of-eth_call branch August 21, 2024 16:54
Copy link

codecov bot commented Aug 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.19%. Comparing base (d75c277) to head (0f5e932).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2843      +/-   ##
==========================================
+ Coverage   79.76%   81.19%   +1.42%     
==========================================
  Files          30       46      +16     
  Lines        2718     3403     +685     
  Branches      586      717     +131     
==========================================
+ Hits         2168     2763     +595     
- Misses        356      409      +53     
- Partials      194      231      +37     
Flag Coverage Δ
relay 80.90% <ø> (+1.14%) ⬆️
server 81.19% <100.00%> (?)
ws-server 97.87% <ø> (?)

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

Files Coverage Δ
packages/server/src/validator/objectTypes.ts 90.24% <100.00%> (ø)

... and 16 files with indirect coverage changes

ebadiere pushed a commit that referenced this pull request Aug 21, 2024
* refactor: Validation logic in the `server` package

Signed-off-by: Victor Yanev <[email protected]>

* fix: rpc_batch3.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* fix: rpc_batch3.spec.ts

Signed-off-by: Victor Yanev <[email protected]>

* chore: address comments

Signed-off-by: Victor Yanev <[email protected]>

* chore: extend tests in `validator.spec.ts` to cover `tracerConfig` type

Signed-off-by: Victor Yanev <[email protected]>

* chore: final touches + address comments

Signed-off-by: Victor Yanev <[email protected]>

* fix: build error

Signed-off-by: Victor Yanev <[email protected]>

* fix: allow "0x" value for BASE_HEX_REGEX

Signed-off-by: Victor Yanev <[email protected]>

* fix: allow ``"0x"` value for `hex` type

Signed-off-by: Victor Yanev <[email protected]>

* fix: allow ``"0x"` value for `hex` type

Signed-off-by: Victor Yanev <[email protected]>

* fix: Bug due to validations of `eth_call`

Signed-off-by: Victor Yanev <[email protected]>

* fix: tests after new validations for Transaction object

Signed-off-by: Victor Yanev <[email protected]>

---------

Signed-off-by: Victor Yanev <[email protected]>
Signed-off-by: Victor Yanev <[email protected]>
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.

Bug due to validations of eth_call
3 participants