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

SIMD-0165: Async Vote Execution #165

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8bce07a
Initial draft of Async Vote Execution SIMD.
wen-coding Aug 12, 2024
74f3a33
Change SIMD number.
wen-coding Aug 12, 2024
4b50153
Make linter happy.
wen-coding Aug 12, 2024
a8aad6c
Make linter happy.
wen-coding Aug 16, 2024
55fae1d
Update the plan for clock calculation.
wen-coding Aug 26, 2024
ca682d7
Update the proposal to reflect optimistic vote execution plan we disc…
wen-coding Sep 19, 2024
93b2506
Update dash to asterisk.
wen-coding Sep 19, 2024
a78f256
Rename VED and UED hash to Ephemeral and Final hash.
wen-coding Sep 20, 2024
67a1f45
Change title to reflect that we calculate Ephemeral hash.
wen-coding Sep 20, 2024
e38b645
Explain the checks we will perform during ephemeral hash computation.
wen-coding Sep 27, 2024
7dd9801
Add new fields in TowerSync.
wen-coding Sep 27, 2024
60a66af
Update that which block (slot, hash) on the vote transaction is.
wen-coding Sep 27, 2024
5432353
Clarify that new votes should be sent out when either hash changes.
wen-coding Sep 27, 2024
40d4be6
Propose to halt and exit if >1/3 disagrees on final bankhash.
wen-coding Oct 25, 2024
1b3ed81
Change status to Idea.
wen-coding Oct 25, 2024
4e83392
Update calculation of vote only hash and others.
wen-coding Nov 28, 2024
35ec617
Fix some small problems.
wen-coding Dec 11, 2024
93372ea
Address review comments.
wen-coding Dec 11, 2024
7daaf7a
Specify the hash function used.
wen-coding Dec 12, 2024
b7fc403
Clarify the set root error.
wen-coding Dec 12, 2024
f4278f4
Set root will not cause the block to be marked dead.
wen-coding Dec 12, 2024
7b3de13
Add the user visible changes section.
wen-coding Dec 12, 2024
8ac7180
Clarify we only use vote only hash in fork selection.
wen-coding Dec 12, 2024
437d66d
EpochSlots should be updated when banks are vote only frozen.
wen-coding Dec 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change SIMD number.
wen-coding committed Aug 12, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 74f3a3326ca4a3526edf733a1d85a3b049bc40eb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
simd: '0154'
simd: '0165'
title: Async Vote Execution
authors:
- Wen Xu
@@ -12,12 +12,12 @@
superseded-by: null
extends: null
---
## Summary

Check failure on line 15 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Summary"]

proposals/0165-async-vote-execution.md:15 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Summary"]
Separate the execution of vote and non-vote transactions in each block. The
vote transactions will be verified and executed first, then the non-vote
transactions will be executed later asynchronously to finalize the block.

## Motivation

Check failure on line 20 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Motivation"]

proposals/0165-async-vote-execution.md:20 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## Motivation"]
Currently the vote transactions and non-vote transactions are mixed together in
a block, the vote transactions are only processed in consensus when the whole
block has been frozen and all transactions in the block have been verified and
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: votes are processed per entry batch, doesn't have to wait for the bank to be frozen. as a result we still partially process votes even if the block later ends up dead.
e.g. agave's impl https://github.com/anza-xyz/agave/blob/1f06fbdbe3b72f330f50ad93a15c1116f5021392/ledger/src/blockstore_processor.rs#L177

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, now I think about it, it's less about processing votes as fast as possible, more about a lot of things don't happen until the block is frozen, changes this part.

@@ -41,8 +41,8 @@
hard to make sure everyone executes every block within 400ms, on average majority
of the cluster should be able to keep up.

## New Terminology

Check failure on line 44 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## New Terminology"]

proposals/0165-async-vote-execution.md:44 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "## New Terminology"]
- `VED`: Vote Execution Domain, Vote transactions and all its dependencies (e.g.

Check failure on line 45 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "- `VED`: Vote Execution Domain..."]

proposals/0165-async-vote-execution.md:45 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- `VED`: Vote Execution Domain..."]
fee payers for votes).
- `VED Bankhash`: The hash calculated after executing only vote transactions in
a block. If there are no votes, use default hash.
@@ -53,7 +53,7 @@

## Detailed Design

### Allow leader to skip execution of transactions (Bankless Leader)

Check failure on line 56 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Allow leader to skip execution of transactions (Bankless Leader)"]

proposals/0165-async-vote-execution.md:56 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Allow leader to skip execution of transactions (Bankless Leader)"]
There is already on-going effort to totally skip execution of all transactions
when leader pack new blocks. See SIMD 82, SIMD 83, and related trackers:
https://github.com/anza-xyz/agave/issues/2502
@@ -64,11 +64,11 @@
such a setup we gain smaller speedup without much benefits, it is a possible
route during rollouts though.

### Separating vote transactions and dependencies into a different domain

Check failure on line 67 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Separating vote transactions and dependencies into a different domain"]

proposals/0165-async-vote-execution.md:67 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Separating vote transactions and dependencies into a different domain"]
To make sure vote transactions can be executed independently, we need to
isolate its dependencies.

#### Remove clock program's dependency on votes

Check failure on line 71 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### Remove clock program's dependency on votes"]

proposals/0165-async-vote-execution.md:71 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### Remove clock program's dependency on votes"]
Introduce new transaction `ClockBump` to remove current clock program's
dependency on votes.

@@ -76,17 +76,17 @@
every 12 slots to correct the clock drift. A small script can be used to
refund well-behaving leaders the cost of the transactions.

#### Split vote accounts into two accounts in VED and UED respectively

Check failure on line 79 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### Split vote accounts into two accounts in VED and UED respectively"]

proposals/0165-async-vote-execution.md:79 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "#### Split vote accounts into two accounts in VED and UED respectively"]
We need to allow users move money in and out of the vote accounts, but
we also need the vote accounts to vote in VED. So there will be two accounts:
- `VoteTowerAccount`: tracks tower state and vote authority, it will be

Check failure on line 82 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "- `VoteTowerAccount`: tracks t..."]

proposals/0165-async-vote-execution.md:82 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "- `VoteTowerAccount`: tracks t..."]
in `VED`, it is updated by vote transactions and tracks vote credits.
- `VoteAccount`: everything else currently in vote accounts, it will be
in `UED`, users can move funds in and out of `VoteAccount` freely.

The two accounts are synced every Epoch when the rewards are calculated.

### Separate the VED and UED Domains

Check failure on line 89 in proposals/0165-async-vote-execution.md

GitHub Actions / Markdown Linter

Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Separate the VED and UED Domains"]

proposals/0165-async-vote-execution.md:89 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [Context: "### Separate the VED and UED Domains"]
- Only Vote or System program can read and write accounts in `VED`
- Other programs can only read accounts in `VED`
- Users can't directly access accounts in `VED` but they can move accounts