Skip to content

Commit

Permalink
Merge branch 'develop' into merge-back-to-develop-2024-09-19
Browse files Browse the repository at this point in the history
  • Loading branch information
mrmr1993 committed Sep 19, 2024
2 parents 4d40716 + d55f0df commit a29d6dd
Show file tree
Hide file tree
Showing 59 changed files with 741 additions and 624 deletions.
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
### Build status

| Develop | Berkeley | Compatible |
| ------- | -------- | ---------- |
| [![Build status - develop](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=develop)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies) | [![Build status - berkeley](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=berkeley)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies) | [![Build status - compatible](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=compatible)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies)
| Develop | Compatible | Master |
| ------- | ---------- | ---------- |
| [![Build status - develop](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=develop)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies) | [![Build status - compatible](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=compatible)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies) | [![Build status - master](https://badge.buildkite.com/0c47452f3ea619d3217d388e0de522b218db28c3e161887a9a.svg?branch=master)](https://buildkite.com/o-1-labs-2/mina-end-to-end-nightlies)

<br />

<a href="https://minaprotocol.com">
<img src="https://github.com/MinaProtocol/docs/blob/main/public/static/img/svg/mina-wordmark-redviolet.svg?raw=true&sanitize=true" width="350" alt="Mina logo">
<img src="https://minaprotocol.com/wp-content/themes/minaprotocol/img/footerLogo.svg" width="350" alt="Mina logo" />
</a>

# Mina
<br />

Mina is the first cryptocurrency with a lightweight, constant-sized blockchain. This is the main source code repository for the Mina project and contains code for the OCaml protocol implementation, the [Mina Protocol website](https://minaprotocol.com), and wallet. Enjoy!

Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/build-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ make -C src/app/libp2p_helper
MAINNET_TARGETS=""
[[ ${MINA_BUILD_MAINNET} ]] && MAINNET_TARGETS="src/app/cli/src/mina_mainnet_signatures.exe src/app/rosetta/rosetta_mainnet_signatures.exe src/app/rosetta/ocaml-signer/signer_mainnet_signatures.exe"

echo "--- Build all major tagets required for packaging"
echo "--- Build all major targets required for packaging"
echo "Building from Commit SHA: ${MINA_COMMIT_SHA1}"
echo "Rust Version: $(rustc --version)"
dune build "--profile=${DUNE_PROFILE}" $INSTRUMENTED_PARAM \
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ source ~/.profile
./buildkite/scripts/build-artifact.sh

echo "--- Bundle all packages for Debian ${MINA_DEB_CODENAME}"
echo " Includes mina daemon, archive-node, rosetta, generate keypair for berkeley"
echo " Includes mina daemon, archive-node, rosetta, generate keypair for devnet"
[[ ${MINA_BUILD_MAINNET} ]] && echo " MINA_BUILD_MAINNET is true so this includes the mainnet and devnet packages for mina-daemon as well"


Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/check-compatibility.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function get_shas {

function image_tag {
SHA=$1
IMAGE_TAG="$SHA-bullseye-berkeley"
IMAGE_TAG="$SHA-bullseye-devnet"
}

function download-docker {
Expand Down
68 changes: 0 additions & 68 deletions buildkite/scripts/connect-to-berkeley.sh

This file was deleted.

62 changes: 30 additions & 32 deletions buildkite/scripts/connect-to-testnet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,53 +7,46 @@ if [[ $# -ne 3 ]]; then
exit 1
fi

TESTNET_VERSION_NAME="berkeley"
TESTNET_NAME=$1
WAIT_BETWEEN_POLLING_GRAPHQL=$2
WAIT_AFTER_FINAL_CHECK=$3

case "$BUILDKITE_PULL_REQUEST_BASE_BRANCH" in
rampup|berkeley|release/2.0.0|develop)
;;
*)
echo "Not pulling against rampup, not running the connect test"
exit 0 ;;
esac

# Don't prompt for answers during apt-get install
export DEBIAN_FRONTEND=noninteractive

apt-get update
apt-get install -y git apt-transport-https ca-certificates tzdata curl
sudo apt-get update
sudo apt-get install -y git apt-transport-https ca-certificates tzdata curl libwww-perl jq

git config --global --add safe.directory /workdir

source buildkite/scripts/export-git-env-vars.sh

source buildkite/scripts/debian/install.sh "mina-${TESTNET_VERSION_NAME}"
source buildkite/scripts/debian/install.sh "mina-${TESTNET_NAME}" 1

# Remove lockfile if present
rm ~/.mina-config/.mina-lock ||:
sudo rm ~/.mina-config/.mina-lock ||:

sudo mkdir -p /root/libp2p-keys/

mkdir -p /root/libp2p-keys/
# Pre-generated random password for this quick test
export MINA_LIBP2P_PASS=eithohShieshichoh8uaJ5iefo1reiRudaekohG7AeCeib4XuneDet2uGhu7lahf
mina libp2p generate-keypair --privkey-path /root/libp2p-keys/key
# Set permissions on the keypair so the daemon doesn't complain
chmod -R 0700 /root/libp2p-keys/
sudo chmod -R 0700 /root/libp2p-keys/
# Pre-generated random password for this quick test
sudo MINA_LIBP2P_PASS=eithohShieshichoh8uaJ5iefo1reiRudaekohG7AeCeib4XuneDet2uGhu7lahf mina libp2p generate-keypair --privkey-path /root/libp2p-keys/key

# Restart in the background
mina daemon \
--peer-list-url "https://storage.googleapis.com/seed-lists/${TESTNET_NAME}_seeds.txt" \
--libp2p-keypair "/root/libp2p-keys/key" \
& # -background
sudo MINA_LIBP2P_PASS=eithohShieshichoh8uaJ5iefo1reiRudaekohG7AeCeib4XuneDet2uGhu7lahf \
TESTNET_NAME=$TESTNET_NAME \
bash -c "mina daemon \
--peer-list-url \"https://storage.googleapis.com/seed-lists/${TESTNET_NAME}_seeds.txt\" \
--libp2p-keypair \"/root/libp2p-keys/key\" \
--seed &" # -background

# Attempt to connect to the GraphQL client every 10s for up to 8 minutes
num_status_retries=24
for ((i=1;i<=$num_status_retries;i++)); do
sleep $WAIT_BETWEEN_POLLING_GRAPHQL
set +e
mina client status
sudo mina client status
status_exit_code=$?
set -e
if [ $status_exit_code -eq 0 ]; then
Expand All @@ -63,13 +56,18 @@ for ((i=1;i<=$num_status_retries;i++)); do
fi
done

# Check that the daemon has connected to peers and is still up after 2 mins
sleep $WAIT_AFTER_FINAL_CHECK
mina client status
if [ $(mina advanced get-peers | wc -l) -gt 0 ]; then
echo "Found some peers"
else
echo "No peers found"
exit 1
fi
peer_retries=10
for ((i=1;i<=$peer_retries;i++)); do
peer_count=$(sudo mina advanced get-peers | wc -l)
sudo mina client status

if [ "$peer_count" -gt 0 ]; then
echo "Found some peers"
exit 0;
else
echo "No peers found"
fi
sleep $WAIT_AFTER_FINAL_CHECK
done

exit 1;
2 changes: 1 addition & 1 deletion buildkite/scripts/debian/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else
debs=(${DEBS//,/ })
for i in "${debs[@]}"; do
case $i in
mina-berkeley|mina-devnet|mina-mainnet|mina-berkeley-lightnet)
mina-devnet|mina-mainnet|mina-devnet-lightnet)
# Downaload mina-logproc too
source ./buildkite/scripts/download-artifact-from-cache.sh "mina-logproc*" $MINA_DEB_CODENAME/_build "" $LOCAL_DEB_FOLDER
;;
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/dump-mina-type-shapes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y git apt-transport-https ca-certificates tzdata curl

TESTNET_NAME="berkeley"
TESTNET_NAME="devnet"

git config --global --add safe.directory /workdir
source buildkite/scripts/export-git-env-vars.sh
Expand Down
8 changes: 5 additions & 3 deletions buildkite/scripts/rosetta-integration-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,12 @@ if [[ "$MODE" == "full" ]]; then
send_zkapp_transactions &
fi

next_block_time=$(mina 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))
mina client status --json

next_block_time=$(mina client status --json | jq '.next_block_production.timing[1]' | tr -d '"') curr_time=$(date +%s%N | cut -b1-13)
sleep_time=$((($next_block_time - $curr_time) / 10000000))
echo "Sleeping for ${sleep_time}s until next block is created..."
sleep ${sleep_time}
sleep $sleep_time

# Mina Rosetta Checks (spec construction data perf)
echo "============ ROSETTA CLI: VALIDATE CONF FILE ${ROSETTA_CONFIGURATION_FILE} =============="
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/run-snark-transaction-profiler.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y git apt-transport-https ca-certificates tzdata curl python3

TESTNET_NAME="berkeley"
TESTNET_NAME="devnet"

git config --global --add safe.directory /workdir
source buildkite/scripts/export-git-env-vars.sh
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/run-test-executive-cloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -o pipefail -x

TEST_NAME="$1"
MINA_IMAGE="gcr.io/o1labs-192920/mina-daemon:$MINA_DOCKER_TAG-berkeley"
MINA_IMAGE="gcr.io/o1labs-192920/mina-daemon:$MINA_DOCKER_TAG-devnet"
ARCHIVE_IMAGE="gcr.io/o1labs-192920/mina-archive:$MINA_DOCKER_TAG"

if [[ "${TEST_NAME:0:15}" == "block-prod-prio" ]] && [[ "$RUN_OPT_TESTS" == "" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions buildkite/scripts/run-test-executive-local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ cleanup

TEST_NAME="$1"

MINA_IMAGE="gcr.io/o1labs-192920/mina-daemon:$MINA_DOCKER_TAG-berkeley"
MINA_IMAGE="gcr.io/o1labs-192920/mina-daemon:$MINA_DOCKER_TAG-devnet"
ARCHIVE_IMAGE="gcr.io/o1labs-192920/mina-archive:$MINA_DOCKER_TAG"

if [[ "${TEST_NAME:0:15}" == "block-prod-prio" ]] && [[ "$RUN_OPT_TESTS" == "" ]]; then
Expand All @@ -42,7 +42,7 @@ rm -f /etc/apt/sources.list.d/hashicorp.list
apt-get update
apt-get install -y git apt-transport-https ca-certificates tzdata curl

TESTNET_NAME="berkeley"
TESTNET_NAME="devnet"

git config --global --add safe.directory /workdir

Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/run_promote_build_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ DHALL_DEBIANS="([] : List $DEBIAN_DHALL_DEF.Type)"
if [[ -n "$DEBIANS" ]]; then
if [[ -z "$CODENAMES" ]]; then usage "Codenames is not set!"; exit 1; fi;
if [[ -z "$PROFILE" ]]; then PROFILE="Standard"; fi;
if [[ -z "$NETWORK" ]]; then NETWORK="Berkeley"; fi;
if [[ -z "$NETWORK" ]]; then NETWORK="Devnet"; fi;
if [[ -z "$REMOVE_PROFILE_FROM_NAME" ]]; then REMOVE_PROFILE_FROM_NAME=0; fi;
if [[ -z "$PUBLISH" ]]; then PUBLISH=0; fi;
if [[ -z "$FROM_CHANNEL" ]]; then FROM_CHANNEL="Unstable"; fi;
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/run_verify_promoted_build_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ DHALL_DEBIANS="([] : List $DEBIAN_DHALL_DEF.Type)"
if [[ -n "$DEBIANS" ]]; then
if [[ -z "$CODENAMES" ]]; then usage "Codenames is not set!"; exit 1; fi;
if [[ -z "$PROFILE" ]]; then PROFILE="Standard"; fi;
if [[ -z "$NETWORK" ]]; then NETWORK="Berkeley"; fi;
if [[ -z "$NETWORK" ]]; then NETWORK="Devnet"; fi;
if [[ -z "$REMOVE_PROFILE_FROM_NAME" ]]; then REMOVE_PROFILE_FROM_NAME=0; fi;
if [[ -z "$PUBLISH" ]]; then PUBLISH=0; fi;
if [[ -z "$TO_CHANNEL" ]]; then TO_CHANNEL="Unstable"; fi;
Expand Down
2 changes: 1 addition & 1 deletion buildkite/scripts/single-node-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git config --global --add safe.directory /workdir

source buildkite/scripts/export-git-env-vars.sh

source buildkite/scripts/debian/install.sh "mina-test-suite,mina-berkeley-lightnet" 1
source buildkite/scripts/debian/install.sh "mina-test-suite,mina-devnet-lightnet" 1

export MINA_LIBP2P_PASS="naughty blue worm"
export MINA_PRIVKEY_PASS="naughty blue worm"
Expand Down
8 changes: 4 additions & 4 deletions buildkite/scripts/unit-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export LIBP2P_NIXLESS=1 PATH=/usr/lib/go/bin:$PATH GO=/usr/lib/go/bin/go
time make build

echo "--- Build all targets"
dune build "${path}" --profile="${profile}" -j16
dune build "${path}" --profile="${profile}" -j8

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

# Turn on the proof-cache assertion, so that CI will fail if the proofs need to
# be updated.
Expand All @@ -35,8 +35,8 @@ export ERROR_ON_PROOF=true
# skip running all of the tests that have already succeeded, since dune will
# only retry those tests that failed.
echo "--- Run unit tests"
time dune runtest "${path}" --profile="${profile}" -j16 || \
time dune runtest "${path}" --profile="${profile}" -j8 || \
(./scripts/link-coredumps.sh && \
echo "--- Retrying failed unit tests" && \
time dune runtest "${path}" --profile="${profile}" -j16 || \
time dune runtest "${path}" --profile="${profile}" -j8 || \
(./scripts/link-coredumps.sh && false))
2 changes: 1 addition & 1 deletion buildkite/scripts/version-linter.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if [[ $# -ne 1 ]]; then
exit 1
fi

TESTNET_NAME="${TESTNET_NAME:-berkeley}"
TESTNET_NAME="${TESTNET_NAME:-devnet}"

# Don't prompt for answers during apt-get install
export DEBIAN_FRONTEND=noninteractive
Expand Down
11 changes: 4 additions & 7 deletions buildkite/src/Command/ConnectToTestnet.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ let Command = ./Base.dhall

let Size = ./Size.dhall

let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type
let RunInToolchain = ./RunInToolchain.dhall

let Cmd = ../Lib/Cmds.dhall
let B/SoftFail = B.definitions/commandStep/properties/soft_fail/Type

in { step =
\(dependsOn : List Command.TaggedKey.Type)
Expand All @@ -17,12 +17,9 @@ in { step =
-> Command.build
Command.Config::{
, commands =
[ Cmd.runInDocker
Cmd.Docker::{
, image = (../Constants/ContainerImages.dhall).ubuntu2004
}
RunInToolchain.runInToolchain
([] : List Text)
"./buildkite/scripts/connect-to-testnet.sh ${testnet} ${wait_between_graphql_poll} ${wait_before_final_check}"
]
, label = "Connect to ${testnet}"
, soft_fail = Some soft_fail
, key = "connect-to-${testnet}"
Expand Down
Loading

0 comments on commit a29d6dd

Please sign in to comment.