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

Clear from field from given transaction when reading them from the DB #644

Merged
merged 2 commits into from
Apr 21, 2022
Merged

Clear from field from given transaction when reading them from the DB #644

merged 2 commits into from
Apr 21, 2022

Conversation

peroket
Copy link
Contributor

@peroket peroket commented Apr 21, 2022

No description provided.

@codecov
Copy link

codecov bot commented Apr 21, 2022

Codecov Report

Merging #644 (12d755a) into master (a992e85) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #644      +/-   ##
==========================================
- Coverage   82.52%   82.51%   -0.02%     
==========================================
  Files         176      176              
  Lines       15237    15239       +2     
==========================================
  Hits        12574    12574              
- Misses       2663     2665       +2     
Impacted Files Coverage Δ
core/silkworm/types/transaction.cpp 87.93% <100.00%> (+0.06%) ⬆️
core/silkworm/state/in_memory_state.cpp 92.68% <0.00%> (-2.44%) ⬇️
core/silkworm/state/intra_block_state.cpp 97.46% <0.00%> (+0.94%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a992e85...12d755a. Read the comment docs.

Comment on lines 190 to 191
transaction.from.reset(); // rlp decode is not touching this field, so make sure it is empty
rlp::success_or_throw(rlp::decode(data_view, transaction));
Copy link
Contributor

Choose a reason for hiding this comment

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

I find a more natural place to reset the from field in rlp::decode.
That way we can be sure data initialization is complete and atomic instead of having to remember we may/may not need to reset.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, changed it

@yperbasis yperbasis merged commit 37fc794 into erigontech:master Apr 21, 2022
@peroket peroket deleted the fix-read-transactions-not-writting-to-all-fields branch May 9, 2022 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants