A network upgrade will be coming up toward the end of April. Currently, it is being prepared for Constantine. Phi Labs protocol core contributors will be putting up details below on the upcoming upgrade.
Upgrade Features
This upgrade adds the following features:
x/callback
This module enables CosmWasm based smart contracts to receive callbacks at the end of a desired block. This is useful for scheduling actions to happen at an expected time by reserving execution in advance.
x/cwfees
This module marks a significant advancement in how transaction fees are handled within the protocol. Any smart contract can now register itself as a feegranter and have custom logic for approving a tx for feegrant.
x/cwica
This module enables Cosmwasm based smart contracts to register ICA accounts and submit transactions to be executed on counterparty chains.
x/cwerrors
This module is the error handling mechanism for the protocol to let the contract know of errors encountered during the contract execution by the protocol. The contracts which leverage the funcationality of x/callback and x/cwica will benefit from this.
See the Full Change Log here.
Upgrade will be graduating from Titus to Constantine shortly: Mintscan
Following the testing on Constantine, ETA for mainnet upgrade proposal to go live is Thursday 25.04.2024
Please join our governance call tomorrow for further details → Discrod Event
How the existing fees model—comprising Block Reservation Fees and Future Reservation Fees—can be refined through the use of priority and delay queue data structures, and how the Priority
and ExecuteAt
attributes of callbacks can be utilized to optimize callback handling based on their context and urgency.
Refining Fees with Priority and Delay Queues
-
Dynamic Fee Adjustment Based on Queue State:
-
Queue Length: If the priority queue for a particular block is already nearing its limit, the fees for adding another callback to the same block can increase dynamically. Conversely, if the delay queue has ample space, adding a callback with a future
ExecuteAt
time can be cheaper, encouraging users to schedule non-urgent tasks for later times. -
Priority Consideration: Callbacks with higher priority (lower numerical value) could be charged a premium, reflecting their need for quicker processing. This could be particularly useful for high-stakes applications like trading platforms, where timing can significantly impact outcomes.
-
Enhanced Callback Semantics
Using the Priority
and ExecuteAt
parameters effectively can allow differentiating callback handling based on the application’s context:
-
High-Priority Immediate Execution: For applications like DeFi, where immediate execution can protect or gain significant financial value, callbacks should have high priority and short
ExecuteAt
intervals. These would incur higher fees but would be processed preferentially. -
Low-Priority Deferred Execution: For less time-sensitive applications, such as gaming, callbacks can be set with lower priority and longer
ExecuteAt
intervals. These callbacks would be cheaper to schedule and could typically run when the system is less busy, thus conserving resources during peak times.
By refining the fees model and enhancing the semantics of callback scheduling, callback module can achieve more efficient resource utilization, better user satisfaction, and higher overall system performance. This approach also kindly allows for a more flexible Dapp development environment, where developers can optimize cost versus performance based on the specific needs of their applications.
Fee Calculation Algorithms
Block reservation fee = base fee * ( 1 + number of scheduledcallbacks/max block fee)
Future reservation fee = base fee * ( distance to execution block/max future limit)
Priority fee = maximum priority fee * ( 1 - priority level/highest priority level)
Interesting Technical Proposal…
Would you mind please re-posting this in our GitHub Discussions as an RFC; this will ensure our engineers and greater developer community get better visibility of this proposal.
Thank you for your contribution!
Dear Sir,
I have kindly created RFC proposal. Have kindly completed Integration in existing callback module x/callback. Will kindly create PR shortly.
Thanks for letting us know, I am interested in learning more about the upgrade
First integration of ICA,ICQ,epoch module in Archway which is also kindly needed for stride liquid staking is available here.
It was kindly done in May 2023 with liquid staking demo logs via photosynthesis cosmos sdk module.
GitHub - suhasagg/Photosynthesis-Dorahacks-web3-competition-winner
Full ICA ICQ, Epoch module Archway Integration code explanations/wiki , workflow diagrams , concept illustrations are also kindly available in the documentation section .
Please kindly see full logs here provided to team .
Brief discussion on - Space and Time Complexity of Callback Module AlgorithmComplexityAnalysis - Google Docs , Kindly submitting detailed document shortly!!
Full code documentation of updated Callback Module proposal.