Hardfork Incoming: Upgrading Polygon PoS Chain to Boost Performance
When the Polygon PoS chain first launched, it offered a much-needed solution for Ethereum’s scaling issues. It gave users and developers alike everything they love about Ethereum, but with faster throughput and lower fees.
Now, with tens of thousands of decentralized apps, over 207 million unique addresses, more than 2.3 billion processed transactions, and a vanishingly-small carbon-footprint, the Polygon PoS chain has emerged as the premier destination for dApps. It is home to some of the biggest Web3 projects like Uniswap and Aave as well as major companies like Robinhood, Adobe, and Stripe. But this is only the beginning.
But there are also more immediate steps to improve Polygon PoS performance and predictability–proposals that require the network’s approval to become reality.
Based on forum discussion and feedback from the community, a critical hardfork will be proposed that will aim to:
- reduce severity of gas spikes; and
- address chain reorganizations (reorgs) in an effort to reduce time to finality.
The timeline for the proposed Polygon mainnet hardfork is as follows:
- V0.3.1 Hardfork — Jan. 17, 2023
Below, there is a closer look at the proposed hardfork changes and why they might matter to users, validators, and developers. FAQ’s are included to help answer any burning questions about what the potential upgrades mean.
Upgrade #1: Reducing Gas Spikes
Change the BaseFeeChangeDenominator from the current value of 8 to 16. This will help smooth out the increase/decrease rate in baseFee for when the gas exceeds or falls below the target gas limits in a block.
In order for a transaction to be included in a block, a gas fee is required. The “base fee” is the minimum fee for block inclusion, and is set in accordance with EIP-1559. Although on-chain gas dynamics work well a majority of the time, when the chain experiences high demand, the base gas fee experiences exponential spikes.
Increased gas prices are normal during surges in demand on any blockchain protocol. But “gas spikes,” which represent exponential growth in price, are not. They are a result of EIP-1559 and the Polygon PoS chain’s faster block times (~2s.)
Expectation after the hardfork:
By increasing the denominator from 8 to 16, the growth curve can be flattened. These results were backtested against historical Polygon PoS mainnet data. The expectation is that the rate of change for the base gas fee will fall to 6.25% (100/16) from the current 12.5% (100/8) in an effort to smooth severe fluctuations in gas prices.
Although gas will still increase during peak demand, it will be more in line with the way Ethereum gas dynamics work now. The goal is to smooth out spikes and ensure a more seamless experience when interacting with the chain.
Upgrade #2: Addressing Chain Reorganizations (Reorgs)
Decrease the sprint length from 64 to 16 blocks. By reducing the length to 16 blocks, this upgrade means a single block producer will produce blocks continuously for a much shorter time (~32 sec) than the current (~128 seconds). Doing so will decrease the depth of reorgs.
“Sprint length” describes the number of blocks a validator produces contiguous blocks on Bor chain. By reducing sprint length, the time a validator continuously produces blocks decreases. The result? Lowering the chances of a secondary or tertiary validator (who hasn’t discovered the primary) kicking in to produce blocks, resulting in fewer reorgs overall.
Reorgs are possible due to the architecture of the Polygon PoS chain, which relies on probabilistic consensus. Finality for a transaction is achieved based on the number of confirmed valid blocks on top of the block containing a transaction. In the Polygon PoS chain, applications wait approximately 50 blocks before considering a transaction final.
A reorg occurs when a validator node receives new information that shows a longer, or higher version of the chain. The chain with the highest difficulty is called the “canonical” chain. If a longer version of the chain arrives with more blocks, this is the new canonical chain, and the old one must be discarded.
Reorgs may impact transaction finality and disrupt the ability of an application to be confident that their transactions are part of the canonical version of the chain.
Expectation after the hardfork:
By decreasing the sprint length, the hardfork will help reduce the frequency and depth of reorgs, and improve transaction finality.
The change will not affect the total time or number of blocks a validator produces, so there will be no change in rewards overall.
For more developer information about reorgs and gas spikes, check out the first episode of Polygon Builder’s Sessions:
- Q: Do delegators and those who simply hold MATIC need to do anything to prepare for the upcoming Polygon PoS upgrades?
A: No, these groups do not need to take any action to prepare for the upgrades.
- Q: Will dApps deployed on Polygon PoS be affected during or after the hardfork?
A: dApps deployed on Polygon PoS will not be affected during or after the hardfork.
- Q: Will Infrastructure providers to the Polygon PoS chain be impacted due to the hardfork?
A: All Polygon PoS nodes (sentry, full node, validator, or archive node) will need to upgrade Bor before Jan. 17. To keep their nodes in sync, they will need to upgrade.
- Q: What do validators need to do to prepare for the upcoming hardfork?
A: Detailed instructions can be found here.
These changes are proposals, and require network agreement for implementation.
Community members are encouraged to join in the forum discussions for a more detailed study of the proposed gas spikes and reorgs solution, as well as voice their thoughts on further improvements to the Polygon PoS chain. In the coming months, another hardfork aimed at improving the network likely will be proposed. Stay tuned for more details, and chime in to be part of the discussion.
Want to learn more about the latest in the Polygon ecosystem? Check out our Blog and subscribe to our social channels.
Together, we can build an equitable future for all through mass adoption of Web3!