Skip to content

Conversation

@heifner
Copy link
Contributor

@heifner heifner commented Jan 14, 2026

Summary

WIRE-195

This PR implements a transaction priority system, allowing sysio system contract to configure custom priorities (increase or decrease) for transactions based on their actions.

Changes

System Contract (sysio.system)

  • Added transaction priority table and actions (contracts/sysio.system/include/sysio.system/trx_priority.hpp, contracts/sysio.system/src/trx_priority.cpp)
    • trxpriority table: Stores priority configurations with receiver, action name, match type, and priority value
    • trxpglobal singleton: Tracks last update timestamp for cache invalidation
    • addtrxp action: Register new transaction priority rules (requires system authority)
    • deltrxp action: Remove existing priority rules (requires system authority)
    • Supports three match types:
      • only: Matches transactions with exactly one action
      • first: Matches the first action in a transaction
      • any: Matches any action in a transaction
    • Priority range: -32,768 to 32,767 (negative values deprioritize below default)

Producer Plugin

  • Added trx_priority_db component (plugins/producer_plugin/include/sysio/producer_plugin/trx_priority_db.hpp, plugins/producer_plugin/src/trx_priority_db.cpp)
    • Thread-safe database for retrieving transaction priorities
    • Automatically refreshes from system contract table every 1000 blocks on LIB signal
    • Efficient lookup using flat_multimap indexed by receiver account
    • Implements priority matching logic with exact action name precedence over wildcards
    • 30ms timeout for deserialization to prevent blocking

When merged with #163 the priority values will not interfere with non-trx priority tasks. Requires #163.

@heifner heifner changed the title Feature/trx priority Transaction Priority System Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants