Cloudflare Expands Ethereum Gateway Support to Görli and Sepolia Testnets

·

Today, we are thrilled to announce that Cloudflare's Ethereum Gateway now supports the Görli and Sepolia test networks. This expansion aligns with our commitment to enabling seamless interaction with the Ethereum ecosystem, particularly in light of the pivotal Ethereum Merge upgrade. These testnets provide developers with essential environments to test decentralized applications (dapps) and network upgrades before deploying them on the Ethereum mainnet. A key distinction is that the Ether used on these testnets holds no real-world value, making them ideal for risk-free experimentation.

Ethereum, renowned for its decentralized blockchain and smart contract capabilities, can be accessed effortlessly through Cloudflare's HTTP API. Our gateway simplifies this interaction, eliminating the need for developers to maintain their own nodes. For a foundational understanding of how our Ethereum Gateway operates, we recommend reviewing our earlier introductory content.

In preparation for the Ethereum Merge, the Ethereum Foundation successfully executed merges on several testnets to ensure a smooth transition for the mainnet. Notably, the Görli-Prater merge was handled flawlessly by Cloudflare's infrastructure, confirming our readiness for the mainnet upgrade. Our testnet gateways are now fully operational and available for immediate use by all customers.

This article delves into the consensus transition brought about by the Merge, outlines the enhancements to our Ethereum Gateway, and provides a practical guide on leveraging these new capabilities.

Understanding Consensus Mechanisms in Blockchain

Proof of Work (PoW) served as Ethereum's original consensus mechanism, inherited from Bitcoin. In this model, miners compete to solve complex mathematical puzzles. The first to succeed earns the right to add a new block of transactions to the blockchain and receives a reward. While initially promoting decentralization through commodity hardware, the evolution towards specialized equipment like ASICs and GPUs intensified energy consumption. The security of PoW comes at a significant environmental cost, with the Ethereum network's historical energy use exceeding that of entire countries. This unsustainable model highlighted the urgent need for a more efficient alternative.

Proof of Stake (PoS) introduces a more sustainable consensus model. Here, validators are chosen to propose and validate new blocks based on the amount of cryptocurrency they have "staked" as collateral. This system randomly selects a validator for each block proposal, with committees verifying the work. Validators acting maliciously or going offline face economic penalties, including the potential loss of their staked funds. The Ethereum Foundation estimates that PoS reduces energy consumption by an astounding 99.95% compared to PoW. This mechanism not only enhances sustainability but also aligns validators' financial incentives with the network's health and security.

Proof of Authority (PoA) shares similarities with PoS but differs in validator selection. Instead of a financial stake, validators are approved by a central authority, making it suitable for trusted environments like private corporate or government networks. Cloudflare previously operated an authority node for the now-deprecated Rinkeby testnet. While less common for public blockchains, PoA offers efficiency and control for specific use cases.

How the Cloudflare Ethereum Gateway Works

At Cloudflare, we practice what we preach by building our products on our own global network. The Ethereum Gateway is a prime example. It allows customers to interact with the Ethereum network without the operational overhead of running a dedicated node.

The process begins when a JSON-RPC call is received by a Cloudflare Worker. This serverless code, deployed across our global data centers, ensures low-latency processing from any geographic region. The Worker normalizes the request using the latest known block number.

The call is then forwarded to a Cloudflare Load Balancer, which directs it to the appropriate Ethereum network—mainnet or a supported testnet. From there, the request is routed to Ethereum Node proxies within our Kubernetes cluster. These proxies manage a queue, distributing requests to ready and fully synchronized Ethereum Nodes. Each node comprises an execution client and a consensus client, the latter being a critical addition to support the Post-Merge PoS environment. This multi-layered, redundant architecture is designed for maximal speed, reliability, and availability.

The Ethereum Merge: A Landmark Upgrade

The Ethereum Merge represents one of the most significant upgrades in blockchain history. It transitioned the network's consensus mechanism from the energy-intensive Proof of Work to the efficient Proof of Stake. This shift not only addresses environmental concerns but also paves the way for future scalability improvements like sharding, which aims to increase transaction throughput and reduce costs.

The Merge involved combining the existing Ethereum execution layer (the mainnet we knew) with the new consensus layer, the Beacon Chain. This fusion occurred at a specific point known as the Terminal Total Difficulty (TTD). Post-Merge, the Beacon Chain became the engine for block proposal and validation, while the original chain continues to process transactions and smart contracts.

Node operators had to prepare by running both an execution client (like Geth) and a consensus client (like Prysm or Lighthouse). Failure to do so would result in a node falling out of sync, stuck at the last pre-merge block.

Utilizing Sepolia and Görli Testnets

As detailed in our gateway documentation, sending JSON-RPC calls to a preferred testnet is straightforward. After creating your Ethereum gateway, simply modify the endpoint URL to include sepolia or goerli instead of mainnet.

Example call to the Sepolia testnet:

$ curl -X POST -H "Content-Type: application/json" --data '{"jsonrpc": "2.0", "method": "net_version", "params": [], "id": 35}' https://your-gateway.example.com/v1/sepolia
{"jsonrpc":"2.0","result":"11155111","id":35}

This testnet support is invaluable for developers. It allows for thorough testing and hardening of dapps and smart contracts before mainnet deployment, mitigating risks to brand trust and product availability. 👉 Explore more strategies for testing on Ethereum

Deprecation of Rinkeby Testnet

In alignment with the Ethereum Foundation's roadmap, Cloudflare has deprecated support for the Rinkeby testnet. The Rinkeby signer operated by Cloudflare is no longer active. Support for this network was officially discontinued, following the ecosystem's move towards more modern testnets like Sepolia and Görli.

Frequently Asked Questions

What is the difference between a testnet and the mainnet?
A testnet is a simulated blockchain environment used for development and testing. The cryptocurrency on a testnet has no real-world value, allowing developers to experiment without financial risk. The mainnet is the live, production blockchain where transactions have real economic consequences.

Why should I use Görli or Sepolia instead of other testnets?
Görli and Sepolia are currently the recommended testnets by the Ethereum community post-Merge. They are maintained and closely mirror the mainnet's Proof of Stake consensus mechanism, providing a more accurate and future-proof testing environment compared to deprecated networks like Rinkeby.

How does the Ethereum Gateway ensure high availability?
Our gateway leverages Cloudflare's global network of data centers and a redundant architecture of Load Balancers, Workers, and multiple Ethereum node instances. This design ensures that requests are processed quickly and reliably, even during high traffic or individual component failures.

What changes did Cloudflare make to support the Merge?
The key technical change was the integration of a consensus client alongside the existing execution client in our node infrastructure. This allows our gateway to communicate with the Beacon Chain and correctly process requests in the new Proof of Stake environment.

Can I use the gateway for both reading data and sending transactions?
Yes, the Ethereum Gateway supports a wide range of JSON-RPC methods, including those for querying blockchain data (eth_blockNumber) and for broadcasting signed transactions (eth_sendRawTransaction). 👉 Get advanced methods for blockchain interaction

Is there a cost associated with using Cloudflare's Ethereum Gateway?
We encourage developers to check our official documentation for the most current information on pricing and free tier allowances. Our goal is to provide accessible tools for building the next generation of web3 applications.