@proto-kit/sequencer • Docs
Documentation / @proto-kit/sequencer / DefaultMempoolSorting
Class: DefaultMempoolSorting
Lifecycle of a SequencerModule
start(): Executed to execute any logic required to start the module
Extends
Implements
Constructors
new DefaultMempoolSorting()
new DefaultMempoolSorting():
DefaultMempoolSorting
Returns
Inherited from
Properties
currentConfig
protectedcurrentConfig:undefined|NoConfig
Store the config separately, so that we can apply additional checks when retrieving it via the getter
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:17
presets
staticpresets:Presets<unknown> ={}
Inherited from
Defined in
packages/sequencer/src/sequencer/builder/SequencerModule.ts:20
Accessors
config
Get Signature
get config():
Config
Returns
Config
Set Signature
set config(
config):void
Parameters
• config: Config
Returns
void
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:18
Methods
create()
create(
childContainerProvider):void
Parameters
• childContainerProvider: ChildContainerProvider
Returns
void
Inherited from
Defined in
packages/common/dist/config/ConfigurableModule.d.ts:20
enablePostSorting()
enablePostSorting():
boolean
Indicate whether to do pre-sorting (as it’s expensive depending on your block size)
Returns
boolean
Implementation of
MempoolSorting.enablePostSorting
Defined in
packages/sequencer/src/mempool/sorting/DefaultMempoolSorting.ts:20
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
Implementation of
Defined in
packages/sequencer/src/mempool/sorting/DefaultMempoolSorting.ts:24
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)
Implementation of
MempoolSorting.presortingPriority
Defined in
packages/sequencer/src/mempool/sorting/DefaultMempoolSorting.ts:28
start()
start():
Promise<void>
Start the module and all it’s functionality. The returned Promise has to resolve after initialization, since it will block in the sequencer init. That means that you mustn’t await server.start() for example.
Returns
Promise<void>
Overrides
Defined in
packages/sequencer/src/mempool/sorting/DefaultMempoolSorting.ts:16