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 770 commits into
base: testnet3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
770 commits
Select commit Hold shift + click to select a range
acb237b
Update uses of transfer_public to transfer_public_as_caller
d0cd Mar 19, 2024
6350f45
Add transfer_public_as_signer to credits.aleo
d0cd Mar 19, 2024
e29c1df
Rewrite expectations
raychu86 Mar 19, 2024
eefd27d
Merge pull request #2396 from AleoHQ/update/genesis_transaction
howardwu Mar 19, 2024
798840b
Use self.signer in fee_public
raychu86 Mar 19, 2024
fe1bca1
Merge branch 'mainnet-staging' into update/fee-signer
raychu86 Mar 19, 2024
9350637
Add test to enforce calls to fee_public and fee_private fail
raychu86 Mar 20, 2024
544d0c7
Resample genesis block
raychu86 Mar 20, 2024
e9d5f8f
Merge pull request #2395 from AleoHQ/optimize-deserialize
howardwu Mar 20, 2024
f066df8
Update synthesizer/process/src/cost.rs
howardwu Mar 20, 2024
dd01117
Merge pull request #2379 from AleoHQ/test/execution-cost
howardwu Mar 20, 2024
06201cb
Merge branch 'mainnet-staging' into update/fee-signer
raychu86 Mar 20, 2024
fecd05a
Resample parameters; sanity tests for transfer_public_as_signer
d0cd Mar 21, 2024
7204e80
tests: don't re-seed the TestRng when using check_merkle_tree
ljedrz Mar 21, 2024
2e67f32
Update README.md
dembelekaro Mar 21, 2024
516985c
Merge pull request #2400 from dembelekaro/mainnet-staging
howardwu Mar 21, 2024
035c4a8
Merge pull request #2399 from ljedrz/tests/check_merkle_tree_TestRng
howardwu Mar 21, 2024
b4f5768
Add tests
d0cd Mar 21, 2024
48dd2db
Add puzzle
d0cd Mar 21, 2024
96d85f2
Revert transfer_public_as_caller to transfer_public
d0cd Mar 21, 2024
114a925
Cleanup
d0cd Mar 21, 2024
313c463
Merge branch 'mainnet-staging' into feat/transfer_public_as_signer
d0cd Mar 21, 2024
4cb307a
Fix test
d0cd Mar 22, 2024
81af174
Merge pull request #2401 from AleoHQ/feat/puzzle
howardwu Mar 22, 2024
8d57f74
Fix comment
d0cd Mar 22, 2024
502c682
Merge branch 'mainnet-staging' into feat/transfer_public_as_signer
d0cd Mar 22, 2024
54e7550
Merge mainnet-staging
raychu86 Mar 22, 2024
0542c78
Regenerate genesis block
raychu86 Mar 22, 2024
b028362
Merge pull request #2397 from AleoHQ/update/fee-signer
howardwu Mar 22, 2024
74173c6
Bumps MSRV to 1.76.0
howardwu Mar 22, 2024
761d493
Add test demonstrating transfer_public_to_private using a program
d0cd Mar 22, 2024
3b2bde8
Clippy
howardwu Mar 22, 2024
22e5db6
Adds comments for where to change the MSRV
howardwu Mar 22, 2024
78d449b
Merge pull request #2405 from AleoHQ/bump/msrv-176
howardwu Mar 22, 2024
fbe604d
Catch and abort panicking transactions
raychu86 Mar 22, 2024
704a323
Nit
raychu86 Mar 22, 2024
b924170
Merge pull request #2402 from AleoHQ/feat/transfer_public_as_signer
howardwu Mar 22, 2024
c75ceeb
Update is_open and max committee member checks
raychu86 Mar 22, 2024
84f68f5
Merge branch 'mainnet-staging' of https://github.com/AleoHQ/snarkVM i…
raychu86 Mar 22, 2024
b0bd13f
nit
raychu86 Mar 22, 2024
4ec6e7c
Add tests for is_*function*
raychu86 Mar 22, 2024
b00dcad
Reject transactions that have unbond_public calls that exceeds max co…
raychu86 Mar 22, 2024
bb9bf60
Fix split_transaction_size test
raychu86 Mar 22, 2024
0029b6a
Merge pull request #2406 from AleoHQ/is-open-to-new-stakers
howardwu Mar 23, 2024
3627720
perf: reduce zero-padding and cache zero-hashes in k-ary MerkleTree
ljedrz Mar 22, 2024
3afcadd
perf: only cache the zero hash for the previous level
ljedrz Mar 23, 2024
f2d4e38
Merge branch 'mainnet-staging' into bounded-parallel-verification
raychu86 Mar 25, 2024
b4dd9ae
Update the coinbase_threshold
raychu86 Mar 25, 2024
43328ae
Add more descriptive error messages
raychu86 Mar 27, 2024
fef4d68
Merge pull request #2411 from AleoHQ/update-error-logs
howardwu Mar 27, 2024
10b67c9
Clean up comments
raychu86 Mar 27, 2024
25e03ff
Move prepare_for_speculate logic
raychu86 Mar 27, 2024
0f47547
macro cleanup
raychu86 Mar 27, 2024
2cbf34a
Merge pull request #2387 from AleoHQ/bounded-parallel-verification
howardwu Mar 27, 2024
a42496f
Properly calculate the expected cumulative proof target
raychu86 Mar 27, 2024
dd53190
Merge branch 'mainnet-staging' into update/is-coinbase-target-is-met
raychu86 Mar 27, 2024
18e2175
Use to_next_targets helper method in block construction
raychu86 Mar 28, 2024
8e871b7
Use to_next_targets helper method in block verification
raychu86 Mar 28, 2024
18add6a
Add cumulative weight to helper method
raychu86 Mar 28, 2024
2c95bb6
Add tests for to_next_targets
raychu86 Mar 28, 2024
1a6b4ec
Add TestnetV0 network trait
raychu86 Mar 29, 2024
e1a71d8
Add TestnetCircuit and AleoTestnetV0 traits impls
raychu86 Mar 29, 2024
6b45a00
Add support for TestnetV0
raychu86 Mar 29, 2024
6682816
Add custom genesis target values for TestnetV0
raychu86 Mar 29, 2024
36cb737
Add custom MAX_CERTIFICATES for TestnetV0
raychu86 Mar 29, 2024
0222c59
Add comments
raychu86 Mar 29, 2024
cc45812
Minor fix
raychu86 Mar 29, 2024
9637993
Move MAX_CERTIFICATES into network impl
raychu86 Mar 29, 2024
33cd798
Add TestnetCircuit to converter
raychu86 Mar 29, 2024
d233d20
Initialize testnet parameters
raychu86 Mar 30, 2024
ee14c92
perf: reduce zero-padding in MerkleTree
ljedrz Mar 25, 2024
b79a59c
Add logging
d0cd Apr 2, 2024
abc7b50
Merge pull request #2410 from AleoHQ/update/is-coinbase-target-is-met
howardwu Apr 2, 2024
925b3ca
Merge pull request #2412 from AleoHQ/unify-target-calculations
howardwu Apr 2, 2024
11f98f4
Merge branch 'mainnet-staging' into log/solution
raychu86 Apr 3, 2024
128db55
Update ledger/src/advance.rs
d0cd Apr 3, 2024
018a571
Update ledger/src/advance.rs
d0cd Apr 3, 2024
a483b63
Address feedback
d0cd Apr 3, 2024
c92bb65
Address feedback
d0cd Apr 3, 2024
39282a1
Merge pull request #2420 from AleoHQ/log/solution
howardwu Apr 3, 2024
fb429a4
docs: add an extra comment in KaryMerkleTree::new
ljedrz Apr 4, 2024
6bc448c
cleanup: remove a redundant check in KaryMerkleTree::new
ljedrz Apr 4, 2024
cd2fe47
cleanup: remove another redundant check in KaryMerkleTree::new
ljedrz Apr 4, 2024
7646a98
docs: fix the doc comment for hash_all_children
ljedrz Apr 4, 2024
650271d
clippy: improve iteration
ljedrz Apr 4, 2024
9055518
Sort transactions based on original ordering
raychu86 Apr 4, 2024
36a1e0f
Add test for transaction ordering
raychu86 Apr 4, 2024
5e23410
Add fix
d0cd Apr 4, 2024
8153718
Add test to check cumulative proof target correctness through several…
iamalwaysuncomfortable Apr 5, 2024
13268a3
Merge pull request #2421 from AleoHQ/fix/tx-ordering
howardwu Apr 5, 2024
9739d9d
Adjust test
d0cd Apr 5, 2024
4aa50b9
Merge pull request #2423 from AleoHQ/fix/proof-target-tests
d0cd Apr 5, 2024
ed20562
Merge pull request #2422 from AleoHQ/fix/proof-target
howardwu Apr 5, 2024
f1dd908
perf: use a parallel sort to order txs while speculating
ljedrz Apr 5, 2024
e43435a
perf: remove redundant checks in MerkleTree::new
ljedrz Apr 4, 2024
eac696a
Create helper method to check if transactions should be aborted
raychu86 Apr 5, 2024
b4ba2f8
Use helper method to abort transactions prior to verification
raychu86 Apr 5, 2024
38fe8ff
perf: chache the key when sorting txs while speculating
ljedrz Apr 7, 2024
4e2f434
perf: only check for the presence of a single child in MerkleTree::new
ljedrz Apr 8, 2024
7fc8a2b
perf: stop iterating the leaves sooner in MerkleTree::new
ljedrz Apr 8, 2024
2d2b810
perf: stop iterating the leaves sooner in KaryMerkleTree::new
ljedrz Apr 8, 2024
e7031f4
perf: don't allocate the children in KaryMerkleTree::now
ljedrz Apr 8, 2024
950c422
Add rule for aborting subsequent deployments by same payer in a block
raychu86 Apr 8, 2024
e030982
Add test for multiple dpeloyments for same payer
raychu86 Apr 8, 2024
1f7cf54
Check additional abort conditions prior to verification
raychu86 Apr 8, 2024
a9f7ce4
clippy: fix new lints
ljedrz Apr 8, 2024
d1b97a6
Implement NetworkID operand
evan-schott Apr 2, 2024
eaeebbf
Parsing test
evan-schott Apr 2, 2024
38603b5
Accurate metadata E2E test
evan-schott Apr 2, 2024
56f5db7
clippy
evan-schott Apr 2, 2024
35e4c66
fix
evan-schott Apr 9, 2024
98ba235
Add more transactions and expectations to transaction ordering test
raychu86 Apr 10, 2024
e8d48f2
Merge pull request #2430 from AleoHQ/test/ordering
howardwu Apr 11, 2024
dc9e432
Update synthesizer/src/vm/finalize.rs
raychu86 Apr 12, 2024
c5a1e83
Update synthesizer/src/vm/finalize.rs
raychu86 Apr 12, 2024
8343a95
Update synthesizer/src/vm/finalize.rs
raychu86 Apr 12, 2024
17e45d0
Merge branch 'mainnet-staging' into mitigate-free-verification
raychu86 Apr 12, 2024
abfa125
Merge branch 'mainnet-staging' into feat/testnetv0
howardwu Apr 12, 2024
55494d9
Fix test
raychu86 Apr 12, 2024
767434c
Merge pull request #2414 from AleoHQ/feat/testnetv0
howardwu Apr 12, 2024
bbdb745
Merge pull request #2407 from ljedrz/perf/kary_merkle_tree_padding
howardwu Apr 12, 2024
933f12f
Merge pull request #2415 from ljedrz/perf/merkle_tree_padding
howardwu Apr 12, 2024
51c3d27
Merge pull request #2425 from ljedrz/perf/tx_speculation_ordering2
howardwu Apr 12, 2024
d48f6fb
Merge pull request #2419 from AleoHQ/feat/network-id
howardwu Apr 12, 2024
69f9100
Fix test
raychu86 Apr 12, 2024
dcc3018
Merge branch 'mainnet-staging' into mitigate-free-verification
raychu86 Apr 12, 2024
69c25a8
Add BFTAbortedTransmissionIDsMap
raychu86 Apr 14, 2024
9a2e6ae
Add get_delegators_for_validator
vicsn Apr 16, 2024
da3d78a
Merge pull request #2433 from AleoHQ/feat/aborted-transmissions-map
howardwu Apr 16, 2024
f2d0608
Introduce LimitedReader
d0cd Apr 17, 2024
ad340bf
Add benchmarks for bonded mapping access
iamalwaysuncomfortable Apr 17, 2024
98c5661
Use LimitedReader for deserializing transactions; add test
d0cd Apr 17, 2024
ebc6d29
Introduce LimitedWriter
d0cd Apr 17, 2024
5fee975
Use LimitedWriter for serializing transactions; update test
d0cd Apr 17, 2024
8959e47
Add restrictions to serializer
d0cd Apr 17, 2024
65afdb7
Add size check to check_transaction; add test
d0cd Apr 17, 2024
d368b94
Cleanup
d0cd Apr 17, 2024
1ce5475
Cleanup and add more tests
d0cd Apr 17, 2024
d68352f
Remove LimitedReader in favor of take
d0cd Apr 17, 2024
909708d
Refactor check in check_transaction to account for version bumps
d0cd Apr 18, 2024
f1cf9a9
Add TODO
d0cd Apr 18, 2024
4e5d984
Bench get_value_speculative/confirmed on bonded mapping at increasing…
iamalwaysuncomfortable Apr 19, 2024
2656dfa
Move bonded benchmark to ledger crate
iamalwaysuncomfortable Apr 19, 2024
33bf3c3
Merge pull request #2428 from AleoHQ/mitigate-free-verification
howardwu Apr 19, 2024
85a62a8
Merge pull request #2429 from ljedrz/cleanup/clippy
howardwu Apr 19, 2024
43abe1b
Merge pull request #2434 from AleoHQ/get_delegators_for_validator
howardwu Apr 19, 2024
40c38e1
Cleanup
d0cd Apr 19, 2024
54afc5e
Merge branch 'mainnet-staging' into feat/transaction-byte-limit
d0cd Apr 19, 2024
5d04eea
perf: don't recreate ReadOptions when querying the database
ljedrz Apr 22, 2024
cbcffe2
Fix length of struct in Serialize
d0cd Apr 22, 2024
c232bb4
Merge branch 'mainnet-staging' into bench-bonded-mappings
iamalwaysuncomfortable Apr 23, 2024
f26c951
Use correct name in Serialize for PuzzleSolutions
d0cd Apr 23, 2024
a1eec15
Loop over references
d0cd Apr 23, 2024
d90c9c7
Add code comment
d0cd Apr 23, 2024
ce55ef6
Add const for proof_target_cache size
d0cd Apr 23, 2024
3476183
Dedup code to compute proof_target
d0cd Apr 23, 2024
9a55a98
Remove solution_id from human-readable Solution (de)serializers
d0cd Apr 23, 2024
4f0b637
Check for empty buffer
d0cd Apr 24, 2024
7d937b1
Add additional case for test
raychu86 Apr 24, 2024
8f3f019
Merge pull request #2437 from AleoHQ/feat/transaction-byte-limit
howardwu Apr 24, 2024
8b7f59e
Merge pull request #2440 from AleoHQ/fix/transition-serialization
howardwu Apr 24, 2024
c1af0d3
Merge pull request #2442 from AleoHQ/test/unbond-bond-to-max
howardwu Apr 24, 2024
aef07da
Merge pull request #2436 from AleoHQ/bench-bonded-mappings
howardwu Apr 24, 2024
59c9f10
tests: large execution transaction helper
niklaslong Apr 21, 2024
1e2d298
ref: extract program test helper
niklaslong Apr 23, 2024
bcc7e27
tests: use `small_and_large_program` helper
niklaslong Apr 23, 2024
3a3541a
Revert
d0cd Apr 25, 2024
dd8913c
Add check to credits.aleo
d0cd Apr 25, 2024
8ecd933
Add test
d0cd Apr 25, 2024
afacda3
Merge pull request #2438 from niklaslong/feat/transaction-byte-limit
howardwu Apr 26, 2024
24a0e76
Merge pull request #2441 from AleoHQ/fix/code-quality
howardwu Apr 26, 2024
73d0c83
Adds a variable limit for deployments
howardwu Apr 29, 2024
faf4db7
Rename to num_public_and_private_variables
howardwu Apr 29, 2024
48e8eca
Reset the variable limit on eject
howardwu Apr 29, 2024
4eea169
nit: unwrap in test for better error output
howardwu Apr 29, 2024
77bb761
Initializes the global constants
howardwu Apr 29, 2024
b5a07d9
Fix tests
raychu86 Apr 29, 2024
09fbe3e
Fix test_large_transaction_is_aborted
raychu86 Apr 29, 2024
8e918b7
Move BFTAbortedTransmissionIDsMap to the proper place
raychu86 Apr 29, 2024
946f217
Merge branch 'mainnet-staging' into fix/restrict-bond-public-as-valid…
raychu86 Apr 29, 2024
b174c12
Resample bond_public parameters
raychu86 Apr 29, 2024
eedf4c8
Merge pull request #2444 from AleoHQ/feat/variable-count
howardwu Apr 29, 2024
1485bdd
Merge pull request #2443 from AleoHQ/fix/restrict-bond-public-as-vali…
howardwu Apr 29, 2024
57641ca
Merge pull request #2439 from ljedrz/perf/dont_allocate_read_opts
howardwu Apr 30, 2024
cc28c8d
Add benchmarks of LimitedWriter.write_le method to transaction benchm…
iamalwaysuncomfortable May 2, 2024
5d03c15
Update benchmark directory
raychu86 May 2, 2024
0cf96c4
Update printlns
raychu86 May 3, 2024
b27dcff
Merge pull request #2447 from AleoHQ/update/puzzle-benchmark
howardwu May 3, 2024
5c57a48
Merge pull request #2448 from AleoHQ/update/printlns
howardwu May 3, 2024
2b2c43c
Modify comments for clarity
iamalwaysuncomfortable May 6, 2024
701bef3
Modify comments for clarity
iamalwaysuncomfortable May 6, 2024
6a1ef94
Merge branch 'mainnet-staging' into benches/limited-writer
iamalwaysuncomfortable May 6, 2024
417300b
perf: don't allocate most of the rocksdb keys
ljedrz Apr 23, 2024
7a20bea
chore: adjust the lockfile
ljedrz May 6, 2024
8421146
Merge pull request #2446 from AleoHQ/benches/limited-writer
howardwu May 6, 2024
3ebe60c
Merge pull request #2449 from ljedrz/perf/dont_allocate_rocksdb_keys
howardwu May 8, 2024
5b30ccd
feat: introduce cfg_sorted_by
ljedrz May 9, 2024
05c0273
Do not abort executions early in prepare_for_speculate
vicsn May 13, 2024
4ff52ba
Fix unit tests which test for duplicate tx contents
vicsn May 13, 2024
8949c47
Add test to confirm behavior of a malicious validator re-using execut…
vicsn May 14, 2024
ba56517
perf: speed up the LiteralType check for the Identifier
ljedrz May 15, 2024
2a275ed
chore: adjust the lockfile
ljedrz May 15, 2024
93d1570
Adding Testnet Beta genesis block
zosorock May 16, 2024
a76593b
upgrade CI
zosorock May 16, 2024
aeba7d2
bump Rust version on CI image
zosorock May 16, 2024
95ca3d9
updating Rust version
zosorock May 16, 2024
8421792
Fix tests
raychu86 May 16, 2024
f8deffb
Downgrading Rust version to fix clippy CI issue
zosorock May 16, 2024
0d1b150
Update timestamp comment placement (nit)
howardwu May 16, 2024
140ff26
Merge pull request #2455 from AleoNet/feat/new-network
zosorock May 16, 2024
fd51446
Revert "Do not abort executions early in prepare_for_speculate"
vicsn May 17, 2024
ea6bf5a
Abort fee transactions before speculation early
vicsn May 17, 2024
6e6476e
Fix tests
vicsn May 17, 2024
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
c792427
refactor: use type_name instead of literals for LiteralType::parse
ljedrz May 21, 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
078bd05
adding new Testnet genesis block with new coinbase and proof targets
zosorock May 23, 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
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
fddd8b9
Merge pull request #2466 from AleoNet/mainnet-staging
zosorock May 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
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