-
Notifications
You must be signed in to change notification settings - Fork 754
Open
0 / 20 of 2 issues completedLabels
Description
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).