@proto-kit/sequencerDocs


Documentation / @proto-kit/sequencer / MempoolSorting

Interface: MempoolSorting

Methods

enablePostSorting()

enablePostSorting(): boolean

Indicate whether to do pre-sorting (as it’s expensive depending on your block size)

Returns

boolean

Defined in

packages/sequencer/src/mempool/sorting/MempoolSorting.ts:19


postSorting()

postSorting(transactions): PendingTransaction[]

Postsorting happens on the sequencer-side. It’s less fast but can take in any two transactions and directly compare them based on arbitrary logic

Parameters

transactions: PendingTransaction[]

Returns

PendingTransaction[]

Defined in

packages/sequencer/src/mempool/sorting/MempoolSorting.ts:25


presortingPriority()

presortingPriority(tx): number

Presorting happens on the backend (i.e. the DB), before the data travels to the sequencer. It’s very fast, but limited to only integer sorting. The value returned here has to be static per transaction, since it will be sorted and compared on the DB-side.

Parameters

tx: PendingTransaction

Returns

number

Priority of the transaction - larger is better (therefore will be put in the block first)

Defined in

packages/sequencer/src/mempool/sorting/MempoolSorting.ts:14