Disable sequence number check

Hi

Context: I am porting Move VM on a different consensus protocol.

In my consensus protocol, the transactions are not always execute in the ordered they were generated and hence I wanted to disable checking if transaction sequence numbers are increasing monotonically? How shall I do this?

Thanks in advance!

2 Likes

Hi Vivek,

These checks are performed in the “transaction prologue” (Move code that is invoked before executing a transaction) here. If you eliminate the checks from LibraAccount (perhaps you want to eliminate the sequence_number field from accounts/transactions altogether in that case?), that should fix your problem.

I’m guessing you already know this/have it covered, but just in case:
Replay protection for Libra transaction is based on sequence numbers, so you’ll need your own mechanism for replay protection if you want to get rid of this one.

4 Likes

Hi Sam

Thanks a lot for the quick reply. Disabling it from [here] (https://github.com/libra/libra/blob/master/language/stdlib/modules/libra_account.move#L468&L470), should hopefully do the job for now. We plan to keep the sequence_number and provide protection against replay attack in a different way.

3 Likes

Great! I should add: just commenting out the Move code isn’t enough; you must also recompile (cargo run under stdlib) and regenerate the genesis blob (cargo run under tools/vm-genesis).

2 Likes