<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Gregory Tsipenyuk</title>
    <description>The latest articles on DEV Community by Gregory Tsipenyuk (@gregtatcam).</description>
    <link>https://dev.to/gregtatcam</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1101563%2F34cb424b-3e39-4576-9d34-abea52fa10b7.jpeg</url>
      <title>DEV Community: Gregory Tsipenyuk</title>
      <link>https://dev.to/gregtatcam</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gregtatcam"/>
    <language>en</language>
    <item>
      <title>AMM Performance Testing Report</title>
      <dc:creator>Gregory Tsipenyuk</dc:creator>
      <pubDate>Thu, 05 Oct 2023 23:49:41 +0000</pubDate>
      <link>https://dev.to/ripplexdev/amm-performance-testing-report-3hon</link>
      <guid>https://dev.to/ripplexdev/amm-performance-testing-report-3hon</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;In the rippled 1.12.0 release, the AMM amendment stands out as a significant feature in both size and scope. Since September 2022, the RippleX performance team has collaborated closely with the engineering team responsible for the AMM feature implementation. This report presents a thorough overview of our testing approach, findings, and key takeaways. Based on our analysis, we are confident that activating the AMM amendment will not negatively impact the network's consensus performance or its ability to process other transactions. &lt;/p&gt;

&lt;h2&gt;
  
  
  Objective
&lt;/h2&gt;

&lt;p&gt;Our primary objective was to assess transaction performance and its effect on consensus processing, particularly concerning the DEX upon implementing the AMM amendment. Specifically, we aimed to ascertain if the AMM amendment could possibly impede the performance of the XRP Ledger network at the worst case scenarios. To achieve this goal, we adopted a new testing methodology compared to the previous performance tests which primarily focused on exploring the maximum software processing capacity. In this testing, our focus was on maintaining a 5-second network consensus processing latency as the capacity threshold.&lt;/p&gt;

&lt;h2&gt;
  
  
  Testing Methodology
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Capacity Criteria
&lt;/h3&gt;

&lt;p&gt;Given the objective to measure the maximum performance impact of integrating AMM transactions in the DEX, we use the 5-seconds consensus latency limit to gauge the consensus capacity while ensuring the network is  in its optimal condition. During testing, both the ledger's and consensus's performance and latency were assessed to determine whether the network load surpassed this latency criteria.&lt;/p&gt;

&lt;h3&gt;
  
  
  Load Modeling
&lt;/h3&gt;

&lt;p&gt;Research was undertaken to understand the distribution of payment transaction path sizes. Our findings showed that over 99.7% of transactions did not specify the Paths field. When the Paths field is not specified in &lt;a href="https://xrpl.org/paths.html#default-paths"&gt;cross currency payments&lt;/a&gt;, it is assumed that there is one path and one step. As a result, we came up with the following load scenarios.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scenario #1: XRP-XRP direct payments&lt;/li&gt;
&lt;li&gt;Scenario #2: Payment transactions involving the sending and receiving of two IOU tokens 

&lt;ul&gt;
&lt;li&gt;2.1: Using only the AMM-based DEX&lt;/li&gt;
&lt;li&gt;2.2: Using only the LOB-based DEX&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Scenario #3: Mixed load scenario to emulate a heavy load condition

&lt;ul&gt;
&lt;li&gt;3.1: Using only the AMM-based DEX&lt;/li&gt;
&lt;li&gt;3.2: Using only the LOB-based DEX&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For scenario #3, the complexity and the proportions of each condition is laid out in the table below.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;AMM TRANSACTION PAYLOAD COMPLEXITY&lt;/th&gt;
&lt;th&gt;LOAD PROPORTION&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Payment Transaction with 1 path and 1 PathStep between two IOU tokens&lt;/td&gt;
&lt;td&gt;73.63%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment Transaction with 6 paths and [3,8] PathSteps among IOU tokens&lt;/td&gt;
&lt;td&gt;24.72%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Payment Transaction with 3 paths and [1,3] PathSteps among IOU tokens&lt;/td&gt;
&lt;td&gt;1.65%&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h3&gt;
  
  
  Test Environment
&lt;/h3&gt;

&lt;p&gt;Our testing infrastructure simulated a private XRPL environment with 9 nodes, matching Ripple's MainNet in terms of hardware specifications. The key features of this environment are the following.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;u&gt;Network Setup&lt;/u&gt;

