-
Notifications
You must be signed in to change notification settings - Fork 5
sip-201 #26
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
Open
sanlee42
wants to merge
1
commit into
master
Choose a base branch
from
sip-201
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
sip-201 #26
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| * SIP-201: DAG-based Execution for Consistent Account States | ||
| ** Abstract | ||
| This proposal introduces a DAG-based execution model for Starcoin to address | ||
| concurrency conflicts that arise when applying a DAG structure to its account-based, | ||
| Move-VM-enabled PoW blockchain. By leveraging sequence numbers, topological | ||
| sorting, and conflict filtering,The model maintains execution consistency by limiting | ||
| parallelism within accounts, while enabling concurrency across unrelated transactions. | ||
|
|
||
| ** Motivation | ||
| Starcoin adopts an account-based execution model with a Move VM on top of a PoW | ||
| consensus. Introducing a DAG structure improves block-level concurrency, but exposes | ||
| conflicts during transaction execution due to shared account state and sequential | ||
| semantics in the VM. Unlike UTXO-based systems where parallelism is natural, account | ||
| models require additional constraints to preserve consistency. This proposal aims to | ||
| resolve these execution-layer conflicts in a minimal and practical way. | ||
|
|
||
| It changes the meaning of "transactions in a block" from a linear list to a | ||
| DAG-resolved execution view, reflecting dependencies across multiple blocks. | ||
|
|
||
| ** Proposal | ||
|
|
||
| 1. **Sequence Number Preservation** | ||
| Starcoin already enforces sequence numbers per account to maintain transaction | ||
| order. In the DAG context, this mechanism is reused to preserve intra-account | ||
| consistency during parallel execution, without introducing additional global | ||
| coordination. | ||
|
|
||
| 2. **Topological Execution via FlexiDAG** | ||
| Transactions across blocks are executed in topological order derived from | ||
| FlexiDAG (a GHOSTDAG variant adapted for account-based VM models), ensuring | ||
| correct inter-block and inter-account dependency resolution. | ||
|
|
||
| 3. **Pre-execution Conflict Filtering** | ||
| Before execution, transactions from blue blocks and the txpool are checked for | ||
| conflicts, such as mismatched sequence numbers or overlapping resource access. | ||
| Invalid transactions are skipped and retained in the pool. | ||
|
|
||
| 4. **State Root Finalization and Block Assembly** | ||
| Execution begins from the selected parent’s state root. The new block commits | ||
| the resulting state root and includes both executed blue block transactions and | ||
| non-conflicting transactions from the txpool. | ||
|
|
||
| ** Block Structure Changes | ||
| The block structure is modified as follows to support **DAG-based** execution: | ||
|
|
||
| 1. **Blue Blocks in Block Header** | ||
| The set of selected transactions (blue blocks) is included in the block header | ||
| to record the executed transactions and their dependencies. | ||
|
|
||
| 2. **Transactions in Block Body** | ||
| The block body contains both transactions from the transaction pool and the | ||
| blue blocks. Only non-conflicting transactions are included. | ||
|
|
||
| ** Future Work | ||
| Future optimizations will focus on removing the sequence number control, enabling | ||
| full parallelism in transaction execution. The transition to a **resource-based** | ||
| execution model will allow for fine-grained state management, improving scalability | ||
| and efficiency by fully decoupling transaction dependencies and enabling complete concurrency. | ||
|
|
||
|
|
||
| ** Conclusion | ||
| This design achieves consistent parallel execution in an account-based DAG chain | ||
| with minimal changes to the existing system. The core idea lies in shifting the | ||
| semantic interpretation of a block's transactions from linear execution to a | ||
| DAG-resolved, dependency-aware context, without altering the underlying VM or transaction format. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the SIP number inconsistency
The PR adds a file named
sip-201/_index.orgbut references it as SIP-24 in the index. This creates a mismatch between the directory name and the SIP number that could lead to confusion and broken links.Apply this diff to align the SIP number with the directory name:
Alternatively, if SIP-24 is the intended number, rename the directory from
sip-201tosip-24.📝 Committable suggestion
🤖 Prompt for AI Agents