# Upgrade coming to Flow Epoch Smart contracts for security improvement

**URL:** <https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443>\
**Category:** Flow Protocol\
**Created:** [December 5, 2023, 6:06pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443 "2023-12-05T18:06:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarak.by](https://avatars.discourse-cdn.com/v4/letter/t/6bbea6/32.png) [@tarak.by](https://forum.flow.com/u/tarak.by)\
**Post date:** [December 5, 2023, 6:06pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/1 "2023-12-05T18:06:24Z")

</div>

The Flow team has a tentative plan to upgrade the epoch smart contracts on mainnet on Januray 3rd. This is a security improvement upgrade so it will not break any smart contracts, node software, but may cause a minor change to event listeners. More details about the change below.

Expected dates to get the changes in effect is as follows:

- CanaryNet: Thursday, December 14th
- Testnet: Monday, December 18th

And assuming that the upgrades on the canary and testnet go well,

- Mainnet: Wednesday, January 3rd

This will give us enough time to make sure the upgrades are functioning properly on non-mainnet networks.

The change to `FlowEpoch` contract that will be used for the upgrade can be found in [this pull request](https://github.com/onflow/flow-core-contracts/pull/397). The changes are documented in the PR.

The change is backward compatible for the node software. However it may bring a change to `EpochSetup` event listeners as it updates the event field `randomSource`. The field becomes a hex string of exactly 32 characters, instead of a decimal string of up to 20 characters.

_Note - We are open to changing the timeline if the community provides feedback on the suggested change._

If you have any questions regarding these changes, please ask in the PR comments, on Discord in the `#protocol-builders` channel, or reply here.

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [December 14, 2023, 9:53pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/2 "2023-12-14T21:53:08Z")

</div>

The contract is updated on Canary

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [December 15, 2023, 7:59pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/3 "2023-12-15T19:59:49Z")

</div>

There is a small bug fix to the locked tokens contract that I am going to include during this upgrade. The change is [in this PR](https://github.com/onflow/flow-core-contracts/pull/400). It has already been done on testnet and will be done at the same time as these upgrades on testnet and mainnet

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [December 18, 2023, 1:45pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/4 "2023-12-18T13:45:59Z")

</div>

The contracts have been updated on testnet. I’m having some CI issues in the PR that I need to fix before merging though, but we should be good to upgrade on mainnet in Jan assuming everything goes fine on testnet

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [January 2, 2024, 4:32pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/5 "2024-01-02T16:32:03Z")

</div>

We’re gonna push back the mainnet uprade to Jan 10th

---

<div class="post-metadata">

**Author:** ![flowjosh](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.flow.com/flowjosh/32/362_2.png) [@flowjosh](https://forum.flow.com/u/flowjosh)\
**Post date:** [January 10, 2024, 4:27pm UTC](https://forum.flow.com/t/upgrade-coming-to-flow-epoch-smart-contracts-for-security-improvement/5443/6 "2024-01-10T16:27:33Z")

</div>

The contract has been upgraded on mainnet: [Flow Diver: Flow Blockchain Explorer](https://www.flowdiver.io/tx/a10c01a57095365a2d535556834b6d19c7d2a441d9b5ac18aba684af4895b804)