&lt;ul&gt;
&lt;li&gt;5 function as validator nodes&lt;/li&gt;
&lt;li&gt;4 serve as client P2P nodes, interfacing with load generators&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Uniform System Specifications&lt;/u&gt;: Each system mirrors the hardware specifications found in Ripple’s MainNet rippled infrastructure. Specifically, they are hosted on AWS's EC2 instance type, z1d.2xlarge, boasting 8 CPU cores, 64GB RAM, and 300GB NVMe SSD storage, dedicated to the rippled database.&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Network Configuration&lt;/u&gt;: All nodes operate within the same AWS region and are interconnected through a shared LAN.&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Load Submission&lt;/u&gt;: Between 1 and 4 load servers are actively engaged in transmitting transactions to the 4 P2P nodes.&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Account Setup&lt;/u&gt;: A total of 100K synthetic accounts were established, built atop a public ledger synchronized from the MainNet as of July 3rd, 2023. Provisions were made in the simulation logic to ensure the uniqueness of source and destination accounts for every consensus cycle.&lt;/li&gt;
&lt;li&gt;
&lt;u&gt;Configuration Continuity&lt;/u&gt;: The rippled configuration file was sourced directly from a Ripple MainNet validator. While the core configurations remained unchanged, requisite modifications were made to align with the specific needs of our environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Test Data Setup
&lt;/h3&gt;

&lt;p&gt;A total of 100K synthetic accounts were established based on a public ledger synced from the MainNet as of July 3rd, 2023. To maintain the integrity of the simulation, we have implemented logic ensuring that unique accounts are designated as sources and destinations for simultaneous transactions throughout each consensus cycle. The following describes the setup.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Rippling activated across all synthetic accounts&lt;/li&gt;
&lt;li&gt;15 IOU Tokens&lt;/li&gt;
&lt;li&gt;Designated two synthetic accounts as the “genesis account” and the “liquidity provider”&lt;/li&gt;
&lt;li&gt;Accounts have trustlines with the issuers of all the IOU Token in the network&lt;/li&gt;
&lt;li&gt;Accounts are sufficiently funded with the IOU Tokens&lt;/li&gt;
&lt;li&gt;Created AMM instances to allow intricate payment paths as shown in the “AMM/LOB IOU Tokens Topology” graph

&lt;ul&gt;
&lt;li&gt;A bi-directional arrow shows that there is a corresponding AMM instance between the two IOU tokens&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Tc7_sC9p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84rxtc7ijfcm1qvc3cv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Tc7_sC9p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84rxtc7ijfcm1qvc3cv7.png" alt="Image description" width="707" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Test Results
&lt;/h2&gt;

&lt;p&gt;Here are the test results from the scenarios discussed in the Load Modeling section.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;#&lt;/th&gt;
&lt;th&gt;TEST SCENARIO&lt;/th&gt;
&lt;th&gt;VERSION&lt;/th&gt;
&lt;th&gt;TEST DURATION(MIN)&lt;/th&gt;
&lt;th&gt;THROUGHPUT(TXN/SEC)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;XRP-XRP DIRECT PAYMENT&lt;/td&gt;
&lt;td&gt;1.12.0&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;708.14&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.1&lt;/td&gt;
&lt;td&gt;AMM IOU-IOU /W 1 PATH + 1 PATHSTEP&lt;/td&gt;
&lt;td&gt;1.12.0&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;403.50&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2.2&lt;/td&gt;
&lt;td&gt;LOB IOU-IOU /W 1 PATH + 1 PATH STEP&lt;/td&gt;
&lt;td&gt;1.12.0&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;414.74&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.1&lt;/td&gt;
&lt;td&gt;AMM - MIXED PATH&lt;/td&gt;
&lt;td&gt;1.12.0&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;110.86&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3.2&lt;/td&gt;
&lt;td&gt;LOB - MIXED PATH&lt;/td&gt;
&lt;td&gt;1.12.0&lt;/td&gt;
&lt;td&gt;60&lt;/td&gt;
&lt;td&gt;214.27&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Conclusions
&lt;/h2&gt;

