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

state: Move pieces of State implemetation #784

Merged
merged 3 commits into from
Jan 9, 2024
Merged

Conversation

chfast
Copy link
Member

@chfast chfast commented Jan 8, 2024

  • Group methods revertible by rollback() (only touch() for now). We later want to hide the journal from users by providing revertible state modification methods.
  • Move State methods implementations to the state.cpp file. This hides the implementation and allows faster builds.
  • Move types related to Journal implementation to the class State scope.

@chfast chfast requested review from gumb0 and rodiazet January 8, 2024 11:34
Copy link

codecov bot commented Jan 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6327711) 97.91% compared to head (e44aebb) 97.91%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #784   +/-   ##
=======================================
  Coverage   97.91%   97.91%           
=======================================
  Files         110      110           
  Lines       10577    10580    +3     
=======================================
+ Hits        10356    10359    +3     
  Misses        221      221           
Flag Coverage Δ
blockchaintests 60.23% <ø> (ø)
statetests 62.16% <100.00%> (+0.03%) ⬆️
statetests-silkpre 26.00% <93.18%> (+0.02%) ⬆️
unittests 95.91% <100.00%> (+<0.01%) ⬆️

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

Files Coverage Δ
test/state/state.cpp 100.00% <100.00%> (ø)
test/state/state.hpp 100.00% <100.00%> (ø)

@chfast chfast force-pushed the state/impl_move_to_cpp branch 2 times, most recently from 0c3fb24 to 26c81ee Compare January 9, 2024 11:27
@chfast chfast requested a review from yperbasis January 9, 2024 11:28
@chfast chfast self-assigned this Jan 9, 2024
{
address addr;
};
struct JournalBase
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have some doc comments for base and deriving structs, but I can live w/o it.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is going to be updated later.

@rodiazet
Copy link
Contributor

rodiazet commented Jan 9, 2024

Can we also add a motivation of this change.

@chfast
Copy link
Member Author

chfast commented Jan 9, 2024

Can we also add a motivation of this change.

Added:

We later want to hide the journal from users by providing revertible state modification methods.
This hides the implementation and allows faster builds.

chfast added 3 commits January 9, 2024 15:05
This avoids heavy rebuilds when these implementations are modified.
These are internal State types visible in the header file only because
of C++ limitations.
@chfast chfast force-pushed the state/impl_move_to_cpp branch from 26c81ee to e44aebb Compare January 9, 2024 14:06
@chfast chfast merged commit 9c91286 into master Jan 9, 2024
25 checks passed
@chfast chfast deleted the state/impl_move_to_cpp branch January 9, 2024 15:09
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.

2 participants