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

[execution window] use blocking txn provider #14584

Draft
wants to merge 1 commit into
base: brian/exec-window-exec-base
Choose a base branch
from

Conversation

bchocho
Copy link
Contributor

@bchocho bchocho commented Sep 10, 2024

Description

Optimizes the prepare and execute stages for better performance for larger block windows. Mostly the optimizations are reducing the computation per transaction or number of transactions that have to be touched.

Prepare:

  • Return an Arc of cached batches, and lazily flatten the block to vector of transactions to avoid unnecessary clones.
  • Re-sort the batches by gas bucket (as a stable sort, to maintain relative order).
  • Filter out already committed transactions. Uses the cached per-pipelined block of committed hashes. Except for the most recent block in the window.
  • Move block shuffle to execute stage.

Execute:

  • Filter out already committed transactions from the latest recent block in the window.
  • Do block shuffle using a BlockingTxnProvider; the shuffler incrementally writes shuffled transactions and execution reads the shuffle transactions (blocking if not yet available).

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Other (specify)

How Has This Been Tested?

Key Areas to Review

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Sep 10, 2024

⏱️ 5h 28m total CI duration on this PR
Slowest 15 Jobs Cumulative Duration Recent Runs
forge-e2e-test / forge 3h 50m 🟥🟥🟥🟥 (+2 more)
test-target-determinator 26m 🟩🟩🟩🟩
rust-images / rust-all 14m 🟩
rust-move-tests 8m 🟩
rust-move-tests 8m 🟥
rust-cargo-deny 8m 🟩🟩🟩🟩
rust-move-tests 8m 🟩
general-lints 7m 🟩🟩🟩🟩
check-dynamic-deps 7m 🟩🟩🟩🟩🟩 (+2 more)
rust-move-tests 5m 🟥
semgrep/ci 2m 🟩🟩🟩🟩🟩
file_change_determinator 53s 🟩🟩🟩🟩
file_change_determinator 48s 🟩🟩🟩🟩
file_change_determinator 46s 🟩🟩🟩🟩
permission-check 19s 🟩🟩🟩🟩🟩

settingsfeedbackdocs ⋅ learn more about trunk.io

@bchocho bchocho added the CICD:run-forge-e2e-perf Run the e2e perf forge only label Sep 10, 2024

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.

@bchocho bchocho changed the title Brian/exec window exec optimize 2 [execution window] optimized 2 Sep 11, 2024

This comment has been minimized.

This comment has been minimized.

@bchocho bchocho force-pushed the brian/exec-window-exec-optimize branch from 16da500 to 893fde7 Compare September 25, 2024 17:27
@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from 725d66e to 3d99ab6 Compare September 26, 2024 17:00

This comment has been minimized.

This comment has been minimized.

@bchocho bchocho changed the title [execution window] optimized 2 [execution window] use blocking txn provider Sep 26, 2024
@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from 3d99ab6 to fac9a47 Compare September 30, 2024 18:41

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.

@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from 49ca098 to b3d33c6 Compare September 30, 2024 23:18

This comment has been minimized.

This comment has been minimized.

@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from 88df965 to 5b71c29 Compare October 16, 2024 18:07
@bchocho bchocho changed the base branch from brian/exec-window-exec-optimize to brian/exec-window-exec-base October 16, 2024 18:07

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.

@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from d0db51e to e395dca Compare October 17, 2024 20:36

This comment has been minimized.

This comment has been minimized.

@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch from e395dca to a3feb00 Compare October 30, 2024 18:20

This comment has been minimized.

This comment has been minimized.

@bchocho bchocho force-pushed the brian/exec-window-exec-base branch from a0f2d39 to 7fd1415 Compare October 30, 2024 19:45
@bchocho bchocho force-pushed the brian/exec-window-exec-base branch from 7fd1415 to 74de433 Compare November 22, 2024 19:06
@bchocho bchocho force-pushed the brian/exec-window-exec-optimize-2 branch 2 times, most recently from e9aff6a to 4419c21 Compare December 3, 2024 18:32

This comment has been minimized.

This comment has been minimized.

… round-1 in execution phase.

This requires using blocking txn provider to quickly provide shuffled txns in the execution phase.

Various improvements to avoid cloning transactions.
@hariria hariria force-pushed the brian/exec-window-exec-optimize-2 branch from 4419c21 to 20a72fe Compare December 18, 2024 21:28

This comment has been minimized.

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 20a72fee519e5fd2e8ba452fba7081abaae49407

two traffics test: inner traffic : committed: 14146.62 txn/s, latency: 2811.52 ms, (p50: 2700 ms, p70: 2700, p90: 3000 ms, p99: 3500 ms), latency samples: 5378880
two traffics test : committed: 100.02 txn/s, latency: 2477.10 ms, (p50: 2300 ms, p70: 2400, p90: 2700 ms, p99: 9600 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.158, avg: 0.755", "ConsensusProposalToOrdered: max: 0.318, avg: 0.298", "ConsensusOrderedToCommit: max: 0.414, avg: 0.402", "ConsensusProposalToCommit: max: 0.713, avg: 0.699"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.89s no progress at version 2763041 (avg 0.21s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 8.04s no progress at version 2763039 (avg 8.04s) [limit 15].
Test Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:build-failpoints-images Build failpoints docker image CICD:build-performance-images build performance docker image variants CICD:run-forge-e2e-perf Run the e2e perf forge only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant