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

[o1js-main] Add o1js-stub to Mina repo in place of SnarkyJS #14461

Merged
merged 55 commits into from
Dec 19, 2023
Merged
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5dfb734
run only fast checks in rosetta int tests
dkijania Sep 27, 2023
6118445
add fast script for rosetta
dkijania Sep 27, 2023
1d47673
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Sep 27, 2023
1d89857
correct path
dkijania Sep 28, 2023
287fdc4
Update rosetta-integration-tests-fast.sh
dkijania Sep 28, 2023
2109210
more validations
dkijania Sep 30, 2023
591b5bf
update counte
dkijania Sep 30, 2023
536d242
Revert "Auxiliary commit to revert individual files from 591b5bfb040d…
dkijania Oct 2, 2023
4066dc1
add quick test with minimal checks and no zkapps use for pull request…
dkijania Oct 2, 2023
32e266f
compilation fixes
dkijania Oct 2, 2023
356d7da
remove leftovers
dkijania Oct 2, 2023
e4ba43a
remove comment
dkijania Oct 2, 2023
6b55520
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Oct 2, 2023
528e0bf
remove zkapps completely
dkijania Oct 3, 2023
439ec8f
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Oct 3, 2023
daeaf73
Use zkapp_test_transaction for Rosetta integration tests (debug attem…
shimkiv Oct 5, 2023
43dec12
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
shimkiv Oct 5, 2023
d850951
Typo.
shimkiv Oct 5, 2023
16716c9
Typo.
shimkiv Oct 5, 2023
47e96fd
Sending zkapp txns agaisnt Daemon's GraphQL endpoint.
shimkiv Oct 5, 2023
f07fa96
Let's try with Python.
shimkiv Oct 5, 2023
e59e805
python3 -> python
shimkiv Oct 5, 2023
3403057
Install python.
shimkiv Oct 5, 2023
1ba5689
Install python.
shimkiv Oct 5, 2023
645a768
Install python and deps when needed (debugging attempt).
shimkiv Oct 5, 2023
b6a842a
Escaping quotes with jq.
shimkiv Oct 6, 2023
2d7a523
Tested network comms locally.
shimkiv Oct 6, 2023
b3f59d4
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
shimkiv Oct 6, 2023
e0286bd
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Oct 9, 2023
d45ab3e
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Oct 9, 2023
535358f
test full in PR
dkijania Oct 9, 2023
b829895
Merge remote-tracking branch 'origin/dkijania/tailor_rosetta_int_test…
dkijania Oct 9, 2023
0ebb8a6
log statements in rosetta
dkijania Oct 10, 2023
5b1cfc4
Merge branch 'berkeley' into dkijania/tailor_rosetta_int_tests
dkijania Oct 10, 2023
51347a5
feat(o1js-stubs): add new dune and o1js_stub.ml files for js_of_ocaml…
MartinMinkov Oct 29, 2023
ea04bcb
feat(kimchi): add kimchi lib from o1js-bindings
MartinMinkov Nov 13, 2023
7ae9412
refactor(nix): remove snarky_js and update paths for kimchi and plonk…
MartinMinkov Nov 13, 2023
587a888
feat(dune-project): add bindings_js package to support JavaScript bin…
MartinMinkov Nov 14, 2023
13b8d9f
chore(CODEOWNERS): remove snarkyjs directory from product-eng-reviewe…
MartinMinkov Nov 15, 2023
94bc10b
refactor(Makefile): remove snarkyjs and snarkyjs_no_types build targe…
MartinMinkov Nov 15, 2023
ad4d4d0
Merge branch 'o1js-main' into feat/add-o1js-stubs
mitschabaude Nov 29, 2023
e4249f5
remove(SnarkyJSTest.dhall): delete SnarkyJSTest.dhall file as it's no…
MartinMinkov Nov 30, 2023
7fa9a22
feat(buildkite/scripts): remove test-snarkyjs-bindings-minimal.sh and…
MartinMinkov Nov 30, 2023
2012e2d
chore: remove redundant SnarkyJS build scripts
MartinMinkov Nov 30, 2023
6287942
refactor(Makefile): remove snarkyjs and snarkyjs_no_types build targe…
MartinMinkov Nov 30, 2023
892a941
chore(CODEOWNERS): remove snarkyjs directory from product-eng-reviewe…
MartinMinkov Nov 30, 2023
ae94ff0
Merge branch 'feat/add-o1js-stubs' of github.com:MinaProtocol/mina in…
MartinMinkov Nov 30, 2023
c633177
Merge remote-tracking branch 'origin/dkijania/tailor_rosetta_int_test…
MartinMinkov Dec 11, 2023
8438840
Merge pull request #14683 from MinaProtocol/feat/port-rosetta-zkapp-c…
MartinMinkov Dec 11, 2023
07ba705
delete js_backend from crypto/kimchi
MartinMinkov Dec 11, 2023
3180007
[rosetta] Fix broken SQL quesry for zkapp account updates.
Sventimir Oct 18, 2023
d4314b0
Merge branch 'feat/add-o1js-stubs' of github.com:MinaProtocol/mina in…
MartinMinkov Dec 13, 2023
b6a14e0
move /kimchi/{wasm,js} to kimchi_bindings
mitschabaude Dec 18, 2023
f7a0abc
fix jsoo complaint about free variable tsBindings
mitschabaude Dec 18, 2023
cb151f6
add back newline
mitschabaude Dec 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use zkapp_test_transaction for Rosetta integration tests (debug attem…
…pt).
  • Loading branch information
shimkiv committed Oct 5, 2023
commit daeaf73b7ccb02096ea2357e8d86cc72a7032495
66 changes: 59 additions & 7 deletions buildkite/scripts/rosetta-integration-tests.sh
Original file line number Diff line number Diff line change
@@ -13,9 +13,9 @@ MODE="minimal"

while [ $# -gt 0 ]; do
case "$1" in
--mode=*)
MODE="${1#*=}"
;;
--mode=*)
MODE="${1#*=}"
;;
esac
shift
done
@@ -70,9 +70,18 @@ echo "=========================== GENERATING GENESIS LEDGER FOR ${MINA_NETWORK}
mkdir -p $MINA_KEYS_PATH
mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/block-producer.key
mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/snark-producer.key
mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/zkapp-fee-payer.key
mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/zkapp-sender.key
mina-dev advanced generate-keypair --privkey-path $MINA_KEYS_PATH/zkapp-account.key
chmod -R 0700 $MINA_KEYS_PATH
BLOCK_PRODUCER_PK=$(cat $MINA_KEYS_PATH/block-producer.key.pub)
SNARK_PRODUCER_PK=$(cat $MINA_KEYS_PATH/snark-producer.key.pub)
ZKAPP_FEE_PAYER_KEY=$MINA_KEYS_PATH/zkapp-fee-payer.key
ZKAPP_FEE_PAYER_PUB_KEY=$(cat ${ZKAPP_FEE_PAYER_KEY}.pub)
ZKAPP_SENDER_KEY=$MINA_KEYS_PATH/zkapp-sender.key
ZKAPP_SENDER_PUB_KEY=$(cat ${ZKAPP_SENDER_KEY}.pub)
ZKAPP_ACCOUNT_KEY=$MINA_KEYS_PATH/zkapp-account.key
ZKAPP_ACCOUNT_PUB_KEY=$(cat ${ZKAPP_ACCOUNT_KEY}.key.pub)

mkdir -p $MINA_CONFIG_DIR/wallets/store
cp $MINA_KEYS_PATH/block-producer.key $MINA_CONFIG_DIR/wallets/store/$BLOCK_PRODUCER_PK
@@ -84,8 +93,11 @@ cat <<EOF >"$MINA_CONFIG_FILE"
"ledger": {
"name": "${MINA_NETWORK}",
"accounts": [
{ "pk": "${BLOCK_PRODUCER_PK}", "balance": "1000", "delegate": null, "sk": null },
{ "pk": "${SNARK_PRODUCER_PK}", "balance": "2000", "delegate": "${BLOCK_PRODUCER_PK}", "sk": null }
{ "pk": "${BLOCK_PRODUCER_PK}", "balance": "11550000.000000000", "delegate": null, "sk": null },
{ "pk": "${SNARK_PRODUCER_PK}", "balance": "65500.000000000", "delegate": "${BLOCK_PRODUCER_PK}", "sk": null }
{ "pk": "${ZKAPP_FEE_PAYER_PUB_KEY}", "balance": "155.000000000", "delegate": null, "sk": null },
{ "pk": "${ZKAPP_SENDER_PUB_KEY}", "balance": "155.000000000", "delegate": null, "sk": null },
{ "pk": "${ZKAPP_ACCOUNT_PUB_KEY}", "balance": "155.000000000", "delegate": null, "sk": null },
]
}
}
@@ -151,6 +163,7 @@ mina-dev daemon \
--libp2p-keypair ${MINA_LIBP2P_KEYPAIR_PATH} \
--log-level ${LOG_LEVEL} \
--proof-level none \
--insecure-rest-server \
--rest-port ${MINA_GRAPHQL_PORT} \
--run-snark-worker "$SNARK_PRODUCER_PK" \
--seed \
@@ -166,6 +179,25 @@ until [ $daemon_status == "Synced" ]; do
echo "Daemon Status: ${daemon_status}"
done

