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

[vm] Separation of resources, modules and aggregators #9256

Merged
merged 15 commits into from
Aug 1, 2023

Conversation

georgemitenkov
Copy link
Contributor

@georgemitenkov georgemitenkov commented Jul 23, 2023

Description

TLDR; Cherrypicks some changes from #8227.

Motivation:
In Move VM we know what is a resource, what is a module. On top of
that adapter has aggregators. All these are merged in a single WriteSet.

Now, we split write sets into 3:

  1. Resources
  2. Modules
  3. Aggregators

Why this is good:

  1. Allows for better APIs in the future ti query different types, e.g. Move
    values or compiled module.
  2. Aligns with mvhashmap having 3 different paths for resources, modules
    and aggregators.
  3. No need to deserialize the state key to understand if this is code or not.
  4. Aggregator write sets can be just u128, no need to have an actual WriteOp!
    (Note that this PR does not add this)
  5. No need for WriteSetMut, etc. and other storage abstractions.

Test Plan

@gelash gelash requested review from zekun000 and removed request for zekun000 July 26, 2023 23:50
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Show resolved Hide resolved
/// A useful method to iterate over all writes.
/// TODO(aggregator): With Aggregator V2, we would have to revisit this
/// because we no longer iterate over state items.
pub fn write_set_iter(&self) -> impl Iterator<Item = (&StateKey, &WriteOp)> {
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make sure someone with a sense of what's acceptable in the codebase looks at it xD @zekun000 ?

Copy link
Contributor

Choose a reason for hiding this comment

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

looks beautiful

aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@ziaptos ziaptos left a comment

Choose a reason for hiding this comment

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

Minor contribution from me from now (as I don't know a lot of background details).

A general comment is to try to avoid unnecessary and redundant comments - that makes maintaining the code harder in the future (one has to change both)

aptos-move/aptos-aggregator/src/delta_change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/output.rs Outdated Show resolved Hide resolved
aptos-move/block-executor/src/proptest_types/baseline.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@igor-aptos igor-aptos left a comment

Choose a reason for hiding this comment

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

there are bunch of comments marked resolved, but code not yet changed - do you have some pending code locally to update the PR with?
requesting changes for you to update the PR with that code.

aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm-types/src/output.rs Outdated Show resolved Hide resolved
aptos-move/block-executor/src/executor.rs Outdated Show resolved Hide resolved
@georgemitenkov georgemitenkov added the CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR label Jul 27, 2023
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

/// A useful method to iterate over all writes.
/// TODO(aggregator): With Aggregator V2, we would have to revisit this
/// because we no longer iterate over state items.
pub fn write_set_iter(&self) -> impl Iterator<Item = (&StateKey, &WriteOp)> {
Copy link
Contributor

Choose a reason for hiding this comment

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

looks beautiful

aptos-move/aptos-vm-types/src/change_set.rs Outdated Show resolved Hide resolved
aptos-move/aptos-vm/src/move_vm_ext/respawned_session.rs Outdated Show resolved Hide resolved
aptos-move/block-executor/src/executor.rs Outdated Show resolved Hide resolved
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

✅ Forge suite compat success on aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155

Compatibility test results for aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155 (PR)
1. Check liveness of validators at old version: aptos-node-v1.5.1
compatibility::simple-validator-upgrade::liveness-check : committed: 4703 txn/s, latency: 7038 ms, (p50: 7500 ms, p90: 9900 ms, p99: 10500 ms), latency samples: 169340
2. Upgrading first Validator to new version: 24272e9f77ea778cf3b3e28b2aef0fd5c506c155
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 1855 txn/s, latency: 15882 ms, (p50: 18400 ms, p90: 22300 ms, p99: 22600 ms), latency samples: 92760
3. Upgrading rest of first batch to new version: 24272e9f77ea778cf3b3e28b2aef0fd5c506c155
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 1780 txn/s, latency: 15736 ms, (p50: 18900 ms, p90: 21900 ms, p99: 22600 ms), latency samples: 92600
4. upgrading second batch to new version: 24272e9f77ea778cf3b3e28b2aef0fd5c506c155
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 3276 txn/s, latency: 9634 ms, (p50: 10200 ms, p90: 13300 ms, p99: 14000 ms), latency samples: 140880
5. check swarm health
Compatibility test for aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155 passed
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

✅ Forge suite realistic_env_max_load success on 24272e9f77ea778cf3b3e28b2aef0fd5c506c155

two traffics test: inner traffic : committed: 6614 txn/s, latency: 5903 ms, (p50: 5400 ms, p90: 7800 ms, p99: 16900 ms), latency samples: 2870480
two traffics test : committed: 100 txn/s, latency: 3190 ms, (p50: 3100 ms, p90: 3800 ms, p99: 7700 ms), latency samples: 1740
Max round gap was 1 [limit 4] at version 1454310. Max no progress secs was 5.314948 [limit 10] at version 1454310.
Test Ok

@github-actions
Copy link
Contributor

github-actions bot commented Aug 1, 2023

✅ Forge suite framework_upgrade success on aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155

Compatibility test results for aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155 (PR)
Upgrade the nodes to version: 24272e9f77ea778cf3b3e28b2aef0fd5c506c155
framework_upgrade::framework-upgrade::full-framework-upgrade : committed: 3052 txn/s, latency: 7180 ms, (p50: 7500 ms, p90: 10200 ms, p99: 15100 ms), latency samples: 167900
5. check swarm health
Compatibility test for aptos-node-v1.5.1 ==> 24272e9f77ea778cf3b3e28b2aef0fd5c506c155 passed
Test Ok

@georgemitenkov georgemitenkov merged commit 137acee into main Aug 1, 2023
46 checks passed
@georgemitenkov georgemitenkov deleted the george/split-writes branch August 1, 2023 08:40
gedigi pushed a commit that referenced this pull request Aug 2, 2023
TLDR; Cherrypicks some changes from #8227.

In Move VM we know what is a resource, what is a module. On top of
that adapter has aggregators. All these have been merged into a single
`WriteSet` previously.

Now, we split write sets into 3:
- Resources
- Modules
- Aggregators

As a result, the code was cleaned-up.
xbtmatt pushed a commit that referenced this pull request Aug 13, 2023
TLDR; Cherrypicks some changes from #8227.

In Move VM we know what is a resource, what is a module. On top of
that adapter has aggregators. All these have been merged into a single
`WriteSet` previously.

Now, we split write sets into 3:
- Resources
- Modules
- Aggregators

As a result, the code was cleaned-up.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants