Skip to main content

Transaction Processor (learnway-transaction-processor/)

The LearnWay Transaction Processor is the backend’s dedicated blockchain relayer. It processes, signs, queues, and submits all platform-driven smart contract transactions (LearnWayManager, XPContract, GemContract, BadgesNFT, CertificatesNFT) on Lisk L2.

Relayer Architecture & Flow


Key Modules & Responsibilities

1. Interacting with LearnWayManager.sol

  • Submits atomic administrative transactions:
    • Awarding XP and Gems upon lesson or battle completion.
    • Distributing contest and tournament prize pools.
    • Minting ERC-721 milestone badges and ERC-1155 course certificates.

2. High-Concurrency Nonce Management

  • Uses atomic Redis locks per relayer address to eliminate nonce collisions (nonce too low or replacement transaction underpriced).
  • Automatically resynchronizes nonces against Lisk L2 RPC nodes in case of process restarts.

3. Automated 15-Second Gas Escalation

  • Actively monitors transaction receipts on Lisk L2.
  • If a transaction is unconfirmed after 15 seconds, the relayer bumps maxPriorityFeePerGas by 15% and re-broadcasts with the exact same nonce to ensure sub-minute finality.

4. Architectural Separation

  • learnway-transaction-processor: Dedicated exclusively to backend-relayed platform contract executions on LearnWayManager.
  • ERC-4337 Account Abstraction (/alto): Dedicated exclusively to mobile client user operations.