-
Notifications
You must be signed in to change notification settings - Fork 473
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
Upgrading versions of snarkvm #884
Upgrading versions of snarkvm #884
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a few comments, but overall these look good, I'll check on the VerifyingKey issue you flagged
@@ -18,7 +18,7 @@ jobs: | |||
uses: actions-rs/toolchain@v1 | |||
with: | |||
profile: minimal | |||
toolchain: nightly-2023-05-24 | |||
toolchain: nightly-2024-05-14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this might be able to go to nightly-latest
? Opinions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I always lock rustc to a specific version, so that way it's reproducible and consistent for everybody. If it's nightly-latest
then it can cause breakage.
Note that the CI matches the version in rust-toolchain.yaml
, so that way the CI will match local dev builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that locking the version when using nightly is standard best practice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
wasm/Cargo.toml
Outdated
version = "=0.16.12" | ||
version = "0.16.19" | ||
git = "https://github.com/AleoNet/snarkVM.git" | ||
rev = "3ebe60c499285a140ec2171fe8dd06662c325531" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current Rev is: 140ff26 (I know this changed from under us since this process started)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely, I will update it before this gets merged.
array.push(&bonded); | ||
array.push(&unbonding); | ||
array.push(&account); | ||
let expected = array![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much cleaner thank you!
} | ||
|
||
/// Returns the verifying key for the bond_public function | ||
/// | ||
/// @returns {VerifyingKey} Verifying key for the bond_public function | ||
#[wasm_bindgen(js_name = "isBondPublicVerifier")] | ||
pub fn is_bond_public_verifier(&self) -> bool { | ||
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet3::BondPublicVerifier::load_bytes().unwrap()) | ||
self == &VerifyingKey::from_bytes(&snarkvm_parameters::testnet::BondPublicVerifier::load_bytes().unwrap()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good start, though we'll need to support mainnet soon as well. I'm fine focusing on only testnet for now and adding mainnet support in a future PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will support mainnet in another PR, that's a much bigger change.
This reverts commit 5044c76.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is good to go in. We'll need to update this to the very latest revision, but we can do that in a follow-on PR.
@@ -18,7 +18,7 @@ jobs: | |||
uses: actions-rs/toolchain@v1 | |||
with: | |||
profile: minimal | |||
toolchain: nightly-2023-05-24 | |||
toolchain: nightly-2024-05-14 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
verifier: "unbond_public.verifier.09873cd", | ||
verifyingKey: VerifyingKey.unbondPublicVerifier | ||
}, | ||
bond_public: convert(Metadata.bond_public()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this approach
This upgrades the version of snarkvm to the
mainnet-staging
branch.It still uses the testnet, it does not use the mainnet. I will add in mainnet capabilities in a future PR.
Most of the changes are trivial (renaming imports, etc.) but the
estimate_execution_fee
andestimate_finalize_fee
functions required more significant changes, so they should be reviewed more carefully.