debug_zkapp_output() {
echo ""
echo ""
echo "=========== DEBUG ZKAPP TXN (Start) ==========="
echo ""
echo ""
echo ${1}
echo ""
echo ""
echo "=========== DEBUG ZKAPP TXN (End) ==========="
echo ""
echo ""
}

echo "========================= ZKAPP ACCOUNT SETTING UP ==========================="
QUERY=$(zkapp_test_transaction create-zkapp-account --fee-payer-key ${ZKAPP_FEE_PAYER_KEY} --nonce 0 --sender-key ${ZKAPP_SENDER_KEY} --sender-nonce 0 --receiver-amount 1000 --zkapp-account-key ${ZKAPP_ACCOUNT_KEY} --fee 5 | sed 1,7d)
# TODO: Send txn against "http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql"
debug_zkapp_output "${QUERY}"

# Unlock Genesis Accounts
echo "==================== UNLOCKING GENESIS ACCOUNTS ======================"
mina-dev accounts unlock --public-key $BLOCK_PRODUCER_PK
@@ -181,7 +213,27 @@ send_payments() {
}
send_payments &

next_block_time=$(mina-dev client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') curr_time=$(date +%s%N | cut -b1-13)
ZKAPP_FEE_PAYER_NONCE=1
ZKAPP_SENDER_NONCE=1
ZKAPP_STATE=0
send_zkapp_transactions() {
while true; do
QUERY=$(zkapp_test_transaction transfer-funds-one-receiver --fee-payer-key ${ZKAPP_FEE_PAYER_KEY} --nonce ${ZKAPP_FEE_PAYER_NONCE} --sender-key ${ZKAPP_SENDER_KEY} --sender-nonce ${ZKAPP_SENDER_NONCE} --receiver-amount 1 --fee 5 --receiver ${ZKAPP_ACCOUNT_PUB_KEY} | sed 1,5d)
# TODO: Send txn against "http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql"
debug_zkapp_output "${QUERY}"
let ZKAPP_FEE_PAYER_NONCE++
let ZKAPP_SENDER_NONCE++

QUERY=$(zkapp_test_transaction update-state --fee-payer-key ${ZKAPP_FEE_PAYER_KEY} --nonce ${ZKAPP_FEE_PAYER_NONCE} --zkapp-account-key ${ZKAPP_SENDER_KEY} --zkapp-state ${ZKAPP_STATE} --fee 5 | sed 1,5d)
# TODO: Send txn against "http://127.0.0.1:${MINA_GRAPHQL_PORT}/graphql"
debug_zkapp_output "${QUERY}"
let ZKAPP_FEE_PAYER_NONCE++
let ZKAPP_STATE++
done
}
send_zkapp_transactions &

next_block_time=$(mina-dev client status --json | jq '.next_block_production.timing[1].time' | tr -d '"') curr_time=$(date +%s%N | cut -b1-13)
sleep_time=$((($next_block_time - $curr_time) / 1000))
echo "Sleeping for ${sleep_time}s until next block is created..."
sleep ${sleep_time}
@@ -204,4 +256,4 @@ if [[ $MODE == "full" ]]; then
echo "========================= ROSETTA CLI: CHECK:PERF ==========================="
echo "rosetta-cli check:perf" # Will run this command when tests are fully implemented

fi
fi
29 changes: 16 additions & 13 deletions dockerfiles/stages/3-builder
Original file line number Diff line number Diff line change
@@ -36,23 +36,25 @@ RUN mkdir ${HOME}/app

# --- Build libp2p_helper
RUN make libp2p_helper \
&& mv src/app/libp2p_helper/result/bin/libp2p_helper ${HOME}/app/libp2p_helper
&& mv src/app/libp2p_helper/result/bin/libp2p_helper ${HOME}/app/libp2p_helper

# --- Make rosetta-crucial components and the generate_keypair tool
# ---- Rosetta tests also need zkapp_test_transaction
RUN eval $(opam config env) \
&& dune build --profile=${DUNE_PROFILE} \
src/app/cli/src/mina_testnet_signatures.exe \
src/app/cli/src/mina_mainnet_signatures.exe \
src/app/archive/archive.exe \
src/app/archive_blocks/archive_blocks.exe \
src/app/extract_blocks/extract_blocks.exe \
src/app/missing_blocks_auditor/missing_blocks_auditor.exe \
src/app/replayer/replayer.exe \
src/app/rosetta/rosetta_testnet_signatures.exe \
src/app/rosetta/rosetta_mainnet_signatures.exe \
src/app/generate_keypair/generate_keypair.exe \
src/app/validate_keypair/validate_keypair.exe \
src/app/rosetta/ocaml-signer/signer.exe \
src/app/cli/src/mina_testnet_signatures.exe \
src/app/cli/src/mina_mainnet_signatures.exe \
src/app/archive/archive.exe \
src/app/archive_blocks/archive_blocks.exe \
src/app/extract_blocks/extract_blocks.exe \
src/app/missing_blocks_auditor/missing_blocks_auditor.exe \
src/app/replayer/replayer.exe \
src/app/rosetta/rosetta_testnet_signatures.exe \
src/app/rosetta/rosetta_mainnet_signatures.exe \
src/app/generate_keypair/generate_keypair.exe \
src/app/validate_keypair/validate_keypair.exe \
src/app/rosetta/ocaml-signer/signer.exe \
src/app/zkapp_test_transaction/zkapp_test_transaction.exe \
&& cp _build/default/src/app/archive_blocks/archive_blocks.exe $HOME/app/mina-archive-blocks \
&& cp _build/default/src/app/extract_blocks/extract_blocks.exe $HOME/app/mina-extract-blocks \
&& cp _build/default/src/app/missing_blocks_auditor/missing_blocks_auditor.exe $HOME/app/mina-missing-blocks-auditor \
@@ -65,6 +67,7 @@ RUN eval $(opam config env) \
&& mv _build/default/src/app/generate_keypair/generate_keypair.exe $HOME/app/mina-generate-keypair \
&& mv _build/default/src/app/validate_keypair/validate_keypair.exe $HOME/app/mina-validate-keypair \
&& mv _build/default/src/app/rosetta/ocaml-signer/signer.exe $HOME/app/mina-ocaml-signer \
&& mv _build/default/src/app/zkapp_test_transaction/zkapp_test_transaction.exe $HOME/app/zkapp_test_transaction \
&& rm -rf _build

# --- Clear go module caches to make the container smaller