Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update epoch setup random source #397

Merged
merged 14 commits into from
Dec 19, 2023
Merged

Conversation

tarakby
Copy link
Contributor

@tarakby tarakby commented Nov 30, 2023

  • fix a misalignment between the node software and the epoch core-contract: the core-contract emits an event containing the random source of the new epoch. The event includes the random source as a decimal string, while the node software expects a hexadecimal string. This does not cause a functional bug because every decimal string is a valid hexadecimal string. However this reduces the entropy of the random source read in the node software.
  • increase the epoch random source entropy from 64 to 128 bits, to address a security improvement in https://github.com/dapperlabs/flow-go/issues/6150 (the entropy generated by the Flow random beacon is about 128 bits). Therefore the randomSource field in the EpochStart event is updated from a string of variable number of characters (up to 20) to a string of exactly 32 characters.

Side changes:

  • use Cadence's revertibleRandom instead of unsafeRandom
  • update Cadence, flow-go, flow-emulator versions in lib/go/test

@tarakby tarakby marked this pull request as ready for review December 1, 2023 00:04
Copy link
Member

@joshuahannan joshuahannan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me, but we'll need to wait until we are ready to upgrade before we can merge

@tarakby
Copy link
Contributor Author

tarakby commented Dec 1, 2023

Sounds good. Feel free to block the PR and manage when you'd like to merge it.

lib/go/test/go.mod Outdated Show resolved Hide resolved
@joshuahannan
Copy link
Member

Upgraded on testnet, still trying to figure out these CI issues before I can merge here

@joshuahannan joshuahannan merged commit 0940b6b into master Dec 19, 2023
2 checks passed
@joshuahannan joshuahannan deleted the tarak/fix-epoch-random-source branch December 19, 2023 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants