Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Conversation

@aleph-v
Copy link
Contributor

@aleph-v aleph-v commented Apr 27, 2020

  • Tag the PR with wip while in development.
  • Assign yourself as to the PR
  • Assign relevant labels such as bug, enhancement.
  • Request reviews if the PR is large, complex or you would like an extra pair of eyes to go over it.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the Changelog.md.
  • Update version numbers as needed.

Semver: https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md

https://semver.org/

@aleph-v aleph-v requested a review from recmo April 28, 2020 16:41
.gitignore Outdated
# Soldity artifacts
crypto/stark-verifier-ethereum/artifacts
crypto/stark-verifier-ethereum/cache
crypto/stark-verifier-ethereum/typechain
Copy link
Contributor

Choose a reason for hiding this comment

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

It's better to keep this in the crypto/stark-verifier-ethereum/.gitignore. If we ever move the folders around or rename them, this would break and you wouldn't think of looking here. If you keep it in a local .gitignore everything will just work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove these, now that they are in the local file again.

for (uint256 i = coefficents.length - 2; i > 0; i--) {
b = fmul(b, x);
b = fadd(b, coefficents[i]);
require(coefficents.length > 0, 'Evaluation undefined');
Copy link
Contributor

Choose a reason for hiding this comment

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

It would make sense to define this as zero. OTOH it's easy to accidentally have zero arrays, so an explicit [0] avoids accidents. (No action)


// This trivial Fibonacci system returns constant values which are true only for one proof
// It should only be used for testing purposes
contract Recurance is ConstraintSystem {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Recurrence

(and in a couple more places)

struct Options {
// The number of occurrences of the `v/verbose` flag
/// Verbose mode (-v, -vv, -vvv, etc.)
#[allow(clippy::cast_possible_truncation)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this cast happen? In the argument parsing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is actually something, that I don't know. I haven't touched this function at all and this error popped up. I can a todo which says to investigate

Copy link
Contributor

Choose a reason for hiding this comment

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

Todo would be good!


#[derive(Clone, Debug, PartialEq)]
pub struct Proof(Vec<u8>);
pub struct Proof(pub Vec<u8>);
Copy link
Contributor

Choose a reason for hiding this comment

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

Member should not be pub, use as_bytes() instead. This needs to change.


impl SoliditySeralize for Commitment {
fn sol_encode(&self) -> String {
format!("\"0x{}\"", encode(self.hash().as_bytes()))
Copy link
Contributor

Choose a reason for hiding this comment

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

Delegate to self.hash().sol_encode() ?

}
}

// TODO - Make this function smaller
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the problem is that Proof has no structure. This needs to change firsts. Out of scope for this PR though.

value: FieldElement,
exponent: usize,
index: usize,
pub(crate) value: FieldElement,
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm.. we should really use this struct outside of this module. But this probably requires a refactor of the test constraints. Out of scope for this PR.

Copy link
Contributor

@recmo recmo left a comment

Choose a reason for hiding this comment

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

Looks great! I think you forgot to remove the patsh form /.gitignore. Otherwise good to go!

.gitignore Outdated
# Soldity artifacts
crypto/stark-verifier-ethereum/artifacts
crypto/stark-verifier-ethereum/cache
crypto/stark-verifier-ethereum/typechain
Copy link
Contributor

Choose a reason for hiding this comment

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

Please remove these, now that they are in the local file again.

struct Options {
// The number of occurrences of the `v/verbose` flag
/// Verbose mode (-v, -vv, -vvv, etc.)
#[allow(clippy::cast_possible_truncation)]
Copy link
Contributor

Choose a reason for hiding this comment

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

Todo would be good!

@aleph-v aleph-v merged commit 7850bac into master Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants