Magic Dragon Dao and the Arbitrum gas battle

Magic Dragon DAO
3 min readJul 19, 2022

--

We’ve been investigating the transaction failures and MetaMask issues with the Magic Dragon Dao (MDD) A Tempting Offer pool, and unfortunately they are all gas-related. In order to support real-time accumulation of $magic rewards for all of our Disciples, we harvest rewards from the Atlas Mine on every user action — deposit, withdrawal, or claim. This causes all user actions to be gas-intensive; until now, this has not been a problem, since transaction costs on Arbitrum remain inexpensive. However, over time, the MDD pool has built up more and more deposits — our contract currently has 77 separate deposits in the Atlas Mine. Each new deposit must be harvested as described above, so it increases the gas cost for every transaction.

With the growing number of deposits and increased activity across the whole of Arbitrum, our transactions often trigger Arbitrum’s global “speed limit”. Although they remain cheap in ETH terms, triggering the speed limit means the transactions will fail. You can read more about the speed limit here: https://developer.offchainlabs.com/docs/arbgas. What this means is that gas conditions on Arbitrum are no longer conducive to supporting continual reward accumulation.

The MDD team has planned for this contingency, and in the coming days we will adopt a new staking pool architecture that puts a hard upper bound on the amount of gas used per transaction, preventing future failures. This new architecture introduces the following changes to our staking pool:

1) Instead of continual accrual, rewards will accumulate to users only during an “accrual window”. We will have two accrual windows per day: one from 0:00 UTC-1:00 UTC, and the other from 12:00 UTC-13:00 UTC. Rewards will continue to be earned at all times but will not be reflected in claimable MAGIC until the completion of one of these windows. For example, the MAGIC you earn between 1:00 UTC and 11:00 UTC won’t show up until after 13:00 UTC.

2) During the “accrual window”, we will harvest all rewards across our deposits into the Atlas Mine and across multiple transactions (since multiple transactions will reduce the amount of needed gas per transaction). These rewards will immediately accumulate to individual depositors.

3) Inside each accrual window, all deposits, claims and withdrawals will be paused, in order to keep reward accounting stable across the multiple harvesting transactions mentioned in step 2.

4) Outside of each accrual window, deposits, claims and withdrawals will work as normal. Rewards will continue to be earned by the staking pool from the Atlas Mine, but they will not be accessible to users until after completion of the next accrual window. Note that this means that accumulation is now a “point-in-time” event, as opposed to continuous and each depositor’s relative share only matters during each accrual window. This means it will become most capital efficient to deposit immediately before an accrual window and withdraw and/or claim rewards immediately after an accrual window.

We are working on these changes now and the team are happy to respond to any questions, comments or concerns about the new approach. We will continue to see intermittent failures until these changes are live and/or transaction activity on Arbitrum meaningfully decreases. Please note that even if your transactions are failing, your rewards are still accumulating. Nobody will have missed out on rewards once the fix goes live. Our current estimate for go-live to this fix is 2–3 weeks. The Dragon appreciates your patience and understanding as we work through this issue.

The path of the Dragon. The same yesterday and today and forever.

--

--