EIP1559 Implementation on Mumbai Testnet

As per community consensus and the previous discussions we had on our forum and community calls, we will be implementing EIP1559 as per the Ethereum spec https://github.com/ethereum/EIPs/blob/master/EIPS/eip-1559.md and burning baseFee Matic tokens on every block.

Our implementation of EIP1559, with the plan to go live on Mumbai Testnet next week, is as follows.

Burn Implementation

Since MATIC is an ERC20 token on Ethereum (L1), the logic for burning the base fee had to be implemented in such a way that the tokens are actually burnt on the root chain and not just on the Polygon PoS chain (L2). Below is a high-level overview of the implementation:

On the Polygon chain, there is a burn contract deployed at https://mumbai.polygonscan.com/address/0x70bcA57F4579f58670aB2d18Ef16e02C17553C38 where all the base fees from txs get transferred to. On the child chain, this contract only has the withdraw() method enabled and a receive() function to receive MATIC.

You can check the implementation here: https://github.com/maticnetwork/eip-1559-burn/blob/master/contracts/EIP1559Burn.sol

The withdraw method can be called by any address. Calling withdraw on the Polygon chain ensures that the accumulated amount (all the baseFee from different txs until that point) is burnt on the Polygon chain. Next, this needs to be burnt on the Ethereum chain.

On Ethereum, the contract is deployed at the same address https://goerli.etherscan.io/address/0x70bcA57F4579f58670aB2d18Ef16e02C17553C38. This is achieved by deploying the contract from a single account with the same nonce on both chains. After a checkpoint since the withdraw tx, the initiateExit method on the L1 burn contract is called which takes the predicate address and the burn proof as arguments. After waiting for the exit period, the exit method will be called which finally burns the ERC20 tokens on Ethereum by transferring them to 0x000000000000000000000000000000000000dEaD. Again, the methods can be called by any account on the Ethereum chain as well.

Here is a visual representation of the same:

We will add UI to initiate the burn process on our wallet very soon.

Rollout on Mumbai Testnet

We will hit the London Block where the EIP1559 and related EIPs will be activated on the testnet around 8AM UTC on Dec 14th 2021: https://mumbai.polygonscan.com/block/countdown/22640000

Since this is a hardfork, a genesis update will be required. Please follow the steps below to ensure your Mumbai Testnet nodes continue to sync after the London Block.

Please note that this is applicable only to the Mumbai Testnet.

Steps for Upgrading Bor on Mumbai Testnet Nodes

  1. Stop the bor service
sudo service bor stop
  1. Navigate to bor directory
cd ~/bor
  1. Fetch the latest changes and use Bor v0.2.13-beta1:
git fetch
git checkout v0.2.13-beta1
  1. Build latest changes
make bor-all
  1. Download the latest genesis file. We are activating the fork and burn contract address through the updated genesis.
curl https://raw.githubusercontent.com/maticnetwork/launch/6798732cc9f326a238c00ae9e13c3e86819f5a89/testnet-v4/sentry/sentry/bor/genesis.json --output ~/genesis.json
  1. Init bor with genesis file
bor --datadir ~/.bor/data init ~/genesis.json

If you are using a non-default datadir, please ensure you input the correct one you have been using.

  1. You should see the output as follows:
...
...
INFO [12-10|19:57:02.531] Successfully wrote genesis state         database=chaindata                            hash=...
...
INFO [12-10|19:57:02.556] Successfully wrote genesis state         database=lightchaindata                       hash=...
...
...
  1. Start the bor service
sudo service bor start
6 Likes

Nice job! Thank you for your hard work and commitment.

2 Likes

When I try to run the command “bor --datadir ~/.bor/data init ~/genesis.json”, the below error occurs:
Fatal: Failed to write genesis block: database contains incompatible genesis (have a9c28ce2141b56c474f1dc504bee9b01eb1bd7d1a507580d5519d4437a97de1b, new 7b66506a9ebdbf30d32b43c5f15a3b1216269a1ec3a75aa3182b86176a2b1ca7)

Any hints

Hi @patrick7244 , if you are seeing the ouput as per step (7), you can ignore the remaining errors/warnings.

I know on ethereum that we need to specify maxGasFee and maxPriorityFee while sending the transactions.
Is there any change for Dapps on mumbai testnet after this change ?

We will be supporting the new tx type where you specify maxGasFee and maxPriorityFee as well as continue to support the old tx type.