Skip to content

Conversation

@raugfer
Copy link
Collaborator

@raugfer raugfer commented May 23, 2025

Pull Request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build-related changes
  • Documentation content changes
  • Testing
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this introduce a breaking change?

  • Yes
  • No

Other information

Comment on lines +111 to +112
if signature.is_zero() {
Option::None
Copy link
Collaborator

@feltroidprime feltroidprime Jun 10, 2025

Choose a reason for hiding this comment

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

What we can do is the following:
full_proof_with_hints can be the concatenation of the DrandDecryptHint || DrandHint (optionally).

Therefore, if the sig is not available for this round, the contract can call the verify_round function with the rest of the array to get the signature.

Client side, the tooling would check if the sig is available for this round, and would append or not the DrandHint to the full_proof_with_hints array based on the contract storage having the sig ready or not.

Contract side, the flow can look like :

if signature.is_zero() {
let signature = verify_round(ref full_proof_with_hint) } // First deserialization using ref "advanced" the array (the DrandDecryptHint got popped out) so we can just pass it.

// flow continues.

Therefore, if contract has sig : Contract doesn't call verify_round/
client send drand decrypt + drand hint : it just dismiss the drand hint calldata
client send drand decrypt only : "optimal" case

if contract does not have the sig stored,  Contract call verify_round :
client send drand decrypt + drand hint : "second part" of calldata is used there
client send drand decrypt only : Contract will fail at de serializing the second part since it's empty

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I will make the changes

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.

2 participants