upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormtg0001 <106211915+mtg0001@users.noreply.github.com>2026-08-04 15:25:34 -0300
committerGitHub <noreply@github.com>2026-08-04 15:25:34 -0300
commit5ac1fd55eea9d4b5e9b34be50d3b684693e3a935 (patch)
tree8fc77afc1d3a7f237763b4e249fe95d21ae86184
parent7aaaa7a684e33591125963df1eb4da6da2fa6495 (diff)
build: pin external source dependencies (#139)
Co-authored-by: Gilcimar Duarte <ti@gpm.infra>
-rw-r--r--Makefile43
-rw-r--r--docs/dependencies.md18
2 files changed, 54 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index ea720f1..0788b61 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,11 @@ NPROC := $(shell nproc 2>/dev/null || echo 2)
12SUDO := $(shell [ "$$(id -u)" = "0" ] && echo "" || echo "sudo") 12SUDO := $(shell [ "$$(id -u)" = "0" ] && echo "" || echo "sudo")
13VERSION := 1.2.15 13VERSION := 1.2.15
14 14
15SECP256K1_REPO := https://github.com/bitcoin-core/secp256k1
16SECP256K1_COMMIT := 7fecac74aed8e1fd9078380d67dd04663705c989
17RANDOMX_REPO := https://github.com/tevador/RandomX
18RANDOMX_COMMIT := 1e9d4b2df63fa6edf46b06789486e23c0fcaa55a
19
15# ---- Linux ---------------------------------------------------------------- 20# ---- Linux ----------------------------------------------------------------
16 21
17linux: deps-linux 22linux: deps-linux
@@ -47,7 +52,13 @@ deps-secp256k1:
47 @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \ 52 @if [ ! -f /usr/local/lib/libsecp256k1.a ]; then \
48 echo "==> building libsecp256k1"; \ 53 echo "==> building libsecp256k1"; \
49 rm -rf $(ROOT)/secp256k1-build; \ 54 rm -rf $(ROOT)/secp256k1-build; \
50 git clone --depth 1 https://github.com/bitcoin-core/secp256k1 $(ROOT)/secp256k1-build; \ 55 git init -q $(ROOT)/secp256k1-build; \
56 cd $(ROOT)/secp256k1-build && \
57 git remote add origin $(SECP256K1_REPO) && \
58 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \
59 git checkout -q --detach FETCH_HEAD && \
60 test "$$(git rev-parse HEAD)" = "$(SECP256K1_COMMIT)" && \
61 echo "==> libsecp256k1 pinned at $(SECP256K1_COMMIT)" && \
51 cd $(ROOT)/secp256k1-build && ./autogen.sh && \ 62 cd $(ROOT)/secp256k1-build && ./autogen.sh && \
52 ./configure --enable-module-schnorrsig --enable-module-extrakeys \ 63 ./configure --enable-module-schnorrsig --enable-module-extrakeys \
53 --disable-shared --with-pic --disable-benchmark --disable-tests && \ 64 --disable-shared --with-pic --disable-benchmark --disable-tests && \
@@ -61,7 +72,13 @@ deps-randomx:
61 @if [ ! -f $(HOME)/RandomX/build/librandomx.a ]; then \ 72 @if [ ! -f $(HOME)/RandomX/build/librandomx.a ]; then \
62 echo "==> building RandomX"; \ 73 echo "==> building RandomX"; \
63 rm -rf $(HOME)/RandomX; \ 74 rm -rf $(HOME)/RandomX; \
64 git clone --depth 1 https://github.com/tevador/RandomX $(HOME)/RandomX; \ 75 git init -q $(HOME)/RandomX; \
76 cd $(HOME)/RandomX && \
77 git remote add origin $(RANDOMX_REPO) && \
78 git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \
79 git checkout -q --detach FETCH_HEAD && \
80 test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \
81 echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \
65 mkdir -p $(HOME)/RandomX/build; \ 82 mkdir -p $(HOME)/RandomX/build; \
66 cd $(HOME)/RandomX/build && cmake .. -DCMAKE_BUILD_TYPE=Release && \ 83 cd $(HOME)/RandomX/build && cmake .. -DCMAKE_BUILD_TYPE=Release && \
67 make -j$(NPROC) randomx; \ 84 make -j$(NPROC) randomx; \
@@ -120,8 +137,14 @@ deps-windows:
120 autoconf automake libtool 137 autoconf automake libtool
121 @if [ ! -f deps/lib/libsecp256k1.a ]; then \ 138 @if [ ! -f deps/lib/libsecp256k1.a ]; then \
122 rm -rf secp256k1-build; \ 139 rm -rf secp256k1-build; \
123 git clone --depth 1 https://github.com/bitcoin-core/secp256k1 secp256k1-build; \ 140 git init -q secp256k1-build; \
124 cd secp256k1-build && ./autogen.sh && \ 141 cd secp256k1-build && \
142 git remote add origin $(SECP256K1_REPO) && \
143 git fetch -q --depth 1 origin $(SECP256K1_COMMIT) && \
144 git checkout -q --detach FETCH_HEAD && \
145 test "$$(git rev-parse HEAD)" = "$(SECP256K1_COMMIT)" && \
146 echo "==> secp256k1 pinned at $(SECP256K1_COMMIT)" && \
147 cd $(ROOT)/secp256k1-build && ./autogen.sh && \
125 ./configure --prefix=$(ROOT)/deps \ 148 ./configure --prefix=$(ROOT)/deps \
126 --enable-module-schnorrsig --enable-module-extrakeys \ 149 --enable-module-schnorrsig --enable-module-extrakeys \
127 --disable-shared --with-pic --disable-benchmark --disable-tests && \ 150 --disable-shared --with-pic --disable-benchmark --disable-tests && \
@@ -132,9 +155,15 @@ deps-windows:
132 fi 155 fi
133 @if [ ! -f RandomX/build/librandomx.a ]; then \ 156 @if [ ! -f RandomX/build/librandomx.a ]; then \
134 rm -rf RandomX; \ 157 rm -rf RandomX; \
135 git clone --depth 1 https://github.com/tevador/RandomX; \ 158 git init -q RandomX; \
136 mkdir -p RandomX/build; \ 159 cd RandomX && \
137 cd RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \ 160 git remote add origin $(RANDOMX_REPO) && \
161 git fetch -q --depth 1 origin $(RANDOMX_COMMIT) && \
162 git checkout -q --detach FETCH_HEAD && \
163 test "$$(git rev-parse HEAD)" = "$(RANDOMX_COMMIT)" && \
164 echo "==> RandomX pinned at $(RANDOMX_COMMIT)" && \
165 mkdir -p $(ROOT)/RandomX/build; \
166 cd $(ROOT)/RandomX/build && cmake .. -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release && \
138 make randomx; \ 167 make randomx; \
139 echo "==> RandomX done"; \ 168 echo "==> RandomX done"; \
140 else \ 169 else \
diff --git a/docs/dependencies.md b/docs/dependencies.md
new file mode 100644
index 0000000..9fd45b6
--- /dev/null
+++ b/docs/dependencies.md
@@ -0,0 +1,18 @@
1# Build Dependencies
2
3Bitflash links consensus-adjacent cryptographic and proof-of-work code from
4external repositories. Fresh builds must not follow upstream `master` silently:
5a changed upstream branch can break reproducible builds or change behavior in
6code that every node relies on.
7
8The top-level `Makefile` pins source dependencies by full commit hash:
9
10| dependency | repository | pinned commit |
11|---|---|---|
12| libsecp256k1 | https://github.com/bitcoin-core/secp256k1 | `7fecac74aed8e1fd9078380d67dd04663705c989` |
13| RandomX | https://github.com/tevador/RandomX | `1e9d4b2df63fa6edf46b06789486e23c0fcaa55a` |
14
15When updating either dependency, rebuild from a clean dependency directory and
16run the full selftest suite before opening the PR. The PR should explain why the
17dependency changed and whether the update can affect consensus, addresses,
18signatures, proof-of-work validation, or mining.