solana: Duplicate signature detection is probably slow and unnecessary

Problem

Validators discard duplicate transactions by caching recent transaction signatures. Because validators can’t be expected to cache every signature since genesis, validators require clients include a recent blockhash in each transaction. The validators then organize signatures by block and discard old batches as new ones roll in. The process is burdensome to clients, costly for validators, and requires a 32-byte blockhash in each transaction, a place where every bit affects TPS.

Proposed Solution

Inspired by Libra’s resource sequence numbers, we use the Account.data of each user account to store a sequence number. The client would then include the sequence number of the account corresponding to key0, the user account paying the transaction fee. Validators would discard any transactions with a mismatched sequence number, and otherwise execute the transaction and increment the sequence number.

cc: #2497 tag: @aeyakovenko, @sakridge

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 20 (20 by maintainers)

Most upvoted comments

  • “The process is burdensome to clients” - The proposal adds a higher burden on clients. This forces clients to be synchronous with the account state before a transaction is created.
  • 32 bytes savings will only improve TPS when we are at that bottleneck. Ripemd-160 is an easy option to save 12 bytes.