Latest network update: Replaying transactions after the rollback and how this impacts compensation…

Latest network update: Replaying transactions after the rollback and how this impacts compensation for stakeholders

gas fee

Hello all,

Context: As explained in a previous post, the Zilliqa chain had to be rolled back to block number 1,394,088. Post roll-back, all the rollbacked transactions were replayed. There were a total of 4,478 transactions out of which 1,230 transactions were to smart contracts like staking, ZILSwap, token transfers etc., and the remaining 3,248 were simple ZIL transfers, many of which seem to be mining payouts.

Replaying of the rolled back transactions was possible because the transaction data was available to the nodes as they had already processed those transactions post network upgrade. It is important to note that while we could replay all those transactions, some of them failed. And the failed transactions still cost gas to users. In essence, rolling back these transactions and then replaying them did not always yield the same result in the rolled back state as compared to the unrolled state.

For example, for ZILSwap transactions, it is possible that the replay of a ZILSwap trade transaction may fail due to slippage as the liquidity after the rollback could be very different or due to the expiration block that each trade includes.

A particular note to miners who have been mining the network: The rollback would cancel any mining reward that they may have received.

Replaying Transactions:

  1. Mining Rewards:

Mining rewards in Zilliqa are distributed directly at the protocol-layer and therefore there are no transactions to be replayed. For example, any reward going to a mining pool like directly from the protocol could not be replayed. For this group, we describe the compensation plan in the compensation section.

However, any reward distributed by a mining pool to the individual miners is considered as a regular ZIL transfer and has been replayed. So, if you are mining with mining pools like, all on-chain reward transactions from the pool have been replayed.

2. Users/Miners sending ZIL:

All transactions of this type have been successfully replayed. As part of the replaying process, any shortfalls have been covered by our treasury to ensure the transactions that were previously committed on-chain are 100% committed after the roll back.

A shortfall may happen in situations where miners had received mining rewards before the roll back, but lost those rewards due to the roll back, and therefore have a shortfall when sending ZIL transactions.

The top up by the treasury is separate from the compensation plan for the miners. As such, it is possible for a mining node to receive both the top up and the compensation.

3. Users interacting with contracts: These are transactions that trigger contracts like ZILSwap, Duck NFT Minting contract, staking and others. When we replayed such transactions, we compared the transaction result (success or failure) on the rolled back network as well as on the unrolled network and filtered out those which gave different results, e.g., success on rolled-back network but failure on the unrolled network. There were a total of 173 such transactions that gave different results on the two networks.

All the staking related replay transactions went through successfully on the rolled-backed network. Any user who withdrew staking rewards or staked back any ZIL would not see any difference in the rolled back version.

Several replay transactions for ZILSwap failed. This was mainly because 1) the rate could not be fulfilled on the rolled-back network 2) the block expired for the transaction, etc. All such transactions were basically reverted and funds were returned to the transaction initiators. The transaction initiators still were charged the gas fee. There were some transactions that failed on the unrolled network but succeeded on the rolled-back one.

For users who interacted with contracts like DUCK NFT, any transaction that failed in the rolled back version will get a refund modulo gas fees.

Compensating Users:

  1. Miners: Miners who mined blocks between DS epochs 13,941 and 13,950 will be rewarded using our treasury to compensate for the loss of mining rewards due to the roll back.

The formula we are using is: 204,000 ZIL per DS block / numbers of mining nodes excluding guard nodes.

Usually, guard node rewards are excluded and remain in the mining reward pool. However, as a sincere apology to all our miners, we will be adding this component to the compensation plan. As such, mining nodes can expect to get higher than average reward for the compensation. Compensation will be distributed on-chain directly to the address of the mining nodes.

This compensation will be disbursed in the next couple of days to the pools/miners and it’ll be up to the mining pools to compensate their customers from the rewards received.

2. Users sending ZIL: There will be no compensation for such transactions as all of these were successfully committed back to the rolled-back chain.

3. Users interacting with contracts: For transactions that either failed on the rolled-back network or on the unrolled network, we will look at the gas fees paid by the user and compensate them by 5x of the fees paid. We plan to do this in the next couple of days.

We would also like to reward the DUCK project team a sum of USD 30,000 (in ZIL) for reporting the bug to us. This is a small token of appreciation for their proactiveness. We will reach out to them in the next couple of days.

If you have any questions, please don’t hesitate to reach out to us on our usual channels!


gas fees

Latest network update: Replaying transactions after the rollback and how this impacts compensation… was originally published in Zilliqa — Official Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.

You May Also Like