Cointime

Download App
iOS & Android

Stack Exploder: Scaling Node Infrastructure in a 1000+ Appchain Multiverse with Saga Edge Nodes

Cointime Official

Saga is leading The Unblock movement, ushering in a new world where developers can build their web3 applications in as simple a way as possible. In the Unblock Manifesto, we highlighted how application developers have difficulty acquiring sufficient blockspace due to the need to manually stand up various parts of the infrastructure. Saga automates and trivializes the infrastructure for the developer by offering an Integrated Stack that automates launching on-demand blockspace.

An effective Integrated Stack requires the platform to automatically handle an immense amount of read, write and syncing requests. While existing infrastructure is sufficient for the status quo, it is not well equipped to handle demand of 1000+ appchains. The Saga Platform has many innovations that drive a breakthrough, but the most important component is a scalable back-end node infrastructure.

Today, we’re very excited to share our Saga Edge Node with the community.

Current Node Infrastructure Architecture

In a proof-of-stake blockchain, validators need to peer with each other to share consensus and other block production messages. At the same time, users need access to the validators to facilitate transactions to be included in blocks and read the latest state of the blockchain. If validators allow arbitrary connections from any of these sources, they open themselves to being intentionally or accidentally DDoSed. As a network, this is not acceptable because DDoSed validators do not participate in consensus and may halt the network.

Directly exposing validator nodes may DDoS the validator

To solve this problem, networks employ a sentry (or proxy) node architecture. The validator node hides behind one or more sentry nodes. The validators only peer with their own sentry nodes, and all external stakeholders communicate to the validator through their corresponding sentry node.

Example of a typical sentry node architecture to protect the validator

With any sudden increase in traffic, a sentry architecture is very effective in protecting the validator by offering 3 options to handle the requests:

  • First, the sentry node can throttle access from users
  • Second, the validator can choose to cut peering from the validator to (public) Sentry and allow block production to continue through their (private) Sentry connection to other validators
  • Finally, the validator may stand up multiple public sentries to service the requests from users

In practice, validator operators generally employ option 3 by placing sentries in an autoscale group in the cloud that spins up new instances when the current instances are busy. While this type of architecture was sufficient for a small cluster of appchains, it quickly runs into scaling issues in a system where there are 1000s of blockchains.

Issues with the Sentry Node Architecture: Cost

There are three issues that compound with one another that make the existing sentry node architecture not suitable for Saga-scale.

First, a sentry node is usually a full node that does not sign blocks. This means that every sentry node is executing every transaction and block and verifying state transitions as if they were a validating node. The computation load of a sentry node is excessively high for what it needs to do. Assume each validator node costs 100 dollars per month to operate. Because a sentry node is the same cost as a validator node, if a validator chooses to operate 1 validator node and 2 sentry nodes, the cost per validator would be $300 (3x$100) per month.

Second, every validator needs to operate a sentry node to protect its external IP address. Using the $300 per month figure, a network with 100 validators requires $30,000 (100x$300) per month in node operating costs to be secure.

Finally, the sentry node is unique per chain. Because each sentry node is a full node of a particular network, the $30,000 cost per month needs to be multiplied by the number of chains. In a 1000 chain system, this would amount to $30,000,000 per month in aggregate node operating costs.

Obviously, the true aggregate cost is likely less than this figure since some validators will run zero or one sentry node. However, it is very evident why this kind of architecture is not viable for a system like Saga where there may be thousands of chains operated by the validators. From an architecture design perspective, prioritizing redundancy at the validator site-level instead of the network-level leads to over-provisioned and unused hardware.

Issues with the Sentry Node Architecture: Uncertainty and Inflexibility

Each sentry or full node is a generalized infrastructure component: it provisions hardware resources to handle all types of requests regardless of the needs of the network. In addition, different requests have bottlenecks from completely separate components of the infrastructure. For example, read requests may be bottlenecked by the number and quality of full nodes. Write requests may be bottlenecked by the mempool size and block generation speed. IBC requests may be bottlenecked by the relayer implementation, as well as block generation in the destination chain.

Finally, because of the generalized nature of sentry nodes, it takes a bit of time to spin up — each new sentry node needs to state sync and join the latest round of consensus before they are able to help scale the network. An effective node infrastructure should be able to dynamically spin up specific resources from the live traffic pattern of the network.

Introducing Saga Edge Node

Saga Edge Node makes node architecture more scalable by reducing infrastructure complexity and costs. The Saga Edge Node has the following qualities:

  1. A Saga Edge Node is incredibly cheap to run and does not break system consistency to have more than one running in parallel (and is therefore truly horizontally scalable)
  2. A Saga Edge Node can service as many Chainlets as needed
  3. A Saga Edge Node is able to act as a virtual node and actively manage requests in the validator infrastructure

Let’s explore how it works.

Making Saga Edge Nodes cheap to operate

A traditional sentry node is a full node, which means every sentry node is re-executing every transaction and updating their internal state.

Traditional sentry nodes recompute the internal state to follow consensus

This amount of computation redundancy quickly accumulates costs to the node infrastructure. Instead, we can design the Edge Node to hold the IP address of the validator node and simply relay the requests across. With this, we push the redundancy from validator site-level to the network-level.

Saga Edge Nodes do not recompute the internal state

The Saga Edge Node therefore becomes incredibly cheap to operate because it is a simple lookup table and a passive relayer of connection requests from the requester to the validator node in question.

Multiplex Edge Node across multiple chains

We can improve the Saga Edge Node implementation by multiplexing requests for multiple chains into the same Edge Node. With this improvement, requests for all Chainlet activities can aggregate into the same Edge Node. The peering connections will automatically be relayed to the corresponding internal node.

How does this mechanically work? One issue is that because we have stripped out the part of the sentry node that syncs with the validator node, the Saga Edge Node is no longer aware of what individual requests are doing. We can model a solution similarly to how HTTP leaks Server Name Indication (SNI) in the TLS abstraction layer. When a requester sends any data to the Saga Edge Node, they can leak the chain_id field to route to the correct internal node.

Edge nodes multiplex requests across all Chainlets into a single instance

With this implementation, validators and other node infrastructure providers can manage aggregate traffic across all Saga Chainlets, instead of worrying about standing up different sentry nodes for each individual chain.

Virtualize full nodes for active request management

While significantly improved from the existing sentry node architecture, the implementation has some issues. First, the requester must break the abstraction layer to leak chain_id information to the Saga Edge Node. Second, Edge Node is a passive participant in this system. Because the Edge Node has no knowledge about what requests are doing, all connection requests are automatically routed to the validator node. The peering connections are still one-to-one, meaning that if there are two requesters requesting the same thing, the validator node needs to make two separate peering connections.

Two different requests for the same information leads to multiple peering requests on validator node

We can make the Saga Edge Node a more active participant in the network by forwarding certain metadata (such as head, round, step, etc) from the validator node to the Edge Node.

Forwarding appropriate metadata allows Edge Nodes to act like virtual full nodes

Using this metadata, the Saga Edge Node can appear like a virtual full node and peer directly with requesters. By peering directly, the validator nodes only need to peer with the Edge Node cluster, making operations much more efficient. This also removes the need for the requesters to leak the chain_id on requests.

Another benefit of this now active Edge Node is that the Edge Nodes can now begin redirecting certain requests such as state sync and PRC requests away from the validator nodes. This way, the validator node infrastructure can be stripped down to simply execute transactions and pass consensus messages between validators.

Saga Edge Nodes can actively redirect requests to appropriate internal resources and services

In fact, we can enable our Edge Node architecture to peer into various components within the Saga infrastructure to effectively provide back propagation to the end users. For example, when there are too many transactions in the mempool, the Edge Node could simply decline any further write requests. Alternatively, the Edge Node can peer into the IBC relayer queue and decline any further IBC messages based on the queue size. Edge Node back propagation is a powerful way to limit the resource demand to run a chainlet validator node. This is one way the Saga Platform can guarantee and deliver clearly defined SLA metrics to application developers and Chainlet customers, such as mempool size and IBC transaction limits.

Conclusion

A scalable node infrastructure is usually not a big focus for other blockchain ecosystems because the negative effects of an unoptimized node infrastructure are not immediately felt by the stakeholders. The accumulated cost of running redundant hardware indirectly contributes to expensive validator compensation. The uncertainty and inflexibility of the infrastructure indirectly contributes to inconsistent uptime and performance metrics.

The Saga Edge Node allows the infrastructure to horizontally scale purpose-driven components while keeping costs minimal. It is the latest innovation in the Saga Platform that allows application developers to unblock themselves through lower costs and predictable SLA and performance of their blockspace.

Comments

All Comments

Recommended for you

  • Putin: Russia "supports" Harris, calls her smile "contagious"

    According to foreign media such as TASS and Russia's Sputnik News, Jinse Finance reported that on the afternoon of September 5th local time, Russian President Putin said at the plenary session of the Eastern Economic Forum 2024 that Russia will "support" the US Democratic Party presidential candidate and vice president Harris as recommended by the US President Biden in the upcoming US presidential election. When asked how he viewed the 2024 US election, Putin said it was the choice of the American people. The new US president will be elected by the American people, and Russia will respect the choice of the American people. Putin also said that just as Biden suggested his supporters to support Harris, "we will do the same, we will support her." The report said that Putin also joked that Harris' laughter is "expressive and infectious," which shows that "she is doing everything well." He added that this may mean that she will avoid further sanctions against Russia.

  • An ETH whale repurchased 5,153 ETH with 12.23 million USDT 20 minutes ago

    A certain high-frequency trading ETH whale monitored by on-chain analyst Yu Jin bought 5,153 ETH with 12.23 million USDT 20 minutes ago.

  • CFTC: Uniswap Labs has actively cooperated with the investigation and only needs to pay a fine of US$175,000

    The CFTC has filed a lawsuit against Uniswap Labs and reached a settlement. It was found that Uniswap Labs illegally provided leveraged or margined retail commodity transactions of digital assets through a decentralized digital asset trading protocol. Uniswap Labs was required to pay a civil penalty of $175,000 and cease violations of the Commodity Exchange Act (CEA). The CFTC acknowledged that Uniswap Labs actively cooperated with law enforcement agencies in the investigation and reduced the civil penalty.

  • Federal Reserve Beige Book: Respondents generally expect economic activity to remain stable or improve

    The Federal Reserve's Beige Book pointed out that economic activity in three regions has slightly increased, while the number of regions reporting flat or declining economic activity has increased from five in the previous quarter to nine in this quarter. Overall employment levels remain stable, although some reports indicate that companies are only filling necessary positions, reducing working hours and shifts, or reducing overall employment levels through natural attrition. However, reports of layoffs are still rare. Generally speaking, wage growth is moderate, and the growth rate of labor input costs and sales prices ranges from slight to moderate. Consumer spending has declined in most regions, while in the previous reporting period, consumer spending remained stable overall.

  • Puffpaw Completes $6 Million Seed Round with Lemniscap Ventures as Participant

    Puffpaw has announced the completion of a $6 million seed round of financing, with participation from Lemniscap Ventures. The Puffpaw project plans to launch a blockchain-enabled electronic cigarette aimed at helping users reduce nicotine intake through token incentives. The project encourages users to quit smoking by recording their smoking habits and rewarding them with tokens. Puffpaw's token economics aims to cover 30% of the cost of users' first month of using their product and provide social rewards. The project also considers possible system abuse, but the issue of users potentially reporting smoking habits dishonestly is not yet clear.

  • Affected by Ethervista and others, Ethereum Gas temporarily rose to 33gwei

    According to Etherscan, due to the influence of contracts such as Ethervista, Ethereum Gas has temporarily risen to 33gwei, with the top three being EthervistaRouter, UniswapRouter, and BananaGun.

  • The probability of the Fed cutting interest rates by 25 basis points in September is 55%.

    The probability of the Federal Reserve cutting interest rates by 25 basis points in September is 55.0%, while the probability of a 50 basis point cut is 45.0%. The probability of the Federal Reserve cutting interest rates by a cumulative 50 basis points by November is 32.1%, by 75 basis points is 49.2%, and by 100 basis points is 18.8%.

  • Nvidia: No subpoena received from the US Department of Justice

    Nvidia (NVDA.O) stated that it has not received a subpoena from the US Department of Justice.

  • US SEC again postpones decision on environmentally friendly Bitcoin ETF listing application

    The US Securities and Exchange Commission (SEC) has once again postponed its final decision on the New York Stock Exchange (NYSE) Arca's application for a carbon offset Bitcoin ETF. According to a document dated September 4th, the decision has been extended to November 21st. The ETF aims to provide a Bitcoin investment exposure in an environmentally friendly way by offsetting carbon emissions, tracking an investment portfolio composed of 80% Bitcoin and 20% carbon credit futures. Tidal Investments submitted the fund registration application in December 2023, while NYSE Arca submitted the initial application in March. Concerns have been raised about the environmental impact of Bitcoin mining, with the International Monetary Fund (IMF) reporting that cryptocurrency mining accounts for 1% of global greenhouse gas emissions. The delay in this decision also includes the postponement of approval for the Nasdaq One-Stop Cryptocurrency Investment Portfolio ETF.

  • Japanese regulator calls for lower cryptocurrency tax rates by 2025

    On September 4th, it was announced that Japan's financial regulatory agency has released a comprehensive tax reform plan for the fiscal year 2025, which includes regulations on cryptocurrency to lower its tax rate.