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

[Tracking] Pre-release of the mainnet branch #2199

Draft
wants to merge 1,011 commits into
base: testnet3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
1011 commits
Select commit Hold shift + click to select a range
5835a86
perf: reduce allocations in ToBits for Plaintext
ljedrz May 20, 2024
35a94bf
Merge branch 'mainnet-staging' into perf/identifier_literal_type_parsing
raychu86 May 20, 2024
3f95b38
Minor fixes to credits.aleo
chirswomack May 20, 2024
88f8d9c
Add rewards tests
evanmarshall May 21, 2024
4d834b9
Merge remote-tracking branch 'AleoNet/mainnet-staging' into update-cr…
evanmarshall May 21, 2024
c792427
refactor: use type_name instead of literals for LiteralType::parse
ljedrz May 21, 2024
b028884
Fix bugs
evanmarshall May 21, 2024
acfd327
Lint
evanmarshall May 21, 2024
1a13a11
Remove unnecessary cast; update documentation
howardwu May 21, 2024
c04380b
Update to pr feedback
evanmarshall May 22, 2024
26a4f62
Remove microcredits from claim_unbond_public
evanmarshall May 22, 2024
a6256eb
Add num_variables to testnet verifier byte serialization
raychu86 May 22, 2024
644c5ee
Add num_variables to mainnet verifier byte serialization
raychu86 May 22, 2024
cab1c0d
Introduce TestnetV1 network
raychu86 May 22, 2024
dfd00e6
Introduce TestnetV1Circuit and AleoTestnetV1
raychu86 May 22, 2024
6120c67
Add parameter synthesis for TestnetV1
raychu86 May 22, 2024
a8b0c82
Add parameters for TestnetV1
raychu86 May 22, 2024
2abf0e1
Add TestnetV1 ID parsing
raychu86 May 22, 2024
895952f
Regenerate genesis block
raychu86 May 22, 2024
9493c43
Regenerate genesis block
raychu86 May 23, 2024
1da43ab
Update the genesis coinbase and proof targets
raychu86 May 23, 2024
d638448
Introduce CanaryV0
raychu86 May 23, 2024
757e5d5
Merge pull request #2458 from ljedrz/perf/plaintext_bits_allocs
howardwu May 23, 2024
a471281
Merge pull request #2454 from ljedrz/perf/identifier_literal_type_par…
howardwu May 23, 2024
dbc101b
Merge pull request #2459 from ljedrz/refactor/futureproof_literals
howardwu May 23, 2024
9d956dd
Merge pull request #2450 from ljedrz/feat/cfg_sorted_by
howardwu May 23, 2024
fa04451
Modify CI to use CircleCI's runners
zosorock May 23, 2024
f6ace91
Merge pull request #2452 from AleoNet/only_abort_deploys_early
howardwu May 23, 2024
a68e2a1
Merge branch 'mainnet-staging' into fix/stored-parameters
howardwu May 23, 2024
13b3efa
Use parameters::canary
raychu86 May 23, 2024
0bd71b5
Merge pull request #2463 from AleoHQ/feat/testnetv1
howardwu May 23, 2024
f197796
Merge branch 'mainnet-staging' into fix/stored-parameters
howardwu May 23, 2024
a8c0b2d
Merge pull request #2462 from AleoHQ/fix/stored-parameters
howardwu May 23, 2024
b2afacb
Merge mainnet-staging
raychu86 May 23, 2024
6a0d537
Fix parameters and upload remote keys
raychu86 May 23, 2024
48d4c21
nit: improve ambiguity of method names
howardwu May 23, 2024
078bd05
adding new Testnet genesis block with new coinbase and proof targets
zosorock May 23, 2024
ee30b9f
Improve performance of staking reward computation; ensure commission …
howardwu May 24, 2024
aa370c2
nit: fix test name
howardwu May 24, 2024
54c17c0
Revert "Merge pull request #2462 from AleoHQ/fix/stored-parameters"
zosorock May 24, 2024
a129de0
Revert "Merge pull request #2463 from AleoHQ/feat/testnetv1"
zosorock May 24, 2024
1816887
Revert "Merge pull request #2452 from AleoNet/only_abort_deploys_early"
zosorock May 24, 2024
1f9aef2
Revert "Merge pull request #2450 from ljedrz/feat/cfg_sorted_by"
zosorock May 24, 2024
10ec10d
Revert "Merge pull request #2459 from ljedrz/refactor/futureproof_lit…
zosorock May 24, 2024
d85b49d
Revert "Merge pull request #2454 from ljedrz/perf/identifier_literal_…
zosorock May 24, 2024
1ce3cb3
Revert "Merge pull request #2458 from ljedrz/perf/plaintext_bits_allocs"
zosorock May 24, 2024
c9376a5
Improve to_next_committee performance
howardwu May 24, 2024
a51aa9e
Improve to_next_committee performance further
howardwu May 24, 2024
91f5b41
Fix commission test to match updated staking_reward calculations
raychu86 May 24, 2024
69b3876
nit: improve readability of microcredits logic in committee_and_deleg…
howardwu May 24, 2024
9aeb28f
nit: expand on documentation and context
howardwu May 24, 2024
a67e5c6
Adds unbonding check in bond_public (fix); reduce number of finalize …
howardwu May 24, 2024
89491f0
nit: minor line changes in unbond_public; update comments
howardwu May 24, 2024
f7e5caa
nit: update comments in unbond_public
howardwu May 24, 2024
af7f94d
nit: fix comment in unbond_public
howardwu May 24, 2024
808b015
nit: fix comment in unbond_public
howardwu May 24, 2024
a165eb6
Update header image link
zosorock May 24, 2024
8ba7dc5
Resample genesis blocks
raychu86 May 24, 2024
c891ca2
Merge pull request #2465 from AleoNet/revert-multiple-prs
apruden2008 May 24, 2024
e0d378e
Merge branch 'mainnet-staging' into update/testnetv0-genesis-target
zosorock May 24, 2024
393b8fb
Merge pull request #2464 from AleoNet/update/testnetv0-genesis-target
apruden2008 May 24, 2024
2ad22c0
Update storage fee equation to be quadratic after the penalty threshold
iamalwaysuncomfortable May 24, 2024
56501d8
Merge branch 'mainnet-staging' into storage-price-penalty
iamalwaysuncomfortable May 25, 2024
14d033c
Update test expectations that reflect new fees
iamalwaysuncomfortable May 25, 2024
980444b
Update tests
evanmarshall May 27, 2024
02f65f3
Fix check for skipping rewards
evanmarshall May 28, 2024
a7ff5de
Revert "Revert "Merge pull request #2463 from AleoHQ/feat/testnetv1""
vicsn May 28, 2024
788fac2
Use updated genesis block for canary
vicsn May 28, 2024
57b16db
Merge pull request #2470 from AleoNet/revert-revert-canary-network-trait
zosorock May 29, 2024
b8ea777
fix: unpause atomics on block insert error
niklaslong May 17, 2024
8961bfb
fix: no need to revert the tree on block insert error
niklaslong May 17, 2024
3fe8bc5
Fix tests
evanmarshall May 29, 2024
933782c
adding updated canary genesis block
zosorock May 30, 2024
9c3bd7f
Merge pull request #2471 from AleoNet/upd/canary-genesis-block
zosorock May 30, 2024
aabb62e
fix committee_members test
vicsn May 29, 2024
adb942a
Update test expectations
vicsn May 29, 2024
cf338a4
Merge remote-tracking branch 'aleonet/mainnet-staging' into update-cr…
vicsn May 30, 2024
e52e9db
Update genesis block size expectations
vicsn May 30, 2024
5547410
Update Canary genesis block
vicsn May 30, 2024
74a4378
Merge pull request #2453 from demox-labs/update-credits
alzger May 30, 2024
fa39471
updating parameters CDN url
zosorock Jun 3, 2024
89de1f1
Fix typos
ghostant-1017 Jun 5, 2024
21cbc0c
Duplicate with 2.
ghostant-1017 Jun 5, 2024
2c9cdd3
Fix typos
ghostant-1017 Jun 5, 2024
3696b0d
tests: add a case for atomic unpausing on insertion error
ljedrz Jun 5, 2024
8dc3011
chore: adjust the lockfile
ljedrz Jun 5, 2024
bb6caa7
use parameters to simplify config file updates
robwafle Jun 4, 2024
727b904
Rename Solution to PartialSolution
raychu86 May 24, 2024
f4211e4
Introduce Solution that serializes the target
raychu86 May 24, 2024
7a18d74
Add checks against incorrect targets
raychu86 May 24, 2024
928f339
Adds get_proof_target_unchecked
howardwu Jun 4, 2024
ce115ec
Revert "Revert "Merge pull request #2452 from AleoNet/only_abort_depl…
vicsn Jun 5, 2024
122bb37
Increase mainnet MAX_CERTIFICATES, and thereby max number of validators
vicsn Jun 5, 2024
dac33b6
Add back anf prefix
vicsn Jun 6, 2024
4736201
Merge pull request #2477 from ProvableHQ/test-circleci-fix-four
zosorock Jun 6, 2024
0752ec2
Merge branch 'mainnet-staging' of https://github.com/AleoHQ/snarkVM i…
howardwu Jun 6, 2024
81fda23
Merge branch 'mainnet-staging' of https://github.com/AleoHQ/snarkVM i…
howardwu Jun 6, 2024
09ffd18
Updates the restrictions ID to include the literal
howardwu Jun 6, 2024
e8e59b7
Adds loading from network-specific restrictions lists
howardwu Jun 6, 2024
a122c73
Adds the restrictions list comparison test for each network
howardwu Jun 6, 2024
d01cc78
perf: speed up Identifier::from_str
ljedrz Jun 7, 2024
c9c244a
chore: adjust the lockfile
ljedrz Jun 7, 2024
93773bd
Further parallelize CI
vicsn May 30, 2024
322db5b
Reduce duration of tests
vicsn Jun 4, 2024
feafc77
Update CircleCI config to run Provable CI
vicsn Jun 7, 2024
adb6512
WIP
d0cd Jun 7, 2024
0a3d517
Use big CI machines
vicsn Jun 7, 2024
339f1f9
Update CircleCI resource
vicsn Jun 7, 2024
5b556f5
Fix test expectation
vicsn Jun 7, 2024
113cfd4
Update CI
zosorock Jun 7, 2024
b724218
WIP
d0cd Jun 7, 2024
e579d0a
Update the restrictions.json to include the restrictions ID
howardwu Jun 8, 2024
43b5841
Merge branch 'feat/restricted-list' of https://github.com/AleoHQ/snar…
howardwu Jun 8, 2024
06bba06
Add const fn to Restrictions
howardwu Jun 8, 2024
d0495d7
Revert CircleCI config adjustments
vicsn Jun 8, 2024
e3bc4f5
Fix and cleanup
d0cd Jun 9, 2024
9d0771f
Cleanup
d0cd Jun 10, 2024
c969251
Merge branch 'mainnet-staging' into storage-price-penalty
iamalwaysuncomfortable Jun 10, 2024
539d2fb
Update CI
zosorock Jun 10, 2024
f7700ec
Change storage cost computation to saturating mul + write tests to bo…
iamalwaysuncomfortable Jun 10, 2024
ba3cb0f
Update CircleCI config
zosorock Jun 10, 2024
94b1081
Updated config.yml
zosorock Jun 10, 2024
473a05f
Update .circleci/config.yml
zosorock Jun 10, 2024
01750e3
Merge branch 'mainnet-staging' into upd/param-urls
zosorock Jun 10, 2024
0f382b6
Merge pull request #2480 from AleoNet/upd/param-urls
zosorock Jun 10, 2024
9e01755
Fix CI resource name
vicsn Jun 10, 2024
5050cb1
Merge pull request #2457 from niklaslong/fix/atomics
zosorock Jun 11, 2024
f36c545
Update synthesizer/src/vm/helpers/rewards.rs
ghostant-1017 Jun 11, 2024
4e54c11
Merge pull request #2483 from ProvableHQ/abort_invalid_fee_early
zosorock Jun 11, 2024
86af0f9
Merge pull request #2481 from ljedrz/perf/identifier_literal_type_par…
zosorock Jun 11, 2024
5a089b7
Merge pull request #2485 from ProvableHQ/feat/serialize-target
zosorock Jun 11, 2024
5a2a369
Merge pull request #2486 from ProvableHQ/increase_num_validators
zosorock Jun 11, 2024
6e6cfa6
Merge pull request #2484 from ProvableHQ/ci_parallelize_test
zosorock Jun 11, 2024
43e681f
Merge pull request #2475 from ghostant-1017/cedric/fix
zosorock Jun 11, 2024
da597c8
Update CI config.yml
zosorock Jun 11, 2024
90f384a
Merge remote-tracking branch 'aleonet/mainnet-staging' into feat/rest…
vicsn Jun 11, 2024
30fb8a1
Upload parameters
vicsn Jun 11, 2024
9a02db8
Change quadratic storage cost penalty divisor to 5000
iamalwaysuncomfortable Jun 11, 2024
a293ca0
Formatting nit
iamalwaysuncomfortable Jun 11, 2024
c93fb26
Update test expectations
iamalwaysuncomfortable Jun 11, 2024
a3c9403
Merge pull request #2487 from ProvableHQ/feat/restricted-list
zosorock Jun 11, 2024
c75bc71
updating to Canary genesis block v0.2.1 - sha256 c460475dd6575cbed58d…
zosorock Jun 11, 2024
e9b351e
Merge remote-tracking branch 'foundation/mainnet-staging' into feat/l…
d0cd Jun 11, 2024
265c23f
Merge pull request #2491 from ProvableHQ/update_parameters
zosorock Jun 11, 2024
6395a59
Merge pull request #2456 from AleoNet/storage-price-penalty
zosorock Jun 11, 2024
dcb0225
Merge branch 'mainnet-staging' into upd/canary-genesis-0.2.1
zosorock Jun 11, 2024
735b383
Merge branch 'AleoNet:mainnet-staging' into feat/log-credits-mappings
d0cd Jun 12, 2024
7efdedd
New Canary genesis block - sha256 26a13c930e65f01bb04515b29315081561b…
zosorock Jun 12, 2024
e3fc833
Update links
zosorock Jun 12, 2024
7cf1795
Updated header image and links
zosorock Jun 12, 2024
454d555
Merge pull request #2492 from AleoNet/upd/canary-genesis-0.2.1
zosorock Jun 12, 2024
f2b14e3
Address feedback
d0cd Jun 13, 2024
38666d0
Fix grouping
d0cd Jun 13, 2024
a084a31
Remove unused method
d0cd Jun 13, 2024
c7ca7f4
Fix
d0cd Jun 13, 2024
7e31e10
Clippy
d0cd Jun 13, 2024
8e8fd2b
Add metadata and withdraw mappings
d0cd Jun 14, 2024
057573f
Merge branch 'mainnet-staging' into feat/log-credits-mappings
d0cd Jun 14, 2024
6d64025
Merge pull request #2493 from ProvableHQ/feat/log-credits-mappings
apruden2008 Jun 14, 2024
8c3c74d
Turn off error log for prebonds
HarukaMa Jun 15, 2024
0a44747
Fix check for bond_validator increasing number of validators beyond M…
evanmarshall Jun 19, 2024
7f6fe66
Fix test: the bug was that an address was still captured by the check…
evanmarshall Jun 19, 2024
dbcc729
resource class changes
zosorock Jun 21, 2024
ca98d1d
let them run it
zosorock Jun 21, 2024
456f644
new header image url
zosorock Jun 21, 2024
d3abd29
Update sizes.
jhaineault-aleo Jun 21, 2024
a7c8fd8
Update size to aleonet/2xlarge
jhaineault-aleo Jun 22, 2024
17b2e57
Merge pull request #2495 from HarukaMa/HarukaMa-patch-1
zosorock Jun 22, 2024
38e7ad8
Merge pull request #2498 from demox-labs/fix-bond-validator-check
zosorock Jun 22, 2024
246f68d
modify sizes
zosorock Jun 22, 2024
61f0a40
Links and resource adjustments
zosorock Jun 22, 2024
8a05317
Merge pull request #2501 from AleoNet/fix/readme-header-img
zosorock Jun 22, 2024
9b3958a
Update puzzle
d0cd Jun 24, 2024
9eeeb7c
CI
d0cd Jun 25, 2024
4ffae68
Fix CI
d0cd Jun 25, 2024
0c201c8
Update targets
d0cd Jun 25, 2024
7e0175f
Update Network trait
d0cd Jun 25, 2024
bdd0f69
Update test expectations
vicsn Jun 25, 2024
d1dbad4
Merge pull request #2502 from ProvableHQ/feat/update-puzzle
apruden2008 Jun 25, 2024
84648d1
Merge branch 'mainnet-staging' into feat/update-target
d0cd Jun 25, 2024
5541e64
Minor fixes for checks
raychu86 Jun 26, 2024
39777a3
nit
raychu86 Jun 26, 2024
0fe3061
Cleanup check
raychu86 Jun 26, 2024
40e3553
Update genesis blocks
d0cd Jun 26, 2024
bb98e68
Update test
d0cd Jun 26, 2024
d170a9f
Merge pull request #2503 from ProvableHQ/feat/update-target
apruden2008 Jun 26, 2024
87e611c
Add check for num inputs/outputs in transition
raychu86 Jul 1, 2024
f12c33d
Add test for checking mutated transitions
raychu86 Jul 1, 2024
2813781
Update AleoHQ/snarkVM to AleoNet/snarkVM
raychu86 Jul 2, 2024
551ed6a
Add homepage and repository to Cargo.toml
raychu86 Jul 2, 2024
c071fe1
Introduce check_solution_mut
raychu86 Jul 18, 2024
0adef62
Add tests for solutions
raychu86 Jul 19, 2024
74f19b0
Add checksum to transmission_id
vicsn Jul 19, 2024
8a73a85
Fix CI config
vicsn Jul 19, 2024
fa3a03d
Nit: Minor optimization
raychu86 Jul 19, 2024
3adb1e2
nit: test pref
raychu86 Jul 19, 2024
baa7f81
nit
raychu86 Jul 19, 2024
3557215
WIP: start migration to checksum as fixed-size array of bytes
vicsn Jul 19, 2024
b0d34da
Use u128 as the checksum
raychu86 Jul 19, 2024
ef22564
Add helper method and minor serialization fix
raychu86 Jul 19, 2024
2322a93
Add transmission checksum to partially_verified_transactions
raychu86 Jul 19, 2024
8c14fa5
Add additional checksum checks to verification
raychu86 Jul 19, 2024
f48330b
Add helper method
raychu86 Jul 20, 2024
8f2c014
Nit: change test ordering
raychu86 Jul 22, 2024
b8d8cc2
Merge pull request #23 from ProvableHQ/fix/solution-verification
raychu86 Jul 24, 2024
653cc1b
Nit: documentation and naming
raychu86 Jul 24, 2024
a6d175a
Ensure ID uniquness in subdag checks
raychu86 Jul 25, 2024
ef547d9
Merge pull request #2511 from ProvableHQ/additional-tx-checks
zosorock Jul 29, 2024
68f4f31
Merge pull request #2521 from ProvableHQ/fix/transmission-checksum
zosorock Jul 29, 2024
0043a34
adding new genesis block with TransmissionID checksum (PR #2541)
zosorock Jul 30, 2024
f8a8636
updating genesis block size
zosorock Jul 30, 2024
d796e13
renaming genesis json files
zosorock Jul 30, 2024
3d8b912
Merge pull request #2522 from zosorock/canary/v0.4.0
zosorock Jul 30, 2024
fa49973
Don't assume solution checksum consistency in check_subdag_transmissions
vicsn Aug 1, 2024
83795c1
Merge pull request #2524 from ProvableHQ/dont_expect_solution_checksu…
zosorock Aug 2, 2024
2a48a03
Merge branch 'mainnet-staging' into chore/repo-reference
raychu86 Aug 5, 2024
7263746
adding new genesis block for Testnet v0.4.0
zosorock Aug 6, 2024
be171ce
Merge pull request #2528 from zosorock/testnet/v0.4.0
zosorock Aug 6, 2024
7e7f398
caching parameter downloads so we don't get rate limited by AWS.
vicsn Jul 31, 2024
55faed3
Add forged block test
raychu86 Aug 12, 2024
aefccaa
Add check for consequtive rounds
raychu86 Aug 12, 2024
0ead66b
Add is_linked checks in subdag
raychu86 Aug 13, 2024
2929fe1
Implement tests for blocks with forged subdags
raychu86 Aug 15, 2024
99db484
nits
raychu86 Aug 15, 2024
f483953
Add documentation
raychu86 Aug 16, 2024
67be106
nits
raychu86 Aug 22, 2024
2482c9b
refactor: use explicit wrapping addition in Fp*::mul_assign
ljedrz Aug 22, 2024
88a0d80
Use a seeded rng for inputs and substack during deployment verification
raychu86 Aug 23, 2024
6296b95
Add tests for deployment verification consistency
raychu86 Aug 23, 2024
1c6c84d
Revert "refactor: use explicit wrapping addition in Fp*::mul_assign"
raychu86 Aug 26, 2024
7e8005c
Simplify test
raychu86 Aug 26, 2024
0dffb36
Merge pull request #2535 from ProvableHQ/fix/deployment-verification
zkxuerb Aug 27, 2024
5bb50a8
Merge pull request #2537 from ProvableHQ/fix/subdag-verification
zkxuerb Aug 27, 2024
e5a8021
Add test_load_bytes_mini
vicsn Aug 27, 2024
1e13403
Use medium machine
vicsn Aug 28, 2024
494521b
Use large machine
vicsn Aug 28, 2024
4803bb0
adding mainnet genesis block
zosorock Sep 3, 2024
62f330f
updating genesis block timestamp
zosorock Sep 4, 2024
4812cab
genesis block with updated timestamp
zosorock Sep 4, 2024
4b3dee4
mainnet genesis block with updated timestamp
zosorock Sep 4, 2024
e39e130
new mainnet genesis block with updated timestamp
zosorock Sep 4, 2024
02994a1
Merge pull request #2542 from zosorock/mainnet-beta/v0.1.0
zosorock Sep 4, 2024
812d6e8
Update license headers
raychu86 Sep 6, 2024
ec247fa
Merge branch 'mainnet-staging' into chore/repo-reference
raychu86 Sep 9, 2024
83707b8
nit
raychu86 Sep 9, 2024
49bc10e
Merge pull request #2547 from ProvableHQ/update-license
aleojohn Sep 10, 2024
dd96892
Merge pull request #2523 from ProvableHQ/test_param_cache
aleojohn Sep 10, 2024
abd6cc4
Merge pull request #2512 from ProvableHQ/chore/repo-reference
aleojohn Sep 10, 2024
c5ecfe6
Fix file line count
raychu86 Sep 10, 2024
3d42aa0
Merge pull request #2548 from ProvableHQ/fix/updatable-count
zosorock Sep 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run snarkVM Benchmarks
on:
push:
branches:
- 'testnet3'
- 'mainnet'

jobs:
# Run benchmarks and stores the output to a file
Expand Down
18 changes: 10 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<a href="https://circleci.com/gh/AleoHQ/snarkVM"><img src="https://dl.circleci.com/status-badge/img/gh/AleoHQ/snarkVM/tree/testnet3.svg?style=svg"></a>
<a href="https://circleci.com/gh/AleoHQ/snarkVM"><img src="https://dl.circleci.com/status-badge/img/gh/AleoHQ/snarkVM/tree/mainnet.svg?style=svg"></a>
<a href="https://codecov.io/gh/AleoHQ/snarkVM"><img src="https://codecov.io/gh/AleoHQ/snarkVM/branch/master/graph/badge.svg?token=cck8tS9HpO"/></a>
<a href="https://discord.gg/aleo"><img src="https://img.shields.io/discord/700454073459015690?logo=discord"/></a>
<a href="https://twitter.com/AleoHQ"><img src="https://img.shields.io/twitter/follow/AleoHQ?style=social"/></a>
Expand Down
10 changes: 2 additions & 8 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@

The following describes our procedure for addressing major and minor security concerns in snarkVM.

## Testnet

As Aleo is currently in the prototype stage and does not operate a platform intended for production use,
our security procedures are designed to promote public disclosure and quick security resolution.

In preparation for the production stage, we will release new security guidelines and
issue new procedures for addressing the disclosure of sensitive security vulnerabilities.
Our security procedures are designed to promote public disclosure and quick security resolution.

### Reporting a Bug

During Testnet, all software bugs should be reported by filing a Github issue.
All software bugs should be reported by filing a Github issue.

If you are unsure and would like to reach out to us directly, please email security \_at\_ aleo.org to elaborate on the issue.
3 changes: 3 additions & 0 deletions algorithms/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ pub enum SNARKError {
#[error("Batch size was different between public input and proof")]
BatchSizeMismatch,

#[error("Public input size was different from the circuit")]
PublicInputSizeMismatch,

#[error("Circuit not found")]
CircuitNotFound,
}
Expand Down
2 changes: 1 addition & 1 deletion algorithms/src/polycommit/kzg10/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use crate::{
};
use snarkvm_curves::{AffineCurve, PairingCurve, PairingEngine, ProjectiveCurve};
use snarkvm_fields::{ConstraintFieldError, ToConstraintField, Zero};
use snarkvm_parameters::testnet3::PowersOfG;
use snarkvm_parameters::mainnet::PowersOfG;
use snarkvm_utilities::{
borrow::Cow,
error,
Expand Down
7 changes: 6 additions & 1 deletion algorithms/src/r1cs/linear_combination.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,12 @@ impl<F: Field> AddAssign<(F, Variable)> for LinearCombination<F> {
#[inline]
fn add_assign(&mut self, (coeff, var): (F, Variable)) {
match self.get_var_loc(&var) {
Ok(found) => self.0[found].1 += &coeff,
Ok(found) => {
self.0[found].1 += &coeff;
if self.0[found].1.is_zero() {
self.0.remove(found);
}
}
Err(not_found) => self.0.insert(not_found, (var, coeff)),
}
}
Expand Down
33 changes: 15 additions & 18 deletions algorithms/src/snark/varuna/ahp/ahp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,23 +180,20 @@ impl<F: PrimeField, SM: SNARKMode> AHPForR1CS<F, SM> {
let max_constraint_domain = state.max_constraint_domain;
let max_variable_domain = state.max_variable_domain;
let max_non_zero_domain = state.max_non_zero_domain;
let public_inputs = state
.circuit_specific_states
.iter()
.map(|(circuit_id, circuit_state)| {
let input_domain = circuit_state.input_domain;
let public_inputs = public_inputs[circuit_id]
.iter()
.map(|p| {
let public_input = prover::ConstraintSystem::format_public_input(p);
Self::formatted_public_input_is_admissible(&public_input)?;
Ok::<_, AHPError>(public_input)
})
.collect::<Result<Vec<_>, _>>()?;
ensure!(public_inputs[0].len() == input_domain.size());
Ok(public_inputs)
})
.collect::<Result<Vec<_>, _>>()?;
let mut formatted_public_inputs = Vec::with_capacity(state.circuit_specific_states.len());
for (circuit_id, circuit_state) in &state.circuit_specific_states {
let input_domain = circuit_state.input_domain;
let public_inputs_i = public_inputs[circuit_id]
.iter()
.map(|p| {
let public_input = prover::ConstraintSystem::format_public_input(p);
Self::formatted_public_input_is_admissible(&public_input)?;
Ok::<_, AHPError>(public_input)
})
.collect::<Result<Vec<_>, _>>()?;
ensure!(public_inputs_i[0].len() == input_domain.size());
formatted_public_inputs.push(public_inputs_i);
}

let verifier::FirstMessage { batch_combiners } = state.first_round_message.as_ref().unwrap();
let verifier::SecondMessage { alpha, eta_b, eta_c } = state.second_round_message.unwrap();
Expand Down Expand Up @@ -286,7 +283,7 @@ impl<F: PrimeField, SM: SNARKMode> AHPForR1CS<F, SM> {
.enumerate()
.map(|(i, (circuit_id, circuit_state))| {
let lag_at_beta = circuit_state.input_domain.evaluate_all_lagrange_coefficients(beta);
let x_at_beta = public_inputs[i]
let x_at_beta = formatted_public_inputs[i]
.iter()
.map(|x| x.iter().zip_eq(&lag_at_beta).map(|(x, l)| *x * l).sum::<F>())
.collect_vec();
Expand Down
12 changes: 10 additions & 2 deletions algorithms/src/snark/varuna/data_structures/test_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ impl<F: Field> core::fmt::Debug for TestCircuit<F> {

impl<ConstraintF: Field> ConstraintSynthesizer<ConstraintF> for TestCircuit<ConstraintF> {
fn generate_constraints<CS: ConstraintSystem<ConstraintF>>(&self, cs: &mut CS) -> Result<(), SynthesisError> {
// Ensure the given `cs` is starting off clean.
assert_eq!(1, cs.num_public_variables());
assert_eq!(0, cs.num_private_variables());
assert_eq!(0, cs.num_constraints());

let a = cs.alloc(|| "a", || self.a.ok_or(SynthesisError::AssignmentMissing))?;
let b = cs.alloc(|| "b", || self.b.ok_or(SynthesisError::AssignmentMissing))?;

Expand Down Expand Up @@ -91,7 +96,9 @@ impl<F: Field> TestCircuit<F> {
num_variables: usize,
rng: &mut R,
) -> (Self, Vec<F>) {
let mut public_inputs: Vec<F> = Vec::with_capacity(mul_depth);
let mut public_inputs: Vec<F> = Vec::with_capacity(1 + mul_depth);
public_inputs.push(F::one());

let a = F::rand(rng);
let b = F::rand(rng);

Expand All @@ -114,7 +121,8 @@ impl<F: Field> TestCircuit<F> {
num_constraints: usize,
num_variables: usize,
) -> (Self, Vec<F>) {
let mut public_inputs: Vec<F> = Vec::with_capacity(mul_depth);
let mut public_inputs: Vec<F> = Vec::with_capacity(1 + mul_depth);
public_inputs.push(F::one());
let a = F::from(a);
let b = F::from(b);
for j in 1..(mul_depth + 1) {
Expand Down
21 changes: 9 additions & 12 deletions algorithms/src/snark/varuna/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ mod varuna {
},
traits::{AlgebraicSponge, SNARK},
};

use std::collections::BTreeMap;

use snarkvm_curves::bls12_377::{Bls12_377, Fq, Fr};
Expand Down Expand Up @@ -57,6 +58,8 @@ mod varuna {
let mul_depth = 1;
println!("running test with SM::ZK: {}, mul_depth: {}, num_constraints: {}, num_variables: {}", $snark_mode::ZK, mul_depth + i, num_constraints + i, num_variables + i);
let (circ, public_inputs) = TestCircuit::gen_rand(mul_depth + i, num_constraints + i, num_variables + i, rng);
let mut fake_inputs = public_inputs.clone();
fake_inputs[public_inputs.len() - 1] = random;

let (index_pk, index_vk) = $snark_inst::circuit_setup(&universal_srs, &circ).unwrap();
println!("Called circuit setup");
Expand All @@ -76,7 +79,7 @@ mod varuna {
assert!($snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, public_inputs, &proof).unwrap());
println!("Called verifier");
eprintln!("\nShould not verify (i.e. verifier messages should print below):");
assert!(!$snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, [random, random], &proof).unwrap());
assert!(!$snark_inst::verify(universal_verifier, &fs_parameters, &index_vk, fake_inputs, &proof).unwrap());
}

for circuit_batch_size in (0..4).map(|i| 2usize.pow(i)) {
Expand Down Expand Up @@ -129,7 +132,8 @@ mod varuna {
for instance_input in vks_to_inputs.values() {
let mut fake_instance_input = Vec::with_capacity(instance_input.len());
for input in instance_input.iter() {
let fake_input: Vec<_> = (0..input.len()).map(|_| Fr::rand(rng)).collect();
let mut fake_input = input.clone();
fake_input[input.len() - 1] = Fr::rand(rng);
fake_instance_input.push(fake_input);
}
fake_instance_inputs.push(fake_instance_input);
Expand Down Expand Up @@ -332,6 +336,8 @@ mod varuna_hiding {
for _ in 0..num_times {
let mul_depth = 2;
let (circuit, public_inputs) = TestCircuit::gen_rand(mul_depth, num_constraints, num_variables, rng);
let mut fake_inputs = public_inputs.clone();
fake_inputs[public_inputs.len() - 1] = Fr::rand(rng);

let (index_pk, index_vk) = VarunaInst::circuit_setup(&universal_srs, &circuit).unwrap();
println!("Called circuit setup");
Expand All @@ -342,16 +348,7 @@ mod varuna_hiding {
assert!(VarunaInst::verify(universal_verifier, &fs_parameters, &index_vk, public_inputs, &proof).unwrap());
println!("Called verifier");
eprintln!("\nShould not verify (i.e. verifier messages should print below):");
assert!(
!VarunaInst::verify(
universal_verifier,
&fs_parameters,
&index_vk,
[Fr::rand(rng), Fr::rand(rng)],
&proof
)
.unwrap()
);
assert!(!VarunaInst::verify(universal_verifier, &fs_parameters, &index_vk, fake_inputs, &proof).unwrap());
}
}

Expand Down
18 changes: 13 additions & 5 deletions algorithms/src/snark/varuna/varuna.rs
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ where
let mut input_domains = BTreeMap::new();
let mut circuit_infos = BTreeMap::new();
let mut circuit_ids = Vec::with_capacity(keys_to_inputs.len());
for (vk, public_inputs_i) in keys_to_inputs.iter() {
for (&vk, &public_inputs_i) in keys_to_inputs.iter() {
max_num_constraints = max_num_constraints.max(vk.circuit_info.num_constraints);
max_num_variables = max_num_variables.max(vk.circuit_info.num_variables);

Expand All @@ -670,17 +670,25 @@ where

let input_fields = public_inputs_i
.iter()
.map(|input| input.borrow().to_field_elements())
.map(|input| {
let input = input.borrow().to_field_elements()?;
ensure!(input.len() > 0);
ensure!(input[0] == E::Fr::one());
if input.len() > input_domain.size() {
bail!(SNARKError::PublicInputSizeMismatch);
}
Ok(input)
})
.collect::<Result<Vec<_>, _>>()?;

let (padded_public_inputs_i, parsed_public_inputs_i): (Vec<_>, Vec<_>) = {
input_fields
.iter()
.map(|input| {
let mut new_input = Vec::with_capacity((1 + input.len()).max(input_domain.size()));
new_input.push(E::Fr::one());
let input_len = input.len().max(input_domain.size());
let mut new_input = Vec::with_capacity(input_len);
new_input.extend_from_slice(input);
new_input.resize(input.len().max(input_domain.size()), E::Fr::zero());
new_input.resize(input_len, E::Fr::zero());
if cfg!(debug_assertions) {
println!("Number of padded public variables: {}", new_input.len());
}
Expand Down
10 changes: 0 additions & 10 deletions circuit/account/src/signature/ternary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ impl<A: Aleo> Ternary for Signature<A> {
}
}

impl<A: Aleo> Ternary for Box<Signature<A>> {
type Boolean = Boolean<A>;
type Output = Box<Signature<A>>;

/// Returns `first` if `condition` is `true`, otherwise returns `second`.
fn ternary(condition: &Self::Boolean, first: &Self, second: &Self) -> Self::Output {
Box::new(Signature::ternary(condition, first, second))
}
}

impl<A: Aleo> Metrics<dyn Ternary<Boolean = Boolean<A>, Output = Signature<A>>> for Signature<A> {
type Case = (Mode, Mode, Mode);

Expand Down
Loading
Loading