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

fix(maat): proofs #600

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

fix(maat): proofs #600

wants to merge 6 commits into from

Conversation

cernicc
Copy link
Member

@cernicc cernicc commented Nov 22, 2024

Description

Fixes maat proofs and adds a script for future use.

@cernicc cernicc requested a review from aidan46 November 22, 2024 10:37
(
T::Hashing::hash(&[]),
Output::decode(&mut TrailingZeroInput::new(subject)).unwrap_or_default(),
Copy link
Contributor

Choose a reason for hiding this comment

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

What's going on here?

Copy link
Member Author

Choose a reason for hiding this comment

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

TrailingZeroInput adds zeros to subject and then decodes that. In our case we are using empty slice for subject. That is why we get [0; 32] randomness when called. Before the slice was hashed. Now it's only decoded.

While fixing the test I found TestRandomness. The latest commit uses that directly. So that we don't need to support our implementation.

) -> [u8; 32] {
// This randomness digest is hardcoded because it's always same on testnet.
// Check `PredictableRandomnessSource` struct for more details.
let digest = [0u8; 32];
Copy link
Contributor

Choose a reason for hiding this comment

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

But it's not [0u8; 32] on the testnet, right?

Copy link
Member Author

@cernicc cernicc Nov 22, 2024

Choose a reason for hiding this comment

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

Answered here. It is now :D

/// Sector number
#[arg(long)]
sector_id: u32,
/// The height at which we draw the randomness for deriving a sealed cid.
Copy link
Contributor

Choose a reason for hiding this comment

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

We should propose the defaults that were hardcoded here, If I were a new user, I wouldn't know where to put it and which number needs to be after which one.

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought that we will eventually remove those commands? The defaults were also specific for a single use case

@jmg-duarte jmg-duarte added the ready for review Review is needed label Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review Review is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants