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 unnecessary empty Trie initialization #2840

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

natanasow
Copy link
Collaborator

Description:

The empty trie root hash can be defined as constant because it can't be changed so there is no actual gain in performance or code readability. The initialization of an empty trie here can be deprecated and replaced with a constant variable.

Solution:

Remove the initialization here and define a new constant that wraps an empty trie root hash.

Related issue(s):

Fixes #2839

Notes for reviewer:

Checklist

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

@natanasow natanasow self-assigned this Aug 19, 2024
@natanasow natanasow added the enhancement New feature or request label Aug 19, 2024
@natanasow natanasow added this to the 0.55.0 milestone Aug 19, 2024
Copy link

github-actions bot commented Aug 19, 2024

Acceptance Tests

  20 files  236 suites   30m 5s ⏱️
613 tests 590 ✔️ 4 💤 19
726 runs  703 ✔️ 4 💤 19

Results for commit fdfdfbd.

♻️ This comment has been updated with latest results.

victor-yanev
victor-yanev previously approved these changes Aug 19, 2024
Copy link

Copy link

Tests

       3 files     202 suites   57s ⏱️
1 012 tests 1 011 ✔️ 1 💤 0
1 025 runs  1 024 ✔️ 1 💤 0

Results for commit fdfdfbd.

@natanasow natanasow marked this pull request as ready for review August 19, 2024 13:38
Copy link
Contributor

@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.

@natanasow natanasow merged commit af09470 into main Aug 22, 2024
38 checks passed
@natanasow natanasow deleted the 2839-remove-unnecessary-empty-trie-initialization branch August 22, 2024 05:59
Copy link

codecov bot commented Aug 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.19%. Comparing base (4ca9718) to head (fdfdfbd).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2840      +/-   ##
==========================================
+ Coverage   80.14%   81.19%   +1.05%     
==========================================
  Files          30       46      +16     
  Lines        2709     3403     +694     
  Branches      582      712     +130     
==========================================
+ Hits         2171     2763     +592     
- Misses        344      415      +71     
- Partials      194      225      +31     
Flag Coverage Δ
relay 80.82% <100.00%> (+0.68%) ⬆️
server 81.53% <ø> (?)
ws-server 97.87% <ø> (?)

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

Files Coverage Δ
packages/relay/src/lib/constants.ts 90.90% <ø> (ø)
packages/relay/src/lib/eth.ts 81.39% <100.00%> (-0.07%) ⬇️

... and 17 files with indirect coverage changes

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 unnecessary empty Trie initialization
3 participants