In blockchain and web3 development, understanding and optimizing the performance of infrastructure providers is of paramount importance. The team behind CompareNodes has developed two distinct methodologies to measure and compare the latency of RPC’s across various blockchain protocols and networks: the Performance Page and the Global Node Comparison (GNC) App. These methodologies offer developers valuable insights to make informed decisions about infrastructure providers and enhance their dApp’s user experience.
Performance Page: Unveiling Perpetual Insights
The Performance Page continuously measures the latency of RPC calls across a subset of popular infrastructure providers. To ensure accuracy and relevance, the team chose 11 providers offering free accounts or public endpoints for their comparison. The selected providers include names like Alchemy, Allnodes, Ankr, Blacksun, Blast API, Chainstack, Etherscan, Infura, POKT Network, and Validation Cloud. We currently cover only Ethereum Mainnet but we will be adding other protocols soon
The methodology involves deploying individual instances of Java 11 (Corretto) Lambda functions in 13 global regions. These Lambdas execute four identical RPC requests every minute to the chosen provider’s endpoint. We dismiss the first request as a “warm-up,” then we record the average latency of the remaining three in milliseconds. After timestamping these measurements, we store them in a central DynamoDB table situated in the us-east-1 region.
Irrespective of the request type RPC or RESTful, each lambda measures the round-trip duration (latency) for four identical requests. The first request is discarded as a “warm-up.” The duration of the remaining three requests is averaged and recorded as the latency value at that moment. We compute the duration using System.currentTimeMillis(), and we timestamp the values in each region before placing them into a “central” DynamoDB table located in us-east-1. It’s important to mention that each request has a timeout of 5 seconds. If any of the four requests time out or encounter an exception, we categorize the measurement as a failure and remove it from consideration for ranking in the continental chart.
Additionally, a consolidation Lambda function runs in us-east-1 every minute, gathering and transforming the measurements into a tabular format for display in the user interface. This function also computes median values for each subscription, ensuring robust and accurate performance comparisons.
Global Node Comparison – GNC App: On-Demand Precision
CompareNodes extends its capabilities through the Global Node Comparison (GNC) App, allowing developers to measure RPC latency on-demand. This app, built using AWS Lambda and NodeJS, supports a wide array of blockchain networks, including EVM-compatible networks, Polkadot ecosystems, and UTXO-based protocols like Bitcoin and Litecoin.
In the GNC App, we launch comparisons by utilizing sets of two Lambdas in each of the 27 global regions. These Lambdas perform a warm-up request, which we subsequently discard. Following this, we execute multiple RPC calls within a loop that has a maximum duration of 30 seconds. We sum and count the response times for successful calls and handle failures and 429 responses (indicating too many requests) appropriately. Each Lambda records its results, including duration, success count, and failure count, to a DynamoDB table. Subsequently, the app’s user interface displays the aggregated results.
Sharing and Exporting Results: Seamlessness Meets Functionality
The Performance Page provides charts and tables representing global and continental latency medians, while the GNC App generates results pages with tables. This user-friendly approach ensures that developers can analyze and share their findings effectively.
Security and Privacy: Safeguarding Developer Trust
CompareNodes places a strong emphasis on security and privacy. The GNC App supports both public endpoints and endpoints that require API keys, ensuring that no sensitive information is kept after the comparison run. We discard the endpoint URL and key, retaining only the top-level domain of the endpoint URL for reference.
Performance Page and GNC App provide ways to measure and compare latency across a range of blockchain protocols and networks. Whether you need perpetual monitoring or on-demand insights; our tools are here to help you. Use CompareNodes and make informed decisions that will enhance the performance of your dApps.