Skip to content

spice: Implement pending transaction queue #13586

@robin-near

Description

@robin-near

Description

  • Implement in-memory queue of pending transactions to account for pending balance on the SPICE side. The queue needs to support the following operations:
    • Add transactions from chunk: add transactions that are already included in a block by any chunk producer (possibly ourselves) to the queue
    • Check if a transaction is allowable (within a “session”): look at current queue and decide if the new transaction can be allowed given the current items of the queue and whatever’s already added to the session.
      • The allowing criteria is that the total gas spend from the transactions in the queue does not exceed the SenderReservedBalance.
      • If a transaction contains an action that decreases the SenderReservedBalance, the difference is added to the effective gas spend we account for for that transaction. (No special handling is done for when that increases.)
    • Delete transactions from chunk: called when the chunk is executed, or if the blockchain moves to a different fork (calls delete + add).

Sub-issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions