# Gnosis merge TTD and bellatrix epoch On Gnosis core devs call it was agreed to target - Bellatrix epoch for Wednesday Nov 30th 2022 noon. - TTD for Monday Dec 5th 2022 noon. Gnosis chain (EL) per block difficulty is quasi-constant to `0xfffffffffffffffffffffffffffffffe`. The TD increase per unit of time is only a function of validators not sealing blocks on their turn. There has been some instability with validator performance in the last two months resulting in effective block times, see [gnosisscan.io/chart/blocktime](https://gnosisscan.io/chart/blocktime). In contrast to Ethereum, the delta TD per unit of time can only be strictly less or equal than `0xfffffffffffffffffffffffffffffffe / 5 sec`. So we'll pick a TTD assuming best case of effective block time of 5 sec. If the actual effective block time is less, the merge will happen latter but never before bellatrix. ## Bellatrix epoch - Gnosis beacon chain genesis time: 1638993340 - SLOTS_PER_EPOCH: 16 - SECONDS_PER_SLOT: 5 A fork epoch is convenient to be modulo: - EPOCHS_PER_SYNC_COMMITTEE_PERIOD = 512 to ensure no fork change during sync committee period - SLOTS_PER_HISTORICAL_ROOT = 8192 to not mix forks in historical roots, tho this doesn't hold for phase0 -> altair fork At the exact date that's epoch 385203.25 ```js (new Date("Nov 12 2022 01:51:00 GMT+0000").getTime()/1000 - 1638993340)/5/16 ``` The closest modulo `EPOCHS_PER_SYNC_COMMITTEE_PERIOD` are - 385024 at 2022-11-30T08:01:00.000Z `new Date((1638993340 + 385024*16*5)*1000)` - 385536 at 2022-11-30T19:23:40.000Z `new Date((1638993340 + 385536*16*5)*1000)` While 385024 is modulo SLOTS_PER_HISTORICAL_ROOT too, 19:00 UTC is better for current dev teams schedules. - **BELLATRIX_FORK_EPOCH: 385536** ## TTD Using https://gist.github.com/dapplion/94e767fb97bf7a364fc8f959f0d43b2f and playing around with values to get a round number on a reasonable hour. ``` $ node ttd.mjs "Dec 5 2022 12:06:28 GMT+0000" 0x17c9f89 TTD 8626000110427538733349499292577475819600217554 block 25349536 time 2022-12-05T12:06:28.000Z sec/b 5 Ref block 24944521 from https://rpc.gnosischain.com/ ``` Round to nearest trailing zeroes ``` 8626000110427538733349499292577475819600217554 8626000000000000000000000000000000000000000000 ``` To pay tribute to the Ethereum merge I propose to include Ethereum's TTD ([ref](https://notes.ethereum.org/@MarioHavel/merge-ttd)) into Gnosis TTD. ``` 8626000000000000000000000000000000000000000000 + 58750000000000000000000 ---------------------------------------------- 8626000000000000000000058750000000000000000000 ``` - **TERMINAL_TOTAL_DIFFICULTY: 8626000000000000000000058750000000000000000000**