-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Add rollback support to accountant #84
Milestone
Comments
garious
added a commit
that referenced
this issue
Mar 29, 2018
Diagram for what's described in #84 for rollback support.
Removed the v0.7.0 milestone because we came up with a simpler, albeit slower, mechanism for rollback described in #310. We can revisit this one a little later. |
@rob-solana, this was the old ticket for rollback. Feel free to close it if it's now a duplicate. |
wow! blast from the past. covered in #1426 |
vkomenda
pushed a commit
to vkomenda/solana
that referenced
this issue
Aug 29, 2021
* Remove initialize signers * update js to do initialize atomically
wen-coding
pushed a commit
to wen-coding/solana
that referenced
this issue
Mar 15, 2024
willhickey
pushed a commit
that referenced
this issue
Mar 16, 2024
segfaultdoc
pushed a commit
to jito-labs/solana
that referenced
this issue
Aug 7, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First some background. The accountant currently maintains two hash tables, a map of public keys to balances, and a map of pending transaction IDs (signatures) to spending plans:
When a new transaction enters the system, here's what happens:
from
balance is updated (balances[txn.from] -= txn.tokens
)pending
map and will wait for any witnesses its spending plan requires.Once the it has the needed witnesses and the spending plan is reduced to a
Payment
, it is removed from the map andbalances
is updated (balances[payment.to] += payment.tokens
).The problem here is that we're making updates to both
balances
andpending
before the transaction has been finalized. Instead, the Accountant state should be broken up into at least two pieces, a finalized state and at least one unverified block state. Note this is the first time we've used the term block. It means, "a set of transactions that are verified together." Also, we say "at least" so that the leader can optimistically start work on a second unverified block while the first has been submitted for verification. In fact, depending on how long verification takes, it's not unreasonable to imagine the Accountant maintaining a long queue of unverified blocks.Once a block has been verified by at least 2/3 of the verifiers, the block state should be merged into the finalized state. We say the block state is coalesced. The reason to coalesce is to save memory and redundant computation, and it can only be done after the block has been finalized.
So what does it mean to support rollback? At a high-level, it means the system state rolls back to an earlier point in time. In this architecture, it means that unverified blocks and associated state are simply discarded and never coalesced.
The text was updated successfully, but these errors were encountered: