-
Notifications
You must be signed in to change notification settings - Fork 3
Mempool
Mempool is pool of pending transactions posted by users to the core node. It's a waiting queue of transactions until block creation event happen.
No | Field | Type | Note |
---|---|---|---|
0 | id | Int64 | |
1 | fee_per_byte | Int64 | |
2 | arrival_timestamp | Int64 | |
3 | transaction_bytes | []Byte | |
4 | sender_account_address | []Byte | *extra |
5 | recipient_account_address | []Byte | *extra |
6 | block_height | Uint32 |
*extra: sender and recipient information are already in transaction_bytes, but having duplicated those information help in querying the pending transactions from user perspective.
On block creation transaction that the node wants to include to the block will be selected from this table, parse the transaction_bytes
to Transaction
object, and cast into its Transaction Type.
There are a few basic rules applied to (default) transaction selection from mempool.
-
Node check for transaction expiration (1 hour) from arrival timestamp to selection time.
-
Node parse and cast the
transaction_bytes
and validate that it's a valid transaction, this will keep the node away from broadcasting false transactions. -
Every transaction type will be able to implement a custom
SkipMempoolTransaction()
method to flag if transaction can be included in mempool selection or vice-versa. This allow for complex inter-transactionType restriction implementation.TODO: ADD_EXAMPLE