algorand / go-algorand

Algorand's official implementation in Go.
https://developer.algorand.org/
Other
1.34k stars 468 forks source link

txHandler: park early transactions instead of dropping them #5626

Closed algorandskiy closed 1 year ago

algorandskiy commented 1 year ago

Summary

Consider a situation when a node is milliseconds, seconds, or a round ahead of its neighbors. In this case it could submit a transaction that a round earlier than the transaction pool expects on a neighbor node so it would be rejected and silently dropped.

To prevent, txHandler might have a (circular) buffer 1-2-3 rounds long with transactions that arrived too early and can be re-injected to the backlog queue. Consider random injection to prevent frontrunning opportunities.

Acceptance

  1. Unit tests
  2. e2e test: send txn current+2 and expect it committed
algonautshant commented 1 year ago

I can understand 1 round difference. But why "1-2-3"?

jsgranados commented 1 year ago

This situation seems like user error, and should be properly handled by the SDK's