Skip to content

Commit 5696eee

Browse files
kn0wmadchrisguida
andauthored
Update to v24 upstream, minor build edits, add Full RBF config option (Start9Labs#107)
* Update to v24 upstream, minor build edits, add Full RBF config option * Update migrations/gt_22_0_0_lt_23_0_0.sh Co-authored-by: Chris Guida <[email protected]> * Update scripts/services/getConfig.ts Co-authored-by: Chris Guida <[email protected]> * Cleanup * cleanup * strip all binaries Co-authored-by: Chris Guida <[email protected]> Co-authored-by: Chris Guida <[email protected]>
1 parent 31649d4 commit 5696eee

File tree

9 files changed

+67
-34
lines changed

9 files changed

+67
-34
lines changed

Dockerfile

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ FROM alpine:3.12 as bitcoin-core
88

99
COPY --from=berkeleydb /opt /opt
1010

11-
COPY ./SHA256SUMS.asc.patch SHA256SUMS.asc.patch
12-
1311
RUN sed -i 's/http\:\/\/dl-cdn.alpinelinux.org/https\:\/\/alpine.global.ssl.fastly.net/g' /etc/apk/repositories
1412
RUN apk --no-cache add autoconf
1513
RUN apk --no-cache add automake
@@ -22,7 +20,6 @@ RUN apk --no-cache add libevent-dev
2220
RUN apk --no-cache add libressl
2321
RUN apk --no-cache add libtool
2422
RUN apk --no-cache add linux-headers
25-
# RUN apk --no-cache add sqlite-libs
2623
RUN apk --no-cache add sqlite-dev
2724
RUN apk --no-cache add zeromq-dev
2825
RUN set -ex \
@@ -84,9 +81,9 @@ AEC1884398647C47413C1C3FB1179EB7347DC10D \
8481
71A3B16735405025D447E8F274810B012346C9A6 \
8582
287AE4CA1187C68C08B49CB2D11BD4F33F1DB499 \
8683
F9A8737BF4FF5C89C903DF31DD78544CF91B1514 \
87-
# C388F6961FB972A95678E327F62711DBDCA8AE56 \
8884
4DAF18FE948E7A965B30F9457E296D555E7F63A7 \
8985
28E72909F1717FE9607754F8A7BEB2621678D37D \
86+
F19F5FF2B0589EC341220045BA03F4DBE0C63FB4 \
9087
; do \
9188
gpg --batch --keyserver hkps://keyserver.ubuntu.com --recv-keys "$key" || \
9289
gpg --batch --keyserver hkps://pgp.mit.edu --recv-keys "$key" || \
@@ -103,16 +100,13 @@ ENV BITCOIN_PREFIX=/opt/bitcoin-${BITCOIN_VERSION}
103100
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS
104101
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/SHA256SUMS.asc
105102
RUN wget https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}.tar.gz
106-
RUN patch -u SHA256SUMS.asc -i SHA256SUMS.asc.patch
107103
RUN gpg --verify SHA256SUMS.asc
108104
RUN grep " bitcoin-${BITCOIN_VERSION}.tar.gz\$" SHA256SUMS | sha256sum -c -
109105
RUN tar -xzf *.tar.gz
110106

111107
WORKDIR /bitcoin-${BITCOIN_VERSION}
112108

113-
RUN sed -i '/AC_PREREQ/a\AR_FLAGS=cr' src/univalue/configure.ac
114109
RUN sed -i '/AX_PROG_CC_FOR_BUILD/a\AR_FLAGS=cr' src/secp256k1/configure.ac
115-
RUN sed -i s:sys/fcntl.h:fcntl.h: src/compat.h
116110
RUN ./autogen.sh
117111
RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/include/ \
118112
# If building on Mac make sure to increase Docker VM memory, or uncomment this line. See https://github.com/bitcoin/bitcoin/issues/6658 for more info.
@@ -128,9 +122,7 @@ RUN ./configure LDFLAGS=-L`ls -d /opt/db*`/lib/ CPPFLAGS=-I`ls -d /opt/db*`/incl
128122
--with-daemon
129123
RUN make -j$(($(nproc) - 1))
130124
RUN make install
131-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-cli
132-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoin-tx
133-
RUN strip ${BITCOIN_PREFIX}/bin/bitcoind
125+
RUN strip ${BITCOIN_PREFIX}/bin/*
134126
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.a
135127
RUN strip ${BITCOIN_PREFIX}/lib/libbitcoinconsensus.so.0.0.0
136128

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PKG_VERSION := $(shell yq e ".version" manifest.yaml)
22
PKG_ID := $(shell yq e ".id" manifest.yaml)
33
MANAGER_SRC := $(shell find ./manager -name '*.rs') manager/Cargo.toml manager/Cargo.lock
4-
VERSION_CORE := "23.0"
4+
VERSION_CORE := "24.0"
55

66
.DELETE_ON_ERROR:
77

SHA256SUMS.asc.patch

Lines changed: 0 additions & 16 deletions
This file was deleted.

assets/compat/bitcoin.conf.template

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ rpcthreads={{rpc.advanced.threads}}
2323
rpcworkqueue={{rpc.advanced.workqueue}}
2424

2525
## MEMPOOL
26+
{{#IF advanced.mempool.mempoolfullrbf
27+
mempoolfullrbf=1
28+
}}
29+
{{#IF !advanced.mempool.mempoolfullrbf
30+
mempoolfullrbf=0
31+
}}
2632
{{#IF advanced.mempool.persistmempool
2733
persistmempool=1
2834
}}

manifest.yaml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
id: bitcoind
22
title: "Bitcoin Core"
3-
version: 23.0.1
3+
version: 24.0.0
44
release-notes: |
55
* Add build for x86
6+
* Update to latest upstream
7+
* Add Full RBF Config option
68
license: mit
79
wrapper-repo: https://github.com/Start9Labs/bitcoind-wrapper
810
upstream-repo: https://github.com/bitcoin/bitcoin
@@ -182,7 +184,17 @@ migrations:
182184
mounts:
183185
main: /root/.bitcoin
184186
inject: false
185-
"=23.0.0":
187+
"=23.0.0 <24.0.0":
188+
type: docker
189+
image: main
190+
system: false
191+
entrypoint: /usr/local/bin/migrations/eq_23_0_0_lt_24_0_0.sh
192+
args: ["from"]
193+
io-format: json
194+
mounts:
195+
main: /root/.bitcoin
196+
inject: false
197+
"=24.0.0":
186198
type: docker
187199
image: main
188200
system: false
@@ -211,7 +223,17 @@ migrations:
211223
mounts:
212224
main: /root/.bitcoin
213225
inject: false
214-
"=23.0.0":
226+
"=23.0.0 <24.0.0":
227+
type: docker
228+
image: main
229+
system: false
230+
entrypoint: /usr/local/bin/migrations/eq_23_0_0_lt_24_0_0.sh
231+
args: ["to"]
232+
io-format: json
233+
mounts:
234+
main: /root/.bitcoin
235+
inject: false
236+
"=24.0.0":
215237
type: docker
216238
image: main
217239
system: false

migrations/eq_23_0_0_lt_24_0_0.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
set -ea
4+
5+
if [ $1 = "from" ]; then
6+
yq -i '.advanced.peers.addnode |= map(select(.hostname != ~ or . == "*"))' /root/.bitcoin/start9/config.yaml
7+
yq -i '.advanced.peers.addnode.[] |= {"hostname":., "port":~}' /root/.bitcoin/start9/config.yaml
8+
yq -i '(.advanced.mempool.mempoolfullrbf) = false' /root/.bitcoin/start9/config.yaml
9+
echo '{"configured": false }'
10+
exit 0
11+
elif [ $1 = "to" ]; then
12+
yq -i '.advanced.peers.addnode |= map_values(.hostname)' /root/.bitcoin/start9/config.yaml
13+
yq -i 'del(.advanced.bloomfilters)' /root/.bitcoin/start9/config.yaml
14+
yq -i 'del(.advanced.mempool.mempoolfullrbf)' /root/.bitcoin/start9/config.yaml
15+
echo '{"configured": false }'
16+
exit 0
17+
else
18+
echo "FATAL: Invalid argument: {from, to}. Migration failed." >&2
19+
exit 1
20+
fi

migrations/gt_22_0_0_lt_23_0_0.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@ set -ea
55
if [ $1 = "from" ]; then
66
yq -i '.advanced.peers.addnode |= map(select(.hostname != ~ or . == "*"))' /root/.bitcoin/start9/config.yaml
77
yq -i '.advanced.peers.addnode.[] |= {"hostname":., "port":~}' /root/.bitcoin/start9/config.yaml
8+
yq -i '(.advanced.mempool.mempoolfullrbf) = false' /root/.bitcoin/start9/config.yaml
89
echo '{"configured": false }'
910
exit 0
1011
elif [ $1 = "to" ]; then
1112
yq -i '.advanced.peers.addnode |= map_values(.hostname)' /root/.bitcoin/start9/config.yaml
1213
yq -i 'del(.advanced.bloomfilters)' /root/.bitcoin/start9/config.yaml
14+
yq -i 'del(.advanced.mempool.mempoolfullrbf)' /root/.bitcoin/start9/config.yaml
1315
echo '{"configured": false }'
1416
exit 0
1517
else
1618
echo "FATAL: Invalid argument: {from, to}. Migration failed." >&2
1719
exit 1
1820
fi
19-
``
21+

migrations/lt_22_0_0.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,17 @@ set -ea
55
if [ $1 = "from" ]; then
66
yq -i '.advanced.peers.addnode |= map(select(.hostname != ~ or . == "*"))' /root/.bitcoin/start9/config.yaml
77
yq -i '.advanced.peers.addnode.[] |= {"hostname":., "port":~}' /root/.bitcoin/start9/config.yaml
8-
yq -i '(.advanced.blockfilters.blockfilterindex, .advanced.blockfilters.peerblockfilters, .advanced.bloomfilters.peerbloomfilters) = false' /root/.bitcoin/start9/config.yaml
8+
yq -i '(.advanced.blockfilters.blockfilterindex, .advanced.blockfilters.peerblockfilters, .advanced.bloomfilters.peerbloomfilters, .advanced.mempool.mempoolfullrbf) = false' /root/.bitcoin/start9/config.yaml
99
echo '{"configured": true }'
1010
exit 0
1111
elif [ $1 = "to" ]; then
1212
yq -i '.advanced.peers.addnode |= map_values(.hostname)' /root/.bitcoin/start9/config.yaml
1313
yq -i 'del(.advanced.blockfilters)' /root/.bitcoin/start9/config.yaml
1414
yq -i 'del(.advanced.bloomfilters)' /root/.bitcoin/start9/config.yaml
15+
yq -i 'del(.advanced.mempool.mempoolfullrbf)' /root/.bitcoin/start9/config.yaml
1516
echo '{"configured": false }'
1617
exit 0
1718
else
1819
echo "FATAL: Invalid argument: {from, to}. Migration failed." >&2
1920
exit 1
2021
fi
21-
``

scripts/services/getConfig.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
116116
"Set the depth of the work queue to service RPC calls. Determines how long the backlog of RPC requests can get before it just rejects new ones.",
117117
"type": "number",
118118
"nullable": false,
119-
"default": 64,
119+
"default": 128,
120120
"range": "[8,256]",
121121
"integral": true,
122122
"units": "requests",
@@ -178,6 +178,13 @@ export const getConfig: T.ExpectedExports.getConfig = compat.getConfig({
178178
"name": "Mempool",
179179
"description": "Mempool Settings",
180180
"spec": {
181+
"mempoolfullrbf": {
182+
"name": "Enable Full RBF",
183+
"description":
184+
"Policy for your node to use for relaying and mining unconfirmed transactions. For details, see https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-24.0.md#notice-of-new-option-for-transaction-replacement-policies",
185+
"type": "boolean",
186+
"default": false,
187+
},
181188
"persistmempool": {
182189
"type": "boolean",
183190
"name": "Persist Mempool",

0 commit comments

Comments
 (0)