aptos-core
aptos-core copied to clipboard
[vm] Delta writes in sequential execution
Description
Slightly refactored delta operations so that Aggregator
1) can reuse apply_to
functionality based on operation 2) can reuse unique serialization/deserialization for delta op values (This way it should also be easier to extract these deltas to ChangeSet
, etc.). Added tests.
Implemented delta application for sequential execution. @gelash @zekun000 I am looking for a place to put tests in the form of a) generate writeset with deltas b) apply with fake executor / fake data store c) check result of application and/or VM status. I suppose e2e-tests/src/executor.rs
might be the best place for that? Or a separate file?
Test Plan
- [x] Unit tests
- [ ] Fake executor tests
@davidiw Speaking about unreachable: there are 3 places where this is the case:
- transaction replay: we match by
AccessPath
and since we don't use it for aggregator's state key - should never be exposed. - in
try_access_path_into_write_set_change
andtry_table_item_into_write_set_change
- again,AccessPath
is never used for aggregator. - In
InMemoryStateCalculator
: this is used for storage and deltas should be converted by then.
I agree that this is not nice but at least it allows to proceed with implementation on executor side (and we not cresting deltas just yet anywhere, so fine for now?). I am working on moving this to ChangeSet
or TransactionOutput
(separate delta set) in parallel.
Will be rebasing this on https://github.com/aptos-labs/aptos-core/pull/2222.
TODOs: prologue/epilogue