Skip to content

Commit

Permalink
Merge branch 'develop' into sventimir/genesis-ledger-export
Browse files Browse the repository at this point in the history
  • Loading branch information
Sventimir authored Oct 10, 2023
2 parents 101627b + 695865f commit 035e9ff
Show file tree
Hide file tree
Showing 39 changed files with 342 additions and 234 deletions.
19 changes: 0 additions & 19 deletions buildkite/scripts/build-test-executive.sh

This file was deleted.

16 changes: 14 additions & 2 deletions buildkite/scripts/run-test-executive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,21 @@ if [[ "${TEST_NAME:0:15}" == "block-prod-prio" ]] && [[ "$RUN_OPT_TESTS" == "" ]
exit 0
fi

./test_executive.exe cloud "$TEST_NAME" \
# Don't prompt for answers during apt-get install
export DEBIAN_FRONTEND=noninteractive

echo "deb [trusted=yes] https://apt.releases.hashicorp.com $MINA_DEB_CODENAME main" | tee /etc/apt/sources.list.d/hashicorp.list
apt-get update
apt-get install -y "terraform"

echo "Installing mina daemon package: mina-test-executive=${MINA_DEB_VERSION}"
echo "deb [trusted=yes] http://packages.o1test.net $MINA_DEB_CODENAME $MINA_DEB_RELEASE" | tee /etc/apt/sources.list.d/mina.list
apt-get update
apt-get install --allow-downgrades -y "mina-test-executive=$MINA_DEB_VERSION" "mina-logproc=$MINA_DEB_VERSION"

mina-test-executive cloud "$TEST_NAME" \
--mina-image "$MINA_IMAGE" \
--archive-image "$ARCHIVE_IMAGE" \
--mina-automation-location ./automation \
| tee "$TEST_NAME.test.log" \
| ./logproc.exe -i inline -f '!(.level in ["Debug", "Spam"])'
| mina-logproc -i inline -f '!(.level in ["Debug", "Spam"])'
3 changes: 3 additions & 0 deletions buildkite/scripts/unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ time make build
echo "--- Build all targets"
dune build "${path}" --profile="${profile}" -j16

echo "--- Check for changes to verification keys"
time dune runtest "src/app/print_blockchain_snark_vk" --profile="${profile}" -j16

echo "--- Run unit tests"
time dune runtest "${path}" --profile="${profile}" -j16 || (./scripts/link-coredumps.sh)
28 changes: 0 additions & 28 deletions buildkite/src/Command/TestExecutive.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -15,36 +15,11 @@ let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type
in

{
build = \(duneProfile : Text) ->
Command.build
Command.Config::{
commands =
-- Build test executive binary
RunInToolchain.runInToolchain [
"DUNE_PROFILE=${duneProfile}"
] "./buildkite/scripts/build-test-executive.sh"

#

[
-- Cache test-executive binary
Cmd.run "artifact-cache-helper.sh test_executive.exe --upload",
Cmd.run "artifact-cache-helper.sh logproc.exe --upload"
],
label = "Build test-executive",
key = "build-test-executive",
target = Size.XLarge
},

execute = \(testName : Text) -> \(dependsOn : List Command.TaggedKey.Type) ->
Command.build
Command.Config::{
commands =
[
-- Download test dependencies
Cmd.run "artifact-cache-helper.sh test_executive.exe && chmod +x test_executive.exe",
Cmd.run "artifact-cache-helper.sh logproc.exe && chmod +x logproc.exe",

-- Execute test based on BUILD image
Cmd.run "MINA_DEB_CODENAME=bullseye ; source ./buildkite/scripts/export-git-env-vars.sh && ./buildkite/scripts/run-test-executive.sh ${testName}"
],
Expand Down Expand Up @@ -78,9 +53,6 @@ in
Command.Config::{
commands =
[
-- Download test dependencies
Cmd.run "artifact-cache-helper.sh test_executive.exe && chmod +x test_executive.exe",
Cmd.run "artifact-cache-helper.sh logproc.exe && chmod +x logproc.exe",
Cmd.run "artifact-cache-helper.sh snarkyjs_test.tar.gz && tar -xzf snarkyjs_test.tar.gz",

-- Execute test based on BUILD image
Expand Down
3 changes: 0 additions & 3 deletions buildkite/src/Jobs/Test/TestnetIntegrationTests.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ let PipelineMode = ../../Pipeline/Mode.dhall
let TestExecutive = ../../Command/TestExecutive.dhall

let dependsOn = [
{ name = "TestnetIntegrationTests", key = "build-test-executive" },
{ name = "MinaArtifactBullseye", key = "daemon-berkeley-bullseye-docker-image" },
{ name = "MinaArtifactBullseye", key = "archive-bullseye-docker-image" }
]
let dependsOnJs = [
{ name = "TestnetIntegrationTests", key = "build-test-executive" },
{ name = "TestnetIntegrationTests", key = "build-js-tests" },
{ name = "MinaArtifactBullseye", key = "daemon-berkeley-bullseye-docker-image" },
{ name = "MinaArtifactBullseye", key = "archive-bullseye-docker-image" }
Expand All @@ -33,7 +31,6 @@ in Pipeline.build Pipeline.Config::{
mode = PipelineMode.Type.Stable
},
steps = [
TestExecutive.build "integration_tests",
TestExecutive.buildJs "integration_tests",
TestExecutive.execute "peers-reliability" dependsOn,
TestExecutive.execute "chain-reliability" dependsOn,
Expand Down
1 change: 0 additions & 1 deletion buildkite/src/Jobs/Test/TestnetIntegrationTestsLong.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ let PipelineMode = ../../Pipeline/Mode.dhall
let TestExecutive = ../../Command/TestExecutive.dhall

let dependsOn = [
{ name = "TestnetIntegrationTests", key = "build-test-executive" },
{ name = "MinaArtifactBullseye", key = "daemon-berkeley-bullseye-docker-image" },
{ name = "MinaArtifactBullseye", key = "archive-bullseye-docker-image" }
]
Expand Down
2 changes: 1 addition & 1 deletion nix/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let
};
toolchainHashes = {
"1.72" = "sha256-dxE7lmCFWlq0nl/wKcmYvpP9zqQbBitAQgZ1zx9Ooik=";
"nightly-2023-09-01" = "sha256-nfYc8EgbYl75yIIHmEEmpux4ZpwaIyuC+g6Hf4y1Hyk=";
"nightly-2023-09-01" = "sha256-zek9JAnRaoX8V0U2Y5ssXVe9tvoQ0ERGXfUCUGYdrMA=";
# copy the placeholder line with the correct toolchain name when adding a new toolchain
# That is,
# 1. Put the correct version name;
Expand Down
1 change: 1 addition & 0 deletions src/app/print_blockchain_snark_vk/.ocamlformat
1 change: 1 addition & 0 deletions src/app/print_blockchain_snark_vk/blockchain_snark_vk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"commitments":{"sigma_comm":[["0x1A8B2FCF1A5D4F6D1902517B6BF31A4288186F5AA647804402E14E4DC63ABE1F","0x3224B1C182312B364F659896357A40D2EF566959E6C11AD0A347EA80D82CDBF6"],["0x22CFAD2E118F91BE8E133664585947E25A282017E007700D67F0D72999639BCC","0x31AA847B558743C3CAD651B085327F0B67E1C1BFEA2FF472976589ADD952E6D4"],["0x02FB6661EE11262AFC7C8B0389A9B1E4ED18263C3F2468AAF035A07ECC61C9EB","0x30705D77AB82D6BAAC8E23640BBAB40F7E7FB53826CD5011575CAE52C6D0517D"],["0x0FD615E77CF392BE8285848DF60D4F87350ABCD65200FC4932E309133D145D05","0x3E75EA0E3810A97D8F1D1F8A6B0F9AE5D0F68AE34A4D0EFC29F00AB3BF6D480E"],["0x20C89F37CF8E43831F077DFF9AB9A676907BF9A0F64E418A643667808AB72DAB","0x389F98A86437D8A7F667ABB9B0B0DEACBD7E420B583B795363EBCECDBF1C187B"],["0x2F5C56AA39D6FD87055E7CA6F5FA61E94FCF17336DA4476E328D2CC184F93D47","0x089B80235867482E24087360E161AC76A5249D826CFAC51AB537093D86EAA632"],["0x20216D064B7466C42626F66F3F141997E6F29D17CC6EBA8FF91E1E03D31FE555","0x0082380869AFA6A961738C93BCEEA3042F3ECEA143A585B565A2BF6BD78A1224"]],"coefficients_comm":[["0x2113503AE01039434E72D555369C460EE5C45260396DD4782CE0BE81B19F2F6C","0x2F72056BEC498916F4176C6410A31801F81CDE4D427F1C15566C018393751E2B"],["0x08060FD15238AE40E726A04EA5C1AE41D8A1D267C9AF7355A8D6C70607139922","0x13D36CAD9C78FD0AF514AB7ECAC433592389AE84283024B1D4C85D2E8C952B28"],["0x3AE007735587246066F71A1F09801C359E393CBF49DBDFEDD01E61AA88ECAF0F","0x15882EBC62C0E9BC93A14F2CB2ECE43402063B50C09CE735E56D51447689D2C6"],["0x3DCBFD7F258F598AEFB560A1B3BCE632B4AC20534FEFF3B35C82082FE708B236","0x254668B50AB44E074902E0DB981FDF045FC614C1E61EBDDA27C06DF9131FC71A"],["0x364F1609C5A72CC0A6F5966400AE1A5AA4B7684805B46D0EE09001F7618DD614","0x0F3E45A3DEC2B73BEC5E91ED78BB750B87C02A2339E5A40C2D51FAA0EE1D5B7E"],["0x2CD387D1747E5594DF7FBAE6B40C7A674875F6F9FBB4E3632FBAFD49D41E67A6","0x33C14453CA5F229C77B5259999798D42B36BE08F68C09F969937C2C13FE1C34D"],["0x3E32E6702761E653043644E9DC5D75FE7A351B764CD90D72DD1176DB1A541121","0x0454C684E407E066394B31CFCCBAF22844B7E17D162EFE860030960A38AD2B2E"],["0x1AE2CE814A97742F41565FEB5881767A2BCF55981A3C8ED33BAE069CBE652FCA","0x14DC3F97387117CCA4884F28DCC82C9CF1B7101623B481FD3D1588F568B3E26B"],["0x0A10FA40BB6C61E8185412EE2BAE86C51D19EA7276593DFA7FA3FABB0345521F","0x3A8ACF73B5EF4E52ED5DC96404A60C69A067B84FE77211C5407A48437BD5CF89"],["0x21B2C2D62891139A91056B9D298DA8713B7ADA51963B864A5A2376771A1AA766","0x1AC7782A588865397F219624D70D11A109283E82B9CD50FFEE23753461E755FE"],["0x2763E7A5B2C387147A0381B50D5C504A5012B7F7CA474C2B4A351011B9BBD036","0x13DEA6F4AEBDC606331746A886756C7EA266A52F60B45DE5544A04BFDB277455"],["0x32596E43A053571EE478A3106CABFE9ECB29437F78A978409B4DDE33FE637103","0x3D76AF5EE3EFF37E666087AC2827A8BD0D9690BF440FF24434DA3E6AFF7A2AF4"],["0x1D73FE7224F38A37B2C69E22FA6750BABAED17B0F9998877B33E488D9063CE8E","0x3E24CEADB1BDA92A0DBDA0F90DF3B8FBD7C6F7ABCC039E9D41AB6916A799F645"],["0x2FDF5D887BC70465AFAC06B7A43632732B5AF0B933EA045D35E99D532BD44CAF","0x211A76FD7B76DF3E693CAA0BBB5C178D5DDE827AB6A902AF04AB39D8040E29DF"],["0x0D29BA887D54D915CFB321573463A3CAF5C354848A51FFD6D4FFC0E0B4464D39","0x232829C5C662E87CD033AFB3E84E86EC342F4942AC9D75123A21172EE06CF567"]],"generic_comm":["0x363662743B4E693E18C0CF5FB651DF1205BB27FABCD93ADF54ECD973B21B921B","0x116FBA051A4A146C88BCB0F2B56309429CD63514EEEFBE6EA0B39927E72BB20C"],"psm_comm":["0x0A8B3EF5670C6367C721EDAA40AF511C18B1602A4732FEA01124D5D949304324","0x1DBE04516C4A33CDFBBD1F54F413B9F21B5D41B6CD668B249879A2688693E51B"],"complete_add_comm":["0x1E859218F11F787CE75C06FD5303457CBD307BDEEB693CC66A235CB85B314D4B","0x228167E190903072E8F34BD7AF61A0C02DE0BC3D54FF8760A2BCBFDD6A880688"],"mul_comm":["0x3EC97D3A8CD405A92B31B67184817925B99B1527065A28677AEAAEC37CC7B9C5","0x3844006206FF29A55DBB44A3D06E46610639E24E960B4BC32A663EEC4D04C689"],"emul_comm":["0x114772020FAF5E6660D7D75B666B7121829027A866A8214B42899E824D820CB9","0x01F7FC015E2F0C5E02E34F0FD6FBA0FCE01E40EA183F0F6F7C197553524A96B9"],"endomul_scalar_comm":["0x04C30A9B6412594ECD5EEFCA20D4B759BBC52B08868E01F74FDC82B557A76ADD","0x019413D8112950CB93D20BA29452DC281FFE1A692706C34BD148E331F844D244"]},"index":{"domain":{"log_size_of_group":14,"group_gen":"0x1E5587687024253BB079B38D9C5371594958E496C605D3BD898B34D068AFBEE7"},"max_poly_size":32768,"public":40,"prev_challenges":2,"srs":null,"evals":{"sigma_comm":[{"unshifted":[["Finite",["0x1A8B2FCF1A5D4F6D1902517B6BF31A4288186F5AA647804402E14E4DC63ABE1F","0x3224B1C182312B364F659896357A40D2EF566959E6C11AD0A347EA80D82CDBF6"]]],"shifted":null},{"unshifted":[["Finite",["0x22CFAD2E118F91BE8E133664585947E25A282017E007700D67F0D72999639BCC","0x31AA847B558743C3CAD651B085327F0B67E1C1BFEA2FF472976589ADD952E6D4"]]],"shifted":null},{"unshifted":[["Finite",["0x02FB6661EE11262AFC7C8B0389A9B1E4ED18263C3F2468AAF035A07ECC61C9EB","0x30705D77AB82D6BAAC8E23640BBAB40F7E7FB53826CD5011575CAE52C6D0517D"]]],"shifted":null},{"unshifted":[["Finite",["0x0FD615E77CF392BE8285848DF60D4F87350ABCD65200FC4932E309133D145D05","0x3E75EA0E3810A97D8F1D1F8A6B0F9AE5D0F68AE34A4D0EFC29F00AB3BF6D480E"]]],"shifted":null},{"unshifted":[["Finite",["0x20C89F37CF8E43831F077DFF9AB9A676907BF9A0F64E418A643667808AB72DAB","0x389F98A86437D8A7F667ABB9B0B0DEACBD7E420B583B795363EBCECDBF1C187B"]]],"shifted":null},{"unshifted":[["Finite",["0x2F5C56AA39D6FD87055E7CA6F5FA61E94FCF17336DA4476E328D2CC184F93D47","0x089B80235867482E24087360E161AC76A5249D826CFAC51AB537093D86EAA632"]]],"shifted":null},{"unshifted":[["Finite",["0x20216D064B7466C42626F66F3F141997E6F29D17CC6EBA8FF91E1E03D31FE555","0x0082380869AFA6A961738C93BCEEA3042F3ECEA143A585B565A2BF6BD78A1224"]]],"shifted":null}],"coefficients_comm":[{"unshifted":[["Finite",["0x2113503AE01039434E72D555369C460EE5C45260396DD4782CE0BE81B19F2F6C","0x2F72056BEC498916F4176C6410A31801F81CDE4D427F1C15566C018393751E2B"]]],"shifted":null},{"unshifted":[["Finite",["0x08060FD15238AE40E726A04EA5C1AE41D8A1D267C9AF7355A8D6C70607139922","0x13D36CAD9C78FD0AF514AB7ECAC433592389AE84283024B1D4C85D2E8C952B28"]]],"shifted":null},{"unshifted":[["Finite",["0x3AE007735587246066F71A1F09801C359E393CBF49DBDFEDD01E61AA88ECAF0F","0x15882EBC62C0E9BC93A14F2CB2ECE43402063B50C09CE735E56D51447689D2C6"]]],"shifted":null},{"unshifted":[["Finite",["0x3DCBFD7F258F598AEFB560A1B3BCE632B4AC20534FEFF3B35C82082FE708B236","0x254668B50AB44E074902E0DB981FDF045FC614C1E61EBDDA27C06DF9131FC71A"]]],"shifted":null},{"unshifted":[["Finite",["0x364F1609C5A72CC0A6F5966400AE1A5AA4B7684805B46D0EE09001F7618DD614","0x0F3E45A3DEC2B73BEC5E91ED78BB750B87C02A2339E5A40C2D51FAA0EE1D5B7E"]]],"shifted":null},{"unshifted":[["Finite",["0x2CD387D1747E5594DF7FBAE6B40C7A674875F6F9FBB4E3632FBAFD49D41E67A6","0x33C14453CA5F229C77B5259999798D42B36BE08F68C09F969937C2C13FE1C34D"]]],"shifted":null},{"unshifted":[["Finite",["0x3E32E6702761E653043644E9DC5D75FE7A351B764CD90D72DD1176DB1A541121","0x0454C684E407E066394B31CFCCBAF22844B7E17D162EFE860030960A38AD2B2E"]]],"shifted":null},{"unshifted":[["Finite",["0x1AE2CE814A97742F41565FEB5881767A2BCF55981A3C8ED33BAE069CBE652FCA","0x14DC3F97387117CCA4884F28DCC82C9CF1B7101623B481FD3D1588F568B3E26B"]]],"shifted":null},{"unshifted":[["Finite",["0x0A10FA40BB6C61E8185412EE2BAE86C51D19EA7276593DFA7FA3FABB0345521F","0x3A8ACF73B5EF4E52ED5DC96404A60C69A067B84FE77211C5407A48437BD5CF89"]]],"shifted":null},{"unshifted":[["Finite",["0x21B2C2D62891139A91056B9D298DA8713B7ADA51963B864A5A2376771A1AA766","0x1AC7782A588865397F219624D70D11A109283E82B9CD50FFEE23753461E755FE"]]],"shifted":null},{"unshifted":[["Finite",["0x2763E7A5B2C387147A0381B50D5C504A5012B7F7CA474C2B4A351011B9BBD036","0x13DEA6F4AEBDC606331746A886756C7EA266A52F60B45DE5544A04BFDB277455"]]],"shifted":null},{"unshifted":[["Finite",["0x32596E43A053571EE478A3106CABFE9ECB29437F78A978409B4DDE33FE637103","0x3D76AF5EE3EFF37E666087AC2827A8BD0D9690BF440FF24434DA3E6AFF7A2AF4"]]],"shifted":null},{"unshifted":[["Finite",["0x1D73FE7224F38A37B2C69E22FA6750BABAED17B0F9998877B33E488D9063CE8E","0x3E24CEADB1BDA92A0DBDA0F90DF3B8FBD7C6F7ABCC039E9D41AB6916A799F645"]]],"shifted":null},{"unshifted":[["Finite",["0x2FDF5D887BC70465AFAC06B7A43632732B5AF0B933EA045D35E99D532BD44CAF","0x211A76FD7B76DF3E693CAA0BBB5C178D5DDE827AB6A902AF04AB39D8040E29DF"]]],"shifted":null},{"unshifted":[["Finite",["0x0D29BA887D54D915CFB321573463A3CAF5C354848A51FFD6D4FFC0E0B4464D39","0x232829C5C662E87CD033AFB3E84E86EC342F4942AC9D75123A21172EE06CF567"]]],"shifted":null}],"generic_comm":{"unshifted":[["Finite",["0x363662743B4E693E18C0CF5FB651DF1205BB27FABCD93ADF54ECD973B21B921B","0x116FBA051A4A146C88BCB0F2B56309429CD63514EEEFBE6EA0B39927E72BB20C"]]],"shifted":null},"psm_comm":{"unshifted":[["Finite",["0x0A8B3EF5670C6367C721EDAA40AF511C18B1602A4732FEA01124D5D949304324","0x1DBE04516C4A33CDFBBD1F54F413B9F21B5D41B6CD668B249879A2688693E51B"]]],"shifted":null},"complete_add_comm":{"unshifted":[["Finite",["0x1E859218F11F787CE75C06FD5303457CBD307BDEEB693CC66A235CB85B314D4B","0x228167E190903072E8F34BD7AF61A0C02DE0BC3D54FF8760A2BCBFDD6A880688"]]],"shifted":null},"mul_comm":{"unshifted":[["Finite",["0x3EC97D3A8CD405A92B31B67184817925B99B1527065A28677AEAAEC37CC7B9C5","0x3844006206FF29A55DBB44A3D06E46610639E24E960B4BC32A663EEC4D04C689"]]],"shifted":null},"emul_comm":{"unshifted":[["Finite",["0x114772020FAF5E6660D7D75B666B7121829027A866A8214B42899E824D820CB9","0x01F7FC015E2F0C5E02E34F0FD6FBA0FCE01E40EA183F0F6F7C197553524A96B9"]]],"shifted":null},"endomul_scalar_comm":{"unshifted":[["Finite",["0x04C30A9B6412594ECD5EEFCA20D4B759BBC52B08868E01F74FDC82B557A76ADD","0x019413D8112950CB93D20BA29452DC281FFE1A692706C34BD148E331F844D244"]]],"shifted":null},"xor_comm":null,"range_check0_comm":null,"range_check1_comm":null,"foreign_field_add_comm":null,"foreign_field_mul_comm":null,"rot_comm":null},"shifts":["0x0000000000000000000000000000000000000000000000000000000000000001","0x00B9CDC8FD0BD4B27E2A74AF7AEBD5734D52D75BDF85EBF1CAD03413E914A2E3","0x007CF68160D84012626E0046A932AD12E68B3394D6E2A001A537FFB40D3527C6","0x0077D45AECB939AE97A3952B48189964AA209609F19BE4A4B89F339A33440F6D","0x0077C7E54505D4771F6AF1FED2195500481EF1F3C0397B0AC819E678BD2309B4","0x00B3AF68ECC6AE7A4727F0708EDF4736BE1C99281FA380846E42264C62407484","0x00381CA4536FC0ED935D50A74A87136F1A0675B618898DBCE67E564AB20174A1"],"lookup_index":null},"data":{"constraints":16384}}
18 changes: 18 additions & 0 deletions src/app/print_blockchain_snark_vk/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
(executable
(name print_blockchain_snark_vk)
(libraries
blockchain_snark)
(instrumentation (backend bisect_ppx))
(preprocess (pps ppx_version)))

(rule
(deps print_blockchain_snark_vk.exe)
(targets blockchain_snark_vk.json.corrected)
(action
(with-stdout-to %{targets}
(run %{deps}))))

(rule
(alias runtest)
(action
(diff blockchain_snark_vk.json blockchain_snark_vk.json.corrected)))
1 change: 1 addition & 0 deletions src/app/print_blockchain_snark_vk/dune-project
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(lang dune 3.3)
41 changes: 41 additions & 0 deletions src/app/print_blockchain_snark_vk/print_blockchain_snark_vk.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
open Core_kernel

module Config = struct
let constraint_constants = Genesis_constants.Constraint_constants.compiled

let proof_level = Genesis_constants.Proof_level.Full
end

let () = Format.eprintf "Generating transaction snark circuit..@."

let before = Time.now ()

module Transaction_snark_instance = Transaction_snark.Make (Config)

let after = Time.now ()

let () =
Format.eprintf "Generated transaction snark circuit in %s.@."
(Time.Span.to_string_hum (Time.diff after before))

let () = Format.eprintf "Generating blockchain snark circuit..@."

let before = Time.now ()

module Blockchain_snark_instance =
Blockchain_snark.Blockchain_snark_state.Make (struct
let tag = Transaction_snark_instance.tag

include Config
end)

let after = Time.now ()

let () =
Format.eprintf "Generated blockchain snark circuit in %s.@."
(Time.Span.to_string_hum (Time.diff after before))

let () =
Lazy.force Blockchain_snark_instance.Proof.verification_key
|> Pickles.Verification_key.to_yojson |> Yojson.Safe.to_string
|> Format.print_string
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,13 @@ module Make (Inputs : Inputs_intf) = struct
}

let full_vk_commitments (t : Inputs.Verifier_index.t) :
( Inputs.Curve.Affine.t
, Inputs.Curve.Affine.t option )
( Inputs.Curve.Affine.t array
, Inputs.Curve.Affine.t array option )
Pickles_types.Plonk_verification_key_evals.Step.t =
let g c : Inputs.Curve.Affine.t =
let g c : Inputs.Curve.Affine.t array =
match Inputs.Poly_comm.of_backend_without_degree_bound c with
| `Without_degree_bound x ->
x.(0)
x
| `With_degree_bound _ ->
assert false
in
Expand Down
24 changes: 13 additions & 11 deletions src/lib/pickles/common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ let hash_messages_for_next_step_proof ~app_state
let g (x, y) = [ x; y ] in
Tick_field_sponge.digest Tick_field_sponge.params
(Types.Step.Proof_state.Messages_for_next_step_proof.to_field_elements t ~g
~comm:(fun (x : Tock.Curve.Affine.t) -> Array.of_list (g x))
~comm:(fun (x : Tock.Curve.Affine.t array) ->
Array.concat_map x ~f:(fun x -> Array.of_list (g x)) )
~app_state )

let dlog_pcs_batch (type nat proofs_verified total)
Expand Down Expand Up @@ -230,22 +231,23 @@ let tick_public_input_of_statement ~max_proofs_verified
~f:(Backend.Tick.Field.Vector.get input)

let ft_comm ~add:( + ) ~scale ~endoscale:_ ~negate
~verification_key:(m : _ Plonk_verification_key_evals.t) ~alpha:_
~verification_key:(m : _ array Plonk_verification_key_evals.t) ~alpha:_
~(plonk : _ Types.Wrap.Proof_state.Deferred_values.Plonk.In_circuit.t)
~t_comm =
let ( * ) x g = scale g x in
let _, [ sigma_comm_last ] =
Vector.split m.sigma_comm (snd (Plonk_types.Permuts_minus_1.add Nat.N1.n))
in
let f_comm = List.reduce_exn ~f:( + ) [ plonk.perm * sigma_comm_last ] in
let chunked_t_comm =
let n = Array.length t_comm in
let res = ref t_comm.(n - 1) in
let reduce_chunks comm =
let n = Array.length comm in
let res = ref comm.(n - 1) in
for i = n - 2 downto 0 do
res := t_comm.(i) + scale !res plonk.zeta_to_srs_length
res := comm.(i) + scale !res plonk.zeta_to_srs_length
done ;
!res
in
let _, [ sigma_comm_last ] =
Vector.split m.sigma_comm (snd (Plonk_types.Permuts_minus_1.add Nat.N1.n))
in
let sigma_comm_last = reduce_chunks sigma_comm_last in
let f_comm = List.reduce_exn ~f:( + ) [ scale sigma_comm_last plonk.perm ] in
let chunked_t_comm = reduce_chunks t_comm in
f_comm + chunked_t_comm
+ negate (scale chunked_t_comm plonk.zeta_to_domain_size)

Expand Down
Loading

0 comments on commit 035e9ff

Please sign in to comment.