refactor: remove SimpleMemoryStorage and refactor DAA #1026
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In previous PRs, in order to implement Multiprocess Verification, we were going to use a class abstraction over the
TransactionStorage
, aSimpleMemoryStorage
. This was becoming convoluted in later PRs, especially considering Sync-V2 agents will also have their own local memory storages.The abstraction had to include several methods to comply with all callers, however each caller only used a few of them. In other words, the abstraction was too heavy and unnecessary. Therefore, we cancelled that approach and went with a functional abstraction instead. This PR applies that refactor to DAA. Its methods are are now higher-order functions, accepting functional parameters to perform their calculations, instead of a storage. This abstraction is way lighter and more flexible, as now methods explicitly require specific functions, not a bloated class, and callers can provide those functions from whichever object they need.
This PR essentially reverts PR #895, and was initially implemented as part of the Multiprocess Verification project in PR #1022. This change was advanced to now because it undoes significant performance losses introduced by
clone()
calls in theSimpleMemoryStorage
, that is not going to be used anymore — the sync process will become much quicker, as it was before #895. The removal of the storage dependency from the block verification process is kept in #1022.Acceptance Criteria
SimpleMemoryStorage
.VertexVerifier
.Checklist
master
, confirm this code is production-ready and can be included in future releases as soon as it gets merged