Top 5 changes in the latest AppLayer OrbiterSDK update and how they will empower web3 builders
After several weeks of concerted development efforts, we are delighted to announce the release of OrbiterSDK 0.1.0, a significant milestone that propels our journey at AppLayer Labs forward, as we build AppLayer, our meta-network that is renowned for its superb network speed (of up to 400k TPS), scalability, composability, language-agnosticism and cross-chain bridging.
Coming in the midst of our ongoing TestNet, this update encompasses an array of enhancements, covering exciting new features, essential bug fixes, and invaluable improvements in the user and developer experience.
Here are some of the notable changes in this release:
1. Auto-Registration through Reflections on Dynamic Contracts
Previously, developers had to manually decode transaction data and call the corresponding function within Dynamic Contracts. In this update, we have harnessed the power of C++ templates and reflection to automate this process.
With the new auto-registration feature, developers can rely on reflections to dynamically identify and register functions within Dynamic Contracts. This eliminates the need for manual decoding, streamlining the development process and reducing potential errors.
What does this change mean for GameFi builders?
Previously, developers in GameFi build had to manually decode transaction data and call the corresponding function within Dynamic Contracts. For instance, in a game where a player earns an in-game token after achieving a specific milestone, the developer had to manually decode this transaction and trigger the token’s issuance. This could be time-consuming and error-prone.
With the new auto-registration feature, this process is automated. The dynamic identification and registration of functions enable the system to automatically issue the token once the player achieves the milestone. This streamlines the development process, significantly reducing time and potential errors.
What does this change mean for DeFi builders?
Previously, in a DeFi environment, if a developer wanted to code a function within a dynamic contract that allows for a token swap, they needed to manually decode transaction data. For example, swapping one type of cryptocurrency for another involves manual registration of each step of the transaction.
With auto-registration, this process is streamlined, as the system can dynamically identify and register functions within Dynamic Contracts. This reduces the possibility of manual errors and increases efficiency, enhancing the security and speed of token swaps and similar DeFi transactions.
Before:
After:
2. Migration from std::string to std::vector
In earlier versions, std::string was utilized to store various data types such as bytes, literal strings, hex, etc. This approach was inherited from the protobuf (AvalancheGo dependency) that used std::string as its byte container. In OrbiterSDK 0.1.0, we have transitioned to specialized types — Bytes, BytesArr, and BytesArrView — for storing different data types.
This migration enhances code clarity and simplifies understanding by utilizing purpose-built types instead of a generic string container. It also enables developers to work with specific data types directly, improving overall code readability and simplifying debugging.
What does this change mean for GameFi builders?
In the past, using std::string to store various data types led to confusion and complexity, especially in games where various data types are used. For example, a game could use bytes to store image data, literal strings for player names, and hex for color codes. Storing all these in std::string was not intuitive.
With the new update, developers can store these types in their appropriate types — Bytes, BytesArr, and BytesArrView — leading to more readable code and fewer debugging issues. This enhancement simplifies game development, allowing creators to concentrate on innovative and interactive gameplay.
What does this change mean for DeFi builders?
Storing various data types such as transaction details, addresses, or token information in std::string could lead to confusion and increased debugging time, thus hindering the overall efficiency of DeFi operations and slowing down the execution of smart contracts.
By migrating to specialized types — Bytes, BytesArr, and BytesArrView — this update allows developers to work with specific data types directly. It enhances readability and simplifies the debugging process, which is vital in the complex world of DeFi, where precision and accuracy are paramount.
3. Refactor of P2P Protocol
One of the significant updates in this release is the complete overhaul of the P2P protocol. Previously, Websockets were used for peer-to-peer communication within OrbiterSDK. In OrbiterSDK 0.1.0, we have transitioned to Raw TCP Sockets, which offer improved performance and efficiency.
This protocol refactor enhances the speed and reliability of communication between peers, ensuring more efficient data transfer and enabling faster synchronization of network nodes. The switch to Raw TCP Sockets optimizes the overall performance and robustness of OrbiterSDK.
What does this change mean for GameFi builders?
The P2P protocol overhaul can drastically enhance multiplayer game performance. In a fast-paced multiplayer game, every millisecond counts. Using Websockets for P2P communication could lead to latency and an inferior player experience.
With the transition to Raw TCP Sockets in the new update, the communication between peers is much faster and more efficient. This means faster game syncs and data transfers, leading to an enhanced gaming experience, more real-time interactions, and more satisfied players.
What does this change mean for DeFi builders?
A significant overhaul of the P2P protocol can lead to enhanced performance for DeFi applications. Before, the use of Websockets might have slowed down transactions or resulted in inefficient data transfers.
Now, with the transition to Raw TCP Sockets, transactions are faster and more reliable. This results in quicker updates to liquidity pools, faster execution of smart contracts, and more efficient cross-chain transactions, enhancing the overall DeFi experience.
4. Simplified Contract Management through Reflection
To further simplify contract management, we have extended the use of reflection techniques to the Contract Manager. In previous versions, developers were required to manually register Dynamic Contracts within the Contract Manager.
Before, you had to do multiple things to properly register the contract on the ContractManager:
1 — Add a if condition for loading the contract from DB on the ContractManager
2 — Add both create and validate functions for the specific contract:
3 — Add if condition for the create/validate function to the ContractManager ethCall
Now you only have to do the following to register your contract in the ContractManager:
1 — Add the registerContract function specifying your constructor and functions of the contract.
2 — Add the contract on the ContractTypes tuple
With this update, the registration process is automated through reflections. The Contract Manager now introspects the available Dynamic Contracts, automatically registering them without the need for explicit manual registration. This streamlines the contract creation workflow and reduces overhead, allowing developers to focus on the logic of their contracts.
What does this change mean for GameFi builders?
Before this update, developers had to manually register Dynamic Contracts within the Contract Manager, which could lead to complex workflows. Imagine a game that incorporates several smart contracts — one for player rankings, another for token issuance, and yet another for in-game purchases. Each contract had to be manually registered, which was a tedious process.
With the new automated registration process, these contracts are automatically registered, drastically simplifying contract management. This enables developers to focus on creating more complex and immersive game dynamics without worrying about the administrative burden of contract management.
What does this change mean for DeFi builders?
Before this update, registering dynamic contracts for managing liquidity pools, staking protocols, or yield farming schemes had to be done manually within the Contract Manager. This could be time-consuming and complex.
Now, this update automates the registration process. This makes managing multiple contracts easier, allowing developers to focus on creating more sophisticated DeFi protocols instead of managing administrative tasks, thereby accelerating the evolution of DeFi applications.
5. Introduction of Proper Contract Return Types
To enhance the developer experience and make contract interactions more intuitive, OrbiterSDK 0.1.0 introduces proper contract return types when calling functions from other contracts. Previously, contract functions would return generic types, requiring developers to handle type conversions and interpretations.
You are now able to call a function from another contract by specifying the contract address, function, and arguments (without encoding it yourself).
With this update, contract functions now return the correct and expected types, simplifying the development process and ensuring a smoother interaction between contracts. This refinement reduces the likelihood of errors and improves the overall readability and usability of the code.
What does this change mean for GameFi builders?
The introduction of proper contract return types simplifies the development process. Consider a game with a marketplace where players can buy, sell, and trade in-game assets. Previously, when a player purchased an item, the contract function would return a generic type, requiring the developer to handle type conversions and interpretations. This was complex and prone to errors.
With the new update, the function now returns the correct item type. This simplifies the purchase process, reduces the chance of errors, and makes the marketplace more user-friendly, thereby enhancing the overall gaming experience.
What does this change mean for DeFi builders?
Before this update, contract interactions in DeFi were less intuitive due to the return of generic types. Consider a smart contract for a lending protocol that required interpretation and conversion of return types.
With the introduction of proper contract return types, interactions are more straightforward. For instance, if a user wants to check their loan balance, the contract function now returns the correct type, eliminating the need for complicated type conversions. This simplifies the user experience, making DeFi more accessible to a broader audience.
Wrapping up
OrbiterSDK 0.1.0 brings significant technical advancements and usability improvements. The automated registration of functions, simplified contract management, transition to specialized data types, refactor of the P2P protocol, and introduction of proper contract return types all contribute to a more efficient and streamlined development experience.
These enhancements empower developers to focus on the logic of their contracts, reduce potential errors, and improve the overall performance and reliability of their blockchain applications built on OrbiterSDK. This release marks a major stride in our commitment to delivering a user-friendly, efficient, and high-performing environment for blockchain development.
We encourage all developers to update to OrbiterSDK 0.1.0 and take advantage of these improvements. Stay tuned for further updates as we continue to refine and expand OrbiterSDK, empowering developers in their blockchain endeavors.
About AppLayer:
AppLayer is a C++ based Ethereum scaling solution where developers can deploy Solidity smart contracts and C++ programmed stateful pre-compiles as smart contracts. In AppLayer, Solidity smart contracts are 10 times faster than those in Golang-based competing networks, and stateful pre-compiles are 65 times faster.
If you are interested in building with AppLayer please apply for our Testnet Grants Program: https://forms.gle/YYs6B11ynxQZKPok8
Website: https://applayer.com/
Documentation: https://docs.applayer.com/testnet
Twitter: https://twitter.com/AppLayerLabs
Discord: https://discord.gg/VMKrxF7vwu
Telegram: https://t.me/AppLayerLabs
Announcements: https://t.me/AppLayer_News
Medium: https://medium.com/@AppLayerLabs
Github: https://github.com/applayerlabs