&lt;p&gt;To underscore the scale of the load test, we have juxtaposed the load test throughput with the year-to-date throughput, represented as “Current TPS”, of Payment transactions in the graph below.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--P1UQ2lxz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brtccka9o6xtk71ngaqb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--P1UQ2lxz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/brtccka9o6xtk71ngaqb.png" alt="Image description" width="682" height="433"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From our comprehensive testing and subsequent evaluation, it is clear that, despite the computational intricacies associated with the transactions that interact with the AMM-based DEX, we have made significant advancements in XRPL's performance over the last 18 months. This has propelled the transaction throughput beyond 100 TPS, even under the most challenging conditions. Considering these outcomes, we are confident that incorporating the XLS-30 AMM feature into rippled will not introduce risks to the network in the near term. We remain steadfast in our dedication to rigorous research and development, aiming to continually elevate the performance and adaptability of the XRP Ledger.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>A Developer's Guide to Payment Engine System Design</title>
      <dc:creator>Gregory Tsipenyuk</dc:creator>
      <pubDate>Tue, 20 Jun 2023 20:32:57 +0000</pubDate>
      <link>https://dev.to/ripplexdev/a-developers-guide-to-payment-engine-system-design-2i2a</link>
      <guid>https://dev.to/ripplexdev/a-developers-guide-to-payment-engine-system-design-2i2a</guid>
      <description>&lt;p&gt;The RippleX engineering team has &lt;a href="https://ripple.com/reports/Payment-Engine-System-Design.pdf"&gt;published a new whitepaper&lt;/a&gt; that provides an overview of the Payment Engine (PE) system, including design concepts and examples. The PE system is a subsystem within the rippled software that is responsible for executing payments, offer crossings, and cash checks in the XRPL network, and is also used as part of the XRP Ledger's &lt;a href="https://xrpl.org/paths.html"&gt;path finding algorithm&lt;/a&gt;. The full whitepaper demonstrates key concepts of the PE system with several examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;span&gt;Synopsis (Super Summary)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The document provides an overview of the design concepts and examples related to the Payment Engine (PE) system, which is a subsystem within the XRPL's rippled software. Here is a summary of the main points covered:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;span&gt;Payment Engine Overview&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Payment Engine is responsible for executing &lt;a href="https://xrpl.org/payment-types.html"&gt;payments&lt;/a&gt;, offer crossings, and cash checks in the XRPL network.&lt;/li&gt;
&lt;li&gt;It converts payment paths into a sequence of specific steps and executes them sequentially.&lt;/li&gt;
&lt;li&gt;The steps can involve different types, such as XRPEndpointStep, BookStep, and DirectStep, depending on the nature of the payment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;span&gt;Design Concepts By Example&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Several examples are provided to illustrate different design concepts and scenarios.&lt;/li&gt;
&lt;li&gt;Examples include executing steps in reverse and forward directions, re-executing steps based on limitations, consuming offers at the same quality, iterative payment execution, and multi-path payment execution.&lt;/li&gt;
&lt;li&gt;The examples showcase how payments are executed, how offers and liquidity are consumed, and how the system handles various scenarios.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;span&gt;Payments via Automated Market Maker (AMM)&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The document discusses the integration of &lt;a href="https://github.com/XRPLF/XRPL-Standards/discussions/78"&gt;Automated Market Maker (AMM)&lt;/a&gt; functionality into the BookStep process.&lt;/li&gt;
&lt;li&gt;AMM allows tokens to be traded in both directions based on &lt;a href="https://opensource.ripple.com/docs/xls-30d-amm/automated-market-makers/"&gt;mathematical formulas&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;AMM offers are handled within BookStep and can be chosen based on spot price quality (SPQ).&lt;/li&gt;
&lt;li&gt;The document explains how AMM offers are generated and resized during payment execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;span&gt;Multi-Path Payment Execution&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The document explores the execution of payments involving multiple paths, where liquidity can be consumed from different sources.&lt;/li&gt;
&lt;li&gt;Paths are sorted based on their quality, and the best quality path is executed first.&lt;/li&gt;
&lt;li&gt;The document introduces a Fibonacci sequence-based approach to generating synthetic AMM offers in multi-path payments.&lt;/li&gt;
&lt;li&gt;The iterative approach is used to execute multi-path payments until the requested output or input amounts are fulfilled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The document provides conceptual understanding of the Payment Engine subsystem and helps developers delve into the coding implementation details. It demonstrates various payment scenarios, the interaction between different steps, and the considerations involved in executing payments within the XRPL network.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://ripple.com/reports/Payment-Engine-System-Design.pdf"&gt;Read the full whitepaper here&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>web3</category>
      <category>cryptocurrency</category>
      <category>xrpl</category>
    </item>
  </channel>
</rss>
