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
[Executor] Unify views used for block execution #5731
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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 is very confusing to me, there're so many similar things with slightly different names, we probably can find a better way.
there're StateView vs DataView, the only difference I can tell is that StateView hardcoded the StateKey, I'd rather unify them to just support a generic key.
there're VersionedView and AptosVersionedView, I'm not sure I understand why we need AptosVersionedView instead of just impl StateView for VersionedView.
Yes, it's really ugly, we should definitely improve. I needed some ideas. @zekun000: do you think it's actually okay to support generic key in StateView itself? I thought it's used everywhere but now I see it's actually not, mainly an aptos-move construct. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
1bc9df6
to
2acca0f
Compare
Comments must be addressed - all ugly wrappers are gone and StateView is now generic on key. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Unfortunately the problem here would be a circular dependency between AptosVM and block_executor. We have to work it out at some point, but not clear if it's within easy refactoring reach yet. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
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.
Thanks for refactoring!
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
✅ Forge suite
|
✅ Forge suite
|
This makes the interface difference between sequential and parallel execution an implementation detail of block executor.
It's better to be an implementation detail, for example tomorrow we could delete sequential execution altogether and run parallel with 1 thread (thought experiment, I'm not proposing we do this), and outside world would not need to care.
Other benefits:
(0) Ability to access storage values from block_executor - before this was only possible in the wrapper, that would find data by combining view from the block with data from storage (depending on statekey). Having access to storage values is important e.g. to resolve aggregator deltas more efficiently, and to not expose delta_resolver to the wrapper - but this is coming next as a separate PR (see b423013)
(1) no more ugly leaky interfaces like execute_mvhashmap_view and execute_btreemap view
(2) delete unused StateViewCache only used in tests as a move resolver, instead resolve directly
(3) delete VersionedView from the wrapper, instead provide wrapping view implementations at one place inside block_executor (view.rs)