Skip to content

Conversation

@jayantk
Copy link
Contributor

@jayantk jayantk commented May 12, 2025

Summary

Three minor changes:

  1. rename "providerRandomNumber" and "userRandomNumber" to xContribution for clarity.
  2. emit these contributions in the new EventsV2 revealed event (so users can generate a retry call in forge from the event, without hitting the fortuna API)
  3. update docs around how the protocol works and security assumptions (this was a comment from AR)

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

@vercel
Copy link

vercel bot commented May 12, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
entropy-debugger ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
entropy-explorer ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
insights ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 12, 2025 4:18pm

assertTrue(
random.getProviderInfoV2(provider1).defaultGasLimit == 0 ||
(callbackGasUsed < (callbackGasUsage * 110) / 100)
assertRevealedEvent(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

extracted the test out to a method. the factoring could be a bit odd because i'm working around the solidity "stack too deep" error

// 3. A and B reveal x_{A,B}
// 4. Both parties verify that hash(x_{A, B}) == h_{A,B}
// 5. The random number r = hash(x_A, x_B)
// 1. Two parties A and B each randomly sample a contribution x_{A,B} to the random number
Copy link
Contributor

Choose a reason for hiding this comment

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

can you update the docs as well to make this consistent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah will do

@jayantk jayantk merged commit f9f8dd9 into main May 12, 2025
12 checks passed
@jayantk jayantk deleted the entropy_error17 branch May 12, 2025 21:51
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