-
Notifications
You must be signed in to change notification settings - Fork 104
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
Modules: WorkingSet refactoring. #384
Conversation
Codecov Report
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks great overall, but I'm wondering if we can rename some things to clarify roles. (This isn't blocking, since the problems pre-date this PR).
Currently, the workflow to commit some changes to the DB is storage.validate_and_commit(working_set.commit().freeze())
, which seems really cumbersome.
Maybe we can rename CommittedWorkingSet
to StateCheckpoint
or something. And then commit()
could get renamed to checkpoint()
. As for freeze
- maybe we could rename to split_for_storage()
or something?
If anyone has suggestions for renaming any of these items, leave them below! cc @citizen-stig @bkolad @dubbelosix
Added an issue: #388 |
Description
This PR splits
WorkingSet
enum into two typesWorkingSet & CommittedWorkingSet
. This has the following advantages:The
AppTemplate
now storesCommittedWorkingSet
, ensuring that only the state that has been committed in theapply_batch
method is stored in the database during theend_slot
phaseThe
commit & revert
methods are exclusive to theWorkingSet
type and return aCommittedWorkingSet
instance. Additionally, only theCommittedWorkingSet
type hasto_revertable()
method. This explicit state transition betweenWorkingSet
andCommittedWorkingSet
prevents the accidental reversion of aCommittedWorkingSet
or the storage of aWorkingSet
in the database without committing (or reverting) it beforehand.Linked Issues
Testing
All relevant tests ware updated.
Docs
Updated docs for
WorkingSet & CommittedWorkingSet