What does this implement/fix? Explain your changes.
Executes the "trusted setup" process in-parallel to the "smart contracts deployment"(compilation + migrations) process which reduces system bootstap (./bin/start-nightfall / docker-compose up) time by up to 2 minutes (on local dev machines and ci agents alike). Executes 'truffle' commands via a "promisified" shell.
Executes the contracts setup (transfer of ownership and so) after both "trusted setup" and "smart contracts deployment" are concluded. Failure of any of the aforementioned stages should fail the entire bootsrap process.
Does this close any currently open issues?
There has been a relevant inline "TODO" but not an issue.
What commands can I run to test the change?
Build the core nf3 components via NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/setup-nightfall
Run the core nf3 components via NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/start-nightfall -g
Make sure deployer exits after properly deploying the contracts and performing trusted setup
Sucessfull boostrap
'deployer' should not report any errors and print "deployer bootstrap done" before exiting with code '0'
Contracts artifacts (JSON metadata files with ABIs and addresses) should be created on shared volume build
"Proving files" (global *.ptau files, per circuit <circuit_name>.zkey, <circuit_name>.r1c1, <circuit_name>.wasm) should be created on shared volume proving_files
Use-cases
Both "trusted setup" and "smart contracts deployment" are not skipped, ALWAYS_DO_TRUSTED_SETUP is unset and "proving files" are not present on shared volume, SKIP_DEPLOYMENT is not set to 'true'
"trusted setup" is skipped but "smart contracts deployment" is not, ALWAYS_DO_TRUSTED_SETUP is set or "proving files" are present on shared volume, SKIP_DEPLOYMENT is not set to 'true'
"trusted setup" is not skipped but "smart contracts deployment" is, ALWAYS_DO_TRUSTED_SETUP is unset and "proving files" are not present on shared volume, SKIP_DEPLOYMENT is set to 'true'
Both "trusted setup" and "smart contracts deployment" are skipped, ALWAYS_DO_TRUSTED_SETUP is set or "proving files" are present on shared volume, SKIP_DEPLOYMENT is set to 'true'
What does this implement/fix? Explain your changes.
Executes the "trusted setup" process in-parallel to the "smart contracts deployment"(compilation + migrations) process which reduces system bootstap (
./bin/start-nightfall
/docker-compose up
) time by up to 2 minutes (on local dev machines and ci agents alike). Executes 'truffle' commands via a "promisified" shell. Executes the contracts setup (transfer of ownership and so) after both "trusted setup" and "smart contracts deployment" are concluded. Failure of any of the aforementioned stages should fail the entire bootsrap process.Does this close any currently open issues?
There has been a relevant inline "TODO" but not an issue.
What commands can I run to test the change?
NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/setup-nightfall
NF_SERVICES_TO_START=blockchain,client,deployer,mongodb,optimist,rabbitmq,worker ./bin/start-nightfall -g
Sucessfull boostrap
build
*.ptau
files, per circuit<circuit_name>.zkey
,<circuit_name>.r1c1
,<circuit_name>.wasm
) should be created on shared volumeproving_files
Use-cases
ALWAYS_DO_TRUSTED_SETUP
is unset and "proving files" are not present on shared volume,SKIP_DEPLOYMENT
is not set to 'true'ALWAYS_DO_TRUSTED_SETUP
is set or "proving files" are present on shared volume,SKIP_DEPLOYMENT
is not set to 'true' "trusted setup" is not skipped but "smart contracts deployment" is,ALWAYS_DO_TRUSTED_SETUP
is unset and "proving files" are not present on shared volume,SKIP_DEPLOYMENT
is set to 'true'ALWAYS_DO_TRUSTED_SETUP
is set or "proving files" are present on shared volume,SKIP_DEPLOYMENT
is set to 'true'Any other comments?
Nope