Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
169 commits
Select commit Hold shift + click to select a range
e16d11a
skip tests when building nodejs dependency for nix flake
hattyhattington17 Jun 1, 2025
20a9264
Merge branch 'compatible' into hattyhattington17/nix-skip-nodetests
hattyhattington17 Jul 15, 2025
aa12df7
apply caqti upgrade from 1.5.0 -> 2.0.1
dkijania Mar 12, 2025
cd41822
fix rosetta psql issue (could not determine data type of parameter) b…
dkijania Mar 12, 2025
d3ece53
remove bounded types
dkijania Aug 13, 2025
6abe968
install wget and update containers
dkijania Aug 13, 2025
2803494
remove error silencing code
dkijania Aug 13, 2025
183fee5
Sparse Ledger Lib: document Sparse_ledger
glyh Aug 13, 2025
33e8f29
Merkle Mask: expose a `maps_fold_mask` that could be folded across di…
glyh Aug 18, 2025
d3066cc
Staged_ledger: implement `accumulate_maps_dup` that folds over all ma…
glyh Aug 18, 2025
844a4d8
Fix type mismatch in Base ledger
glyh Aug 18, 2025
3b8c82e
Merge branch 'compatible' into hattyhattington17/nix-skip-nodetests
hattyhattington17 Aug 18, 2025
58b1eb1
comment explaining why node tests are skipped
hattyhattington17 Aug 18, 2025
c73fba7
Merge branch 'compatible' into dkijania/reimplement_caqti_upgrade
georgeee Aug 19, 2025
13a8519
Mina StdLib > Nonempty List: implement [mapi]
glyh Jul 28, 2025
c82d36f
UNCOMPILABLE Snark Work Lib > Id: Add Range to subzkapp spec
glyh Jul 29, 2025
eab388a
Define and use a Config.t type for Root ledgers
cjjdespres Aug 19, 2025
947235c
Improve move_backing_exn documentation
cjjdespres Aug 18, 2025
609388f
introduced demo mode for mina-local-network script.
dkijania Aug 19, 2025
ac28b93
fix bash lint issue
dkijania Aug 19, 2025
cab3cac
changelog
dkijania Aug 19, 2025
d085504
UNCOMPILABLE Redesign pending zkapp command, so merging doesn't assum…
glyh Jul 29, 2025
b37e2ea
Work Partitioner: adapt to new Pending Zkapp Command API
glyh Aug 19, 2025
f0b973f
Work Partitioner: remove subzkapp id gen as no longer used
glyh Jul 29, 2025
caea5f7
Work Partitioner > submit_into_pending_zkapp_command: factor out help…
glyh Aug 19, 2025
77da393
Merge pull request #17636 from MinaProtocol/lyh/fix-pending-zkapp-3
glyh Aug 20, 2025
a1001fa
Consensus: in Genesis_epoch_ledger, store Genesis_ledger.Packed.t ins…
glyh Aug 20, 2025
f2470c6
Populate change to Consensus > Genesis_epoch_ledger across the codebase
glyh Aug 20, 2025
f4295b2
Block Time: Remove Controller.create
glyh Jul 30, 2025
23beda0
Snark Worker & Snark Coordinator: pass back spec on submission combin…
glyh Aug 20, 2025
6471416
Merge pull request #17601 from MinaProtocol/lyh/remove-blockt-time-co…
glyh Aug 20, 2025
f56ee20
Merge pull request #16704 from MinaProtocol/dkijania/reimplement_caqt…
dkijania Aug 20, 2025
3dcea19
Add a flag to pad app_state
georgeee Aug 20, 2025
281ee08
Add changelog for #17646
georgeee Aug 20, 2025
320b48d
Merge pull request #17317 from MinaProtocol/hattyhattington17/nix-ski…
hattyhattington17 Aug 20, 2025
e00273e
Merge pull request #17641 from MinaProtocol/lyh/improve-genesis-ledge…
cjjdespres Aug 20, 2025
a2e2254
Snark Work Lib > Partitioned Result: deriving to_yojson
glyh Aug 20, 2025
48816b3
Snark Work Lib > Partitioned Spec: allow unwrap sok message from part…
glyh Aug 20, 2025
0a742ce
Txn Snark: push sig kind out of txn validator
glyh Aug 21, 2025
c7edc96
Propagate change of sig kind pushing from `Transaction_snark.Transact…
glyh Aug 21, 2025
74c1e01
Merge pull request #17633 from MinaProtocol/cjjdespres/add-root-locat…
glyh Aug 21, 2025
63221ae
Push sig kind out of user command input
glyh Aug 21, 2025
dafefcb
Propagate change of sig kind pushing from `User_command_input` across…
glyh Aug 21, 2025
aafd889
Make merkle_ledger_tests a separate package
georgeee Aug 21, 2025
0eb273b
Merge pull request #17649 from MinaProtocol/lyh/push-sig-kind-user-cm…
glyh Aug 21, 2025
f413841
Consider TMPDIR in computing s3_install_path
georgeee Aug 21, 2025
7164ea4
Merge pull request #17626 from MinaProtocol/lyh/staged-ledger-migration
cjjdespres Aug 21, 2025
5a4901a
Merge pull request #17650 from MinaProtocol/lyh/push-sig-kind-out-of-…
glyh Aug 21, 2025
aeff4b6
Merge pull request #17623 from MinaProtocol/lyh/document-sparse-ledger
glyh Aug 21, 2025
58336f9
Move fork_config breadcrumb code into mina_lib
cjjdespres Aug 18, 2025
8cbfa63
Move hard fork breadcrumb code into mina_lib
cjjdespres Aug 18, 2025
99c5869
Move hard fork epoch ledger fetching into mina lib
cjjdespres Aug 18, 2025
dffbb81
Use consistent naming in hard fork config
cjjdespres Aug 18, 2025
7403986
Move full hard fork config input prep to mina lib
cjjdespres Aug 18, 2025
7f80c2b
Use Or_error more consistently in hard fork config
cjjdespres Aug 21, 2025
89c2399
Store hard fork epoch seeds as Epoch_seed.t
cjjdespres Aug 21, 2025
11e26fb
Remove some unnecessary qualification
cjjdespres Aug 21, 2025
5b4819b
Merge pull request #17651 from MinaProtocol/georgeee/fix-granular-nix…
cjjdespres Aug 21, 2025
305e301
Merge pull request #17646 from MinaProtocol/georgeee/pad-app-state-in…
cjjdespres Aug 21, 2025
4447cb0
Allow to pull debian from special folder (like legacy etc.) which are…
dkijania Aug 21, 2025
5ab2612
support deb_suffix in MinaArtifact command. This will allow in future…
dkijania Aug 21, 2025
4264482
allow to build hf packages locally using Makefile
dkijania Aug 21, 2025
5e7cdbe
Merge pull request #17639 from MinaProtocol/dkijania/mina-local-netwo…
dkijania Aug 21, 2025
a1d298d
Merge pull request #17656 from MinaProtocol/dkijania/pull_deb_from_sp…
dkijania Aug 22, 2025
371ad20
fix shebang
dkijania Aug 22, 2025
f538805
Consolidate multiple function calls into pipeline
cjjdespres Aug 22, 2025
b5eb433
Merge pull request #17655 from MinaProtocol/cjjdespres/prepare-fork-c…
cjjdespres Aug 22, 2025
5bb3817
convert suffix to optional
dkijania Aug 22, 2025
4680ec6
Use Stable.Latest in Account.Unstable definition
cjjdespres Aug 22, 2025
fc6be4c
Add Hardfork variants of account types
cjjdespres Aug 22, 2025
6d968e6
Merkle Ledger: create concrete interface for Converting_merkle_tree.Make
glyh Aug 20, 2025
6fea579
Merkle Ledger: create concrete interface for Converting_merkle_tree.W…
glyh Aug 20, 2025
2b643f9
Merkle Ledger: refactor Intf structure
glyh Aug 20, 2025
0fbcb7e
Mina Ledger > Ledger: expose Converting_ledger and Unstable_db
glyh Aug 25, 2025
5aab2bd
Converting Merkle Tree: don't use destructive assign for types genera…
glyh Aug 25, 2025
745b23f
Mina Ledger > {Ledger, Root}: make Converting Ledger & Unstable DB in…
glyh Aug 25, 2025
cd24c96
Mina Ledger > Root: implement converting ledger backed Root.Make
glyh Aug 25, 2025
df5c5b8
Propagate new logger required for creating Mina_ledger.Ledger.Root ac…
glyh Aug 25, 2025
b7d1329
move `Merkle_ledger.Location.Bigstring` to `Mina_stdlib` and lift `Me…
glyh Aug 22, 2025
02338a8
Merge pull request #17657 from MinaProtocol/dkijania/support_deb_suffix
dkijania Aug 25, 2025
acd667e
Merge pull request #17667 from MinaProtocol/lyh/add-interfaces-on-con…
glyh Aug 25, 2025
0d63952
Merge pull request #17658 from MinaProtocol/dkijania/allow_to_build_h…
dkijania Aug 25, 2025
8b24db9
Merge pull request #17668 from MinaProtocol/lyh/add-converting-ledger…
glyh Aug 25, 2025
5cfa853
reimplement hardfork package generation pipeline
dkijania Aug 21, 2025
ba9dfc7
fix bash shellcheck
dkijania Aug 25, 2025
1a5c131
fix dhall
dkijania Aug 25, 2025
c102aa7
Mina Ledger > Root.Make(_) > Config: use config from Converting_merkl…
glyh Aug 26, 2025
2961dcf
Merge pull request #17653 from MinaProtocol/georgeee/use-tmpdir-env-v…
glyh Aug 26, 2025
05fccae
Merge pull request #17662 from MinaProtocol/lyh/move-bigstring-to-min…
glyh Aug 26, 2025
49403c3
Merge pull request #17648 from MinaProtocol/lyh/various-helpers-snark…
glyh Aug 26, 2025
4f09f52
Revert "Fix type mismatch in Base ledger"
glyh Aug 26, 2025
6e34908
Revert "Staged_ledger: implement `accumulate_maps_dup` that folds ove…
glyh Aug 26, 2025
7cd477a
Revert "Merkle Mask: expose a `maps_fold_mask` that could be folded a…
glyh Aug 26, 2025
272ab3d
Merkle Ledger: concretize type of Location in Intf.Ledger.S
glyh Aug 26, 2025
fbb7f38
Masking Merkle Tree: replace {Location_binable -> Location} in
glyh Aug 26, 2025
ffc05b5
Merkle Ledger: add new function `all_accounts_on_mask` on all ledgers
glyh Aug 26, 2025
82056c3
Merge pull request #17663 from MinaProtocol/cjjdespres/add-hardfork-a…
glyh Aug 26, 2025
b307b21
Mina_{run,lib}: Document the purpose of the library
glyh Jul 28, 2025
d19eb05
Merge pull request #17582 from MinaProtocol/lyh/document-mina-lib-and…
glyh Aug 26, 2025
6d6a207
Push sig kind out of Archive.Lib.Processor
glyh Aug 25, 2025
c29e99e
added trusted part in debian import if repo is unsigned
dkijania Aug 26, 2025
4a23b3f
disable SC1090 shellcheck warning
dkijania Aug 26, 2025
9636715
skip building hardfork package for PR
dkijania Aug 26, 2025
56008b1
remove debugging output and add guardian for aws existance and permis…
dkijania Aug 26, 2025
3e1c9e7
add prepare command for requirements installation in Makefile
dkijania Aug 26, 2025
fa229ea
Merge pull request #17672 from MinaProtocol/lyh/sig-kind-archive-proc…
glyh Aug 26, 2025
7446833
Mina Ledger > Root.Make(_).Config: delete any potential backings in `…
glyh Aug 27, 2025
317dfe3
FIX(Merkle_Ledger > Any_ledger): dynamic dispatching `all_accounts_on…
glyh Aug 27, 2025
a27a83b
Masking Merkle Tree: panic if mask is not attached when invoking `all…
glyh Aug 27, 2025
884e067
Merge pull request #17674 from MinaProtocol/lyh/ledger-mask-convertin…
glyh Aug 27, 2025
9e8fe9e
Mina Ledger > Root: add `delete_backing` and use it when config is pr…
glyh Aug 27, 2025
1102b3a
Mina Lib: use converting_db backed root in some tests
glyh Aug 27, 2025
2d2f3ec
Mina Ledger > Root: remove outdated TODO
glyh Aug 27, 2025
0f34a24
Mina Ledger > Root.Make(_) > Config: remove primary_directory, and re…
glyh Aug 27, 2025
20c7b05
Propagate change in Ledger.Root removing function `primary_directory`
glyh Aug 27, 2025
aea9b7d
Merge pull request #17680 from MinaProtocol/dkijania/further_hf_local…
dkijania Aug 27, 2025
9a5978d
Merge pull request #17679 from MinaProtocol/dkijania/relman_trusted
dkijania Aug 27, 2025
0445a69
Merge pull request #17643 from MinaProtocol/lyh/pass-back-spec-on-res…
glyh Aug 27, 2025
0cf3dc9
Mina Metrics: rename {snark_work_base_time_sec -> snark_work_base_tim…
glyh Aug 28, 2025
b5907fd
Merge pull request #17669 from MinaProtocol/lyh/converting-ledger-bac…
glyh Aug 28, 2025
2ba823a
Snark Work Lib: implement Metrics, this module would track metrics ob…
glyh Aug 28, 2025
08b8889
replace metrics generation in Snark_worker.Entry and Init.Mina_run wi…
glyh Aug 28, 2025
ef3d49d
Merge pull request #17670 from MinaProtocol/lyh/remove-primary-dir-in…
glyh Aug 28, 2025
a8b342d
Merge pull request #17675 from MinaProtocol/lyh/folding-accounts-on-l…
glyh Aug 28, 2025
f7dc9cc
Add Hardfork_Db in Mina_ledger.Ledger
glyh Aug 26, 2025
156bb27
Staged Ledger: add `convert_and_apply_all_masks_to_ledger`
glyh Aug 26, 2025
d77caf6
fixing review nits
dkijania Aug 28, 2025
990b5cd
Merge pull request #17677 from MinaProtocol/lyh/staged-ledger-convert…
glyh Aug 28, 2025
a7179db
Remove transfer_accounts_with from Root
cjjdespres Aug 28, 2025
25e1200
Merge pull request #17617 from MinaProtocol/dkijania/bring_back_hardf…
dkijania Aug 28, 2025
19b822f
Merge pull request #17687 from MinaProtocol/cjjdespres/remove-transfe…
cjjdespres Aug 28, 2025
bdf4704
gitignore: remove duplicated entry
glyh Aug 29, 2025
9ad59f9
introduce two hardfork artifact one for legacy mode which requires ne…
dkijania Aug 29, 2025
2e681f4
Merge branch 'dkijania/publish_debian_for_master' into dkijania/publi…
dkijania Aug 29, 2025
b7e49b4
Merge pull request #17694 from MinaProtocol/lyh/clean-gitignore
glyh Aug 30, 2025
d7b5306
Merge pull request #17696 from MinaProtocol/dkijania/introduce_two_hf…
dkijania Aug 30, 2025
2bee4e4
Merge remote-tracking branch 'origin/master' into compatible
glyh Aug 31, 2025
d4f74dc
Remove debug_assert library and replace all use with native assert
glyh Aug 29, 2025
0238185
Merge pull request #17698 from MinaProtocol/dkijania/publish_debian_f…
dkijania Aug 31, 2025
48eb952
add support for jammy
dkijania Sep 1, 2025
c683ace
added support for jammy mainnet
dkijania Sep 1, 2025
51580a9
WIP
dkijania Sep 1, 2025
f1bfe41
add jammy toolchain
dkijania Sep 1, 2025
58da522
Push sig kind out of snark worker
glyh Sep 2, 2025
0213be7
Push sig kind out of Network Pool > Txn Pool
glyh Sep 2, 2025
9ebcbdb
Propagate sig kind pushing of txn pool across codebase
glyh Sep 2, 2025
01ec34c
Update ContainerImages.dhall
dkijania Sep 2, 2025
b1d7563
fix permission when installing awscli
dkijania Sep 2, 2025
9dd2827
update jammy toolchain hash
dkijania Sep 2, 2025
33b3735
Merge pull request #17704 from MinaProtocol/lyh/push-sig-kind-out-of-…
glyh Sep 2, 2025
9344f34
Merge pull request #17700 from MinaProtocol/lyh/merge-master-to-compa…
glyh Sep 2, 2025
c019ad5
Merge branch 'compatible' into dkijania/support_for_jammy
dkijania Sep 2, 2025
b726230
Merge pull request #17695 from MinaProtocol/lyh/remove-debug-assert
glyh Sep 2, 2025
f103cfb
changelog
dkijania Sep 2, 2025
114f836
Merge pull request #17702 from MinaProtocol/dkijania/support_for_jammy
dkijania Sep 2, 2025
1add3bd
Merge pull request #17705 from MinaProtocol/lyh/push-sig-kind-txn-pool
glyh Sep 2, 2025
2efbf1d
Merge origin/compatible
glyh Sep 3, 2025
fbacc25
Replace snark_worker_zkapp_transition_time with snark_worker_{non,}zk…
glyh Sep 3, 2025
7220c32
Change log for snark worker metrics refactoring
glyh Sep 3, 2025
f4980c1
Merge pull request #17681 from MinaProtocol/lyh/tests-for-mina-ledger…
glyh Sep 3, 2025
dcadaec
Snark Work Lib > Metrics: Support legacy metrics computation mode
glyh Sep 4, 2025
a13391d
Merge branch 'compatible' into lyh/update-snark-worker-protocol-develop
glyh Sep 4, 2025
d8b55c4
UNCOMPILABLE Snark Worker: update RPC to V3
glyh Jun 12, 2025
ef334b2
UNCOMPILABLE Snark Worker: update prod worker implementation so we st…
glyh Aug 20, 2025
dd6de6c
UNCOMPILABLE Snark Worker > Entry: adapt prod worker driver to new pr…
glyh Sep 4, 2025
8baaa96
UNCOMPILABLE Mina Lib: update to adapt to new Snark Worker RPC protocol
glyh Aug 20, 2025
a80a05b
UNCOMPILABLE Mina Run: update to adapt to new Snark Worker Protocol
glyh Sep 4, 2025
dcf1475
Mina GraphQL: adapt to renamed function in Mina_lib
glyh Aug 20, 2025
aa5d59f
Merge compatible to develop and resolve conflicts at SNARK worker RPC…
glyh Sep 4, 2025
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ result
*.aux
src/config.mlh
src/config/config.mlh
src/external/ocaml-rocksdb/rocksdb
.stack-work/
/wallet-keys/
test_output
Expand Down
73 changes: 73 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,32 @@ LIBP2P_HELPER_SIG := $(shell cd src/app/libp2p_helper ; find . -type f -print0
help: ## Display this help information
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'


########################################
.PHONY: add-o1labs-opam-repo
add-o1labs-opam-repo:
opam repository add --yes --all --set-default o1-labs https://github.com/o1-labs/opam-repository.git

.PHONY: prepare
prepare: add-o1labs-opam-repo
@echo "Preparing the environment and installing dependencies..."
@# Check Go installation and version
@command -v go >/dev/null 2>&1 || { echo >&2 "Error: Go is not installed. Please install Go before continuing. You can use gvm to install the appropriate Go environment."; exit 1; }
@GO_VERSION=$$(go version | awk '{print $$3}' | sed 's/go//'); \
GO_MOD_PATH="src/app/libp2p_helper/src/go.mod"; \
REQUIRED_GO_VERSION=$$(grep -E "^go [0-9]+\.[0-9]" $$GO_MOD_PATH | awk '{print $$2}'); \
if ! printf '%s\n%s\n' "$$REQUIRED_GO_VERSION" "$$GO_VERSION" | sort -V | head -n1 | grep -q "^$$REQUIRED_GO_VERSION$$"; then \
echo "Error: Go version $$GO_VERSION is not compatible. Required version is $$REQUIRED_GO_VERSION or newer (only minor)."; \
exit 1; \
fi; \
echo "Go version $$GO_VERSION detected (requirement: $$REQUIRED_GO_VERSION or newer (only minor))"
opam switch import --switch mina --yes opam.export
eval $(opam env --switch=mina --set-switch)
chmod +x scripts/pin-external-packages.sh
./scripts/pin-external-packages.sh
@echo "Environment prepared. You can now run 'make build' to build the project."


########################################
## Code

Expand Down Expand Up @@ -553,6 +579,14 @@ debian-build-rosetta-devnet: ## Build the Debian Rosetta package for devnet
debian-build-rosetta-mainnet: ## Build the Debian Rosetta package for mainnet
$(call build_debian_package,rosetta_mainnet)

.PHONY: debian-build-daemon-devnet-hardfork
debian-build-daemon-devnet-hardfork: ## Build the Debian daemon package for devnet hardfork
$(call build_debian_package,daemon_devnet_hardfork)

.PHONY: debian-download-create-legacy-hardfork
debian-download-create-legacy-hardfork: ## Download and create legacy hardfork Debian packages
$(info 📦 Downloading legacy hardfork Debian packages for debian $(CODENAME))
@./buildkite/scripts/release/manager.sh pull --artifacts mina-create-legacy-genesis --from-special-folder legacy/debians/$(CODENAME) --backend hetzner --target _build
########################################
# Docker images

Expand Down Expand Up @@ -649,6 +683,45 @@ docker-build-rosetta-mainnet: SHELL := /bin/bash
docker-build-rosetta-mainnet: start-local-debian-repo ## Build the Rosetta Docker image for mainnet
$(call build_docker_image,mina-rosetta,mainnet)

########################################
# Generate hardfork packages

.PHONY: hardfork-debian
hardfork-debian: SHELL := /bin/bash
hardfork-debian: ocaml_checks ## Generate hardfork packages
$(info 📦 Generating hardfork packages for network $(NETWORK_NAME))

@BUILD_DIR=./_build \
MINA_DEB_CODENAME=$(CODENAME) \
BRANCH_NAME=$(BRANCH_NAME) \
KEEP_MY_TAGS_INTACT=true \
./scripts/hardfork/build-packages.sh daemon_devnet_hardfork


.PHONY: hardfork-docker
hardfork-docker: SHELL := /bin/bash
hardfork-docker: ocaml_checks ## Generate hardfork packages
$(info 📦 Generating hardfork docker for network $(NETWORK_NAME))

$(MAKE) hardfork-debian
$(MAKE) start-local-debian-repo

@BUILD_DIR=./_build \
MINA_DEB_CODENAME=$(CODENAME) \
KEEP_MY_TAGS_INTACT=true \
. ./scripts/export-git-env-vars.sh \
&& ./scripts/docker/build.sh \
--deb-codename $(CODENAME) \
--service mina-daemon \
--version "$$MINA_DEB_VERSION" \
--branch $(BRANCH_NAME) \
--network $(NETWORK_NAME) \
--deb-suffix hardfork \
--no-cache

$(info 📦 stopping local Debian repository)
@./scripts/debian/aptly.sh stop

########################################
# Generate odoc documentation

Expand Down
3 changes: 0 additions & 3 deletions buildkite/scripts/build-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ set -eo pipefail

([ -z ${DUNE_PROFILE+x} ] || [ -z ${MINA_DEB_CODENAME+x} ]) && echo "required env vars were not provided" && exit 1

# shellcheck disable=SC1090
source ~/.profile

./buildkite/scripts/build-artifact.sh

echo "--- Bundle all packages for Debian ${MINA_DEB_CODENAME}"
Expand Down
77 changes: 77 additions & 0 deletions buildkite/scripts/entrypoints/run-hardfork-package-gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash

# Generate Hardfork Package Build Script
#
# This script generates Dhall configuration for creating hardfork packages in the Mina protocol
# build system. It converts input parameters to Dhall format and outputs YAML configuration
# for the buildkite pipeline.
#
# USAGE:
# ./run-hardfork-package-gen.sh
#
# REQUIRED ENVIRONMENT VARIABLES:
# CODENAMES - Comma-separated list of Debian codenames (e.g., "Bullseye,Focal")
# NETWORK - Target network name (e.g., "Devnet", "Mainnet")
# GENESIS_TIMESTAMP - Genesis timestamp in ISO format (e.g., "2024-04-07T11:45:00Z")
# CONFIG_JSON_GZ_URL - URL to the gzipped genesis config JSON file
# VERSION - Version string for the hardfork package
#
# EXAMPLE:
# export CODENAMES="Bullseye,Focal"
# export NETWORK="Devnet"
# export GENESIS_TIMESTAMP="2024-04-07T11:45:00Z"
# export CONFIG_JSON_GZ_URL="https://example.com/config.json.gz"
# export VERSION="3.0.0devnet-tooling-dkijania-hardfork-package-gen-in-nightly-b37f50e"
# ./run-hardfork-package-gen.sh
#
# OUTPUT:
# YAML configuration for buildkite pipeline generation
#
# DEPENDENCIES:
# - dhall-to-yaml command-line tool
# - Dhall configuration files in buildkite/src/
#


DEBIAN_VERSION_DHALL_DEF="(./buildkite/src/Constants/DebianVersions.dhall)"
NETWORK_DHALL_DEF="(./buildkite/src/Constants/Network.dhall)"
GENERATE_HARDFORK_PACKAGE_DHALL_DEF="(./buildkite/src/Entrypoints/GenerateHardforkPackage.dhall)"

function usage() {
if [[ -n "$1" ]]; then
echo -e "${RED}☞ $1${CLEAR}\n";
fi
cat << EOF
CODENAMES The Debian codenames (Bullseye, Focal etc.)
NETWORK The Docker and Debian network (Devnet, Mainnet)
GENESIS_TIMESTAMP The Genesis timestamp in ISO format (e.g. 2024-04-07T11:45:00Z)
CONFIG_JSON_GZ_URL The URL to the gzipped genesis config JSON file
VERSION The version of the hardfork package to generate (e.g. 3.0.0devnet-tooling-dkijania-hardfork-package-gen-in-nightly-b37f50e)

EOF
exit 1
}

function to_dhall_list() {
local input_str="$1"
local dhall_type="$2"
local arr=("${input_str//,/ }")
local dhall_list=""

if [[ ${#arr[@]} -eq 0 || -z "${arr[0]}" ]]; then
dhall_list="([] : List $dhall_type)"
elif [[ ${#arr[@]} -eq 1 ]]; then
dhall_list="[$dhall_type.${arr[0]}]"
else
for i in "${arr[@]}"; do
dhall_list="${dhall_list}, $dhall_type.${i}"
done
dhall_list="[${dhall_list:1}]"
fi

echo "$dhall_list"
}

DHALL_CODENAMES=$(to_dhall_list "$CODENAMES" "$DEBIAN_VERSION_DHALL_DEF.DebVersion")

echo $GENERATE_HARDFORK_PACKAGE_DHALL_DEF'.generate_hardfork_package '"$DHALL_CODENAMES"' '$NETWORK_DHALL_DEF'.Type.'"${NETWORK}"' (None Text) "'"${CONFIG_JSON_GZ_URL}"'" "'""'" ' | dhall-to-yaml --quoted
30 changes: 30 additions & 0 deletions buildkite/scripts/generate-genesis-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env bash

set -eo pipefail

([ -z ${CONFIG_JSON_GZ_URL+x} ]) && echo "required env vars were not provided" && exit 1

echo "--- Download and extract previous network config"
curl -o config.json.gz $CONFIG_JSON_GZ_URL
gunzip config.json.gz

# Patch against a bug in 1.4 which is fixed by PR #15462
mv config.json config_orig.json
jq 'del(.ledger.num_accounts) | del(.ledger.name)' config_orig.json > config.json

echo "--- Migrate accounts to new network format"
# TODO: At this stage, we need to migrate the json accounts into the new network's format.
# For now, this is hard-coded to the mainnet -> berkeley migration, but we need to select
# a migration to perform in the future.
# NB: we use sed here instead of jq, because jq is extremely slow at processing this file
sed -i -e 's/"set_verification_key": "signature"/"set_verification_key": {"auth": "signature", "txn_version": "2"}/' config.json

echo "--- Generate hardfork ledger tarballs"
mkdir hardfork_ledgers
mina-create-genesis --config-file config.json --genesis-dir hardfork_ledgers/ --hash-output-file hardfork_ledger_hashes.json | tee runtime_genesis_ledger.log | mina-logproc

echo "--- Create hardfork config"
FORK_CONFIG_JSON=config.json LEDGER_HASHES_JSON=hardfork_ledger_hashes.json scripts/hardfork/create_runtime_config.sh > new_config.json

echo "--- New genesis config"
jq 'del(.ledger.s3_data_hash, .epoch_data.staking.s3_data_hash, .epoch_data.next.s3_data_hash)' new_config.json
15 changes: 15 additions & 0 deletions buildkite/scripts/hardfork/build-packages.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

set -eo pipefail

# Sourcing profile as this is where the environment variables are set in toolchain container
# Thus, this script should be ran only in buildkite context using toolchain docker
# shellcheck disable=SC1090
source ~/.profile

export BRANCH_NAME=$BUILDKITE_BRANCH

./scripts/hardfork/build-packages.sh "$@"

echo "--- Git diff after build is complete:"
git diff --exit-code -- .
34 changes: 27 additions & 7 deletions buildkite/scripts/release/manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@ function pull(){
local __target="."
local __codenames="$DEFAULT_CODENAMES"
local __networks="$DEFAULT_NETWORKS"
local __from_special_folder

while [ ${#} -gt 0 ]; do
error_message="Error: a value is needed for '$1'";
Expand All @@ -1731,6 +1732,10 @@ function pull(){
__buildkite_build_id=${2:?$error_message}
shift 2;
;;
--from-special-folder )
__from_special_folder=${2:?$error_message}
shift 2;
;;
--target )
__target=${2:?$error_message}
shift 2;
Expand All @@ -1747,20 +1752,27 @@ function pull(){
esac
done

if [[ -z ${__buildkite_build_id+x} && -z ${__from_special_folder+x} ]]; then
echo -e "❌ ${RED} !! Buildkite build id (--buildkite-build-id) is required${CLEAR}\n";
pull_help; exit 1;
fi


echo ""
echo " ℹ️ Pulling mina artifacts with following parameters:"
echo " - Backend: $__backend"
echo " - Artifacts: $__artifacts"
echo " - Buildkite build id: $__buildkite_build_id"
echo " - Target: $__target"
echo " - Codenames: $__codenames"
echo " - Networks: $__networks"

if [[ -z ${__buildkite_build_id+x} ]]; then
echo -e "❌ ${RED} !! Buildkite build id (--buildkite-build-id) is required${CLEAR}\n";
pull_help; exit 1;
if [[ -n ${__from_special_folder+x} ]]; then
echo " - From special folder: $__from_special_folder"
fi

if [[ -n ${__buildkite_build_id+x} ]]; then
echo " - Buildkite build id: $__buildkite_build_id"
fi


IFS=', '
read -r -a __artifacts_arr <<< "$__artifacts"
read -r -a __codenames_arr <<< "$__codenames"
Expand All @@ -1771,8 +1783,16 @@ function pull(){
for network in "${__networks_arr[@]}"; do
echo " 📥 Pulling $__artifact for $__codename codename and $network network"
local __artifact_full_name
local __source_path
__artifact_full_name=$(get_artifact_with_suffix $__artifact $network)
storage_download "$__backend" "$(storage_root "$__backend")/$__buildkite_build_id/debians/$__codename/${__artifact_full_name}_*" "$__target"

if [[ -n ${__from_special_folder+x} ]]; then
__source_path="$(storage_root "$__backend")/$__from_special_folder/${__artifact_full_name}_*"
else
__source_path="$(storage_root "$__backend")/$__buildkite_build_id/debians/$__codename/${__artifact_full_name}_*"
fi

storage_download "$__backend" "$__source_path" "$__target"
done
done
done
Expand Down
9 changes: 9 additions & 0 deletions buildkite/src/Command/DockerImage.dhall
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ let ReleaseSpec =
, deb_release : Text
, deb_version : Text
, deb_legacy_version : Text
, deb_suffix : Optional Text
, deb_profile : Profiles.Type
, deb_repo : DebianRepo.Type
, build_flags : BuildFlags.Type
Expand Down Expand Up @@ -71,6 +72,7 @@ let ReleaseSpec =
, no_debian = False
, step_key_suffix = "-docker-image"
, verify = False
, deb_suffix = None Text
, if = None B/If
}
}
Expand Down Expand Up @@ -128,8 +130,14 @@ let generateStep =
"${BuildFlags.toSuffixLowercase spec.build_flags}"
}
spec.build_flags
, spec.deb_suffix
]

let debSuffix =
merge
{ None = "", Some = \(s : Text) -> " --deb-suffix " ++ s }
spec.deb_suffix

let maybeVerify =
if spec.verify
&& DockerPublish.shouldPublish
Expand Down Expand Up @@ -167,6 +175,7 @@ let generateStep =
++ " --deb-build-flags ${BuildFlags.lowerName
spec.build_flags}"
++ " --deb-legacy-version ${spec.deb_legacy_version}"
++ debSuffix
++ " --repo ${spec.repo}"

let releaseDockerCmd =
Expand Down
Loading