Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion _index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ Starcoin Improvement Proposals
20. [JSON RPC](./sip-20)
21. [Receipt Identifier](./sip-21)
22. [NFT](./sip-22/)
23. [Oracle](./sip-23/)
23. [Oracle](./sip-23/)
24. [DAG-based Execution for Consistent Account States](./sip-201/)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue

Fix the SIP number inconsistency

The PR adds a file named sip-201/_index.org but 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:

-24. [DAG-based Execution for Consistent Account States](./sip-201/)
+201. [DAG-based Execution for Consistent Account States](./sip-201/)

Alternatively, if SIP-24 is the intended number, rename the directory from sip-201 to sip-24.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
24. [DAG-based Execution for Consistent Account States](./sip-201/)
-24. [DAG-based Execution for Consistent Account States](./sip-201/)
+201. [DAG-based Execution for Consistent Account States](./sip-201/)
🤖 Prompt for AI Agents
In the _index.md file at line 20, there is a mismatch between the SIP number
referenced (SIP-24) and the directory name (sip-201). To fix this, either update
the link text and path to use SIP-201 consistently or rename the directory from
sip-201 to sip-24 to match the reference. Ensure the SIP number in the link and
directory name are aligned to avoid confusion and broken links.

65 changes: 65 additions & 0 deletions sip-201/_index.org
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.