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

Proposal: Conflict-Resistant Sequence Numbers #168

Open
tzakian opened this issue Apr 20, 2021 · 3 comments
Open

Proposal: Conflict-Resistant Sequence Numbers #168

tzakian opened this issue Apr 20, 2021 · 3 comments
Assignees

Comments

@tzakian
Copy link
Contributor

tzakian commented Apr 20, 2021

Sequence numbers today provide a simple mechanism to prevent transactions from being replayed — only a single transaction can ever be processed for a given sequence number/account combination. Additionally, the sequence number provides a way of enforcing sequentiality; a sender can send transactions with sequence numbers 0, 1, 2, and 3 to the network in any order since the sender knows that 1 can only be processed after 0, 2 after 1, etc.

However, sequence numbers today present issues due to sequence number lockup: once a transaction at a given sequence number n is chosen, the sending account will block on being able to process other transactions with sequence numbers greater than n until that transaction has been processed. This issue has cropped up in multiple places so far, and in general will be an issue when any off-chain activity related to signing a full transaction is being considered.

In general we have observed a theme here with sequence numbers: they prevent replays, and ensure strict sequentiality, however this “strict sequentiality” presents serious usability issues in off-chain protocols. This proposal would introduce the idea of a Conflict-Resistant Sequence Number (CRSN) that relaxes this strict sequentiality to allow concurrent processing of transactions while also allowing some level of dependency between transactions sent by the same account to be expressed.

CRSNs would work at the account level and would be an opt-in feature. No breaking changes would be needed to Diem data structures as the transaction's sequence_number field can be reused.

@aching
Copy link
Contributor

aching commented May 3, 2021

Sounds good @tzakian, would be happy to be DIP manager for such a proposal.

@aching aching self-assigned this May 3, 2021
@tzakian
Copy link
Contributor Author

tzakian commented May 13, 2021

Thanks @aching! That sounds great :) Initial DIP PR for this proposal can be found here: #170

@aching
Copy link
Contributor

aching commented Jun 23, 2021

Draft has been approved. Looking forward to feedback from the community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants