Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 7 additions & 0 deletions packages/dashmate/configs/defaults/getBaseConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ export default function getBaseConfigFactory() {
},
},
indexes: [],
// BIP158 cfilter index + NODE_COMPACT_FILTERS service bit.
// Default-on across every preset so dashmate-managed nodes
// are BIP157 SPV-friendly out of the box. Operators who
// can't spare the cfilter index disk overhead (~10% of
// chain size on mainnet) can flip this off via
// `dashmate config set core.compactFilters false`.
compactFilters: true,
},
platform: {
quorumList: {
Expand Down
8 changes: 8 additions & 0 deletions packages/dashmate/configs/defaults/getLocalConfigFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ export default function getLocalConfigFactory(getBaseConfig) {
zmq: {
port: 49998,
},
// Mirrors the `core.compactFilters: true` set on the base
// config; restated explicitly here because the local
// preset is the canonical surface where dev BIP157 SPV
// clients (e.g. the swift-sdk iOS example app pointed at
// `local_seed`) need cfilter sync to work, and we want
// that requirement to survive any future flip of the base
// default.
compactFilters: true,
},
dashmate: {
helper: {
Expand Down
14 changes: 14 additions & 0 deletions packages/dashmate/configs/getConfigFileMigrationsFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -1413,6 +1413,20 @@ export default function getConfigFileMigrationsFactory(homeDir, defaultConfigs)
const isLocal = options.network === NETWORK_LOCAL || name === 'local';
const isTestnet = options.network === NETWORK_TESTNET || name === 'testnet';

// Flip `core.compactFilters` to true for every config —
// pre-3.1.0 configs predate the field entirely (template
// emitted nothing, dashcore left the cfilter index off),
// so a missing-or-false value here always means
// "inherited the old implicit-off default" rather than
// "user explicitly opted out". The base config now
// ships with this flag on; this backfill brings every
// already-set-up cluster up to that line so the iOS
// BIP157 SPV flow against `local_seed` (and any other
// dashmate node) works without manual editing.
if (options.core) {
options.core.compactFilters = true;
}

if (options.platform?.drive?.tenderdash?.docker
&& defaultConfig.has('platform.drive.tenderdash.docker.image')) {
options.platform.drive.tenderdash.docker.image = defaultConfig
Expand Down
8 changes: 8 additions & 0 deletions packages/dashmate/src/config/configJsonSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,14 @@ export default {
description: 'List of core indexes to enable. `platform.enable`, '
+ ' `core.masternode.enable`, and `core.insight.enabled` add indexes dynamically',
},
compactFilters: {
type: 'boolean',
description: 'Build the BIP158 cfilter index and advertise '
+ 'NODE_COMPACT_FILTERS to peers, so BIP157 SPV clients can sync '
+ 'filter headers + filters from this node. Defaults to true on '
+ 'every preset; flip to false to skip the cfilter index '
+ '(~10% chain-size disk overhead on mainnet).',
},
},
required: ['docker', 'p2p', 'rpc', 'zmq', 'spork', 'masternode', 'miner', 'devnet', 'log',
'indexes', 'insight'],
Expand Down
11 changes: 11 additions & 0 deletions packages/dashmate/templates/core/dash.conf.dot
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@ spentindex=1
{{~}}
{{?}}

# BIP157/158 compact block filters. Building the cfilter index plus
# advertising NODE_COMPACT_FILTERS lets BIP157 SPV clients sync
# headers + filters from this node. Off by default (mainnet/testnet
# usage doesn't justify the disk + CPU overhead); enabled on the
# `local` preset where the chain is tiny and the iOS dev flow needs
# filter sync against dashmate's `local_seed` to test the wallet.
{{? it.core.compactFilters }}
blockfilterindex=basic
peerblockfilters=1
{{?}}

# ZeroMQ notifications
zmqpubrawtx=tcp://0.0.0.0:{{=it.core.zmq.port}}
zmqpubrawtxlock=tcp://0.0.0.0:{{=it.core.zmq.port}}
Expand Down
Loading