Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Bloom Filters #68

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 7 additions & 2 deletions assets/compat/bitcoin.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,15 @@ zmqpubrawtx=tcp://0.0.0.0:28333
txindex=1
}}

## BIP37
{{#IF advanced.filters.peerbloomfilters
peerbloomfilters=1
}}

## BIP157
{{#IF advanced.blockfilters.blockfilterindex
{{#IF advanced.filters.blockfilterindex
blockfilterindex=basic
}}
{{#IF advanced.blockfilters.peerblockfilters
{{#IF advanced.filters.peerblockfilters
peerblockfilters=1
}}
15 changes: 12 additions & 3 deletions assets/compat/config_spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,21 @@ advanced:
integral: true
units: MiB
default: disabled
blockfilters:
filters:
type: object
nullable: false
name: "Block Filters"
description: "Settings for storing and serving compact block filters"
name: "Filters"
description: "Settings for storing and serving compact block filters or bloom filters"
spec:
peerbloomfilters:
type: boolean
name: "Serve Bloom Filters to Peers (BIP37)"
description: >-
Peers have the option of setting filters on each connection they make after the version handshake has completed.
Bloom filters are for clients implementing SPV (Simplified Pament Verification) that want to check that block headers
connect together correctly, without needing to verify the full blockchain. The client must trust that the transactions
in the chain are in fact valid.
default: false
blockfilterindex:
type: boolean
name: "Compute Compact Block Filters (BIP158)"
Expand Down
4 changes: 2 additions & 2 deletions migrations/lt_22_0_0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ set -ea
if [ $1 = "from" ]; then
yq -i '.advanced.peers.addnode |= map(select(.hostname != ~ or . == "*"))' /root/.bitcoin/start9/config.yaml
yq -i '.advanced.peers.addnode.[] |= {"hostname":., "port":~}' /root/.bitcoin/start9/config.yaml
yq -i '(.advanced.blockfilters.blockfilterindex, .advanced.blockfilters.peerblockfilters) = false' /root/.bitcoin/start9/config.yaml
yq -i '(.advanced.filters.blockfilterindex, .advanced.filters.peerblockfilters) = false' /root/.bitcoin/start9/config.yaml
echo '{"configured": true }'
exit 0
elif [ $1 = "to" ]; then
yq -i '.advanced.peers.addnode |= map_values(.hostname)' /root/.bitcoin/start9/config.yaml
yq -i 'del(.advanced.blockfilters)' /root/.bitcoin/start9/config.yaml
yq -i 'del(.advanced.filters)' /root/.bitcoin/start9/config.yaml
echo '{"configured": true }'
exit 0
else
Expand Down