Skip to content

Commit 98b7db8

Browse files
committed
[avalanche] Enable avalanche by default
Summary: This can still be opted out if desired. Some tests are relying on reorgs to happen which is not compatible with avalanche, so proceed to manual unparking when possible or turn on automatic unparking. Test Plan: ninja check-extended Reviewers: #bitcoin_abc, PiRK Reviewed By: #bitcoin_abc, PiRK Differential Revision: https://reviews.bitcoinabc.org/D12610
1 parent 22ad339 commit 98b7db8

File tree

8 files changed

+36
-12
lines changed

8 files changed

+36
-12
lines changed

doc/release-notes.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ This release includes the following features and fixes:
1414
- The `savemempool` RPC now returns the path to the saved mempool in the `filename` field.
1515
- Bitcoin ABC now supports User-space, Statically Defined Tracing (USDT).
1616
For now only a few tracepoints are available, see [tracing.md](/doc/tracing.md) for more info.
17+
- Avalanche is now enabled by default. It is still possible to disable it by
18+
using `-avalanche=0` on the command line, or setting `avalanche=0` in the
19+
`bitcoin.conf` file.

src/avalanche/avalanche.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class ArgsManager;
1919
/**
2020
* Is avalanche enabled by default.
2121
*/
22-
static constexpr bool AVALANCHE_DEFAULT_ENABLED = false;
22+
static constexpr bool AVALANCHE_DEFAULT_ENABLED = true;
2323

2424
/**
2525
* Conflicting proofs cooldown time default value in seconds.

test/functional/abc-invalid-chains.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ def set_test_params(self):
1818
self.tip = None
1919
self.blocks = {}
2020
self.block_heights = {}
21-
self.extra_args = [["-whitelist=noban@127.0.0.1"]]
21+
self.extra_args = [[
22+
"-whitelist=noban@127.0.0.1",
23+
"-automaticunparking=1",
24+
]]
2225

2326
def next_block(self, number):
2427
if self.tip is None:

test/functional/abc-mempool-coherence-on-activations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,12 @@ def set_test_params(self):
129129
self.block_heights = {}
130130
self.tip = None
131131
self.blocks = {}
132-
self.extra_args = [['-whitelist=noban@127.0.0.1',
133-
EXTRA_ARG,
134-
'-acceptnonstdtxn=1']]
132+
self.extra_args = [[
133+
'-whitelist=noban@127.0.0.1',
134+
EXTRA_ARG,
135+
'-acceptnonstdtxn=1',
136+
'-automaticunparking=1',
137+
]]
135138

136139
def next_block(self, number):
137140
if self.tip is None:

test/functional/abc-parkedchain.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Copyright (c) 2018 The Bitcoin developers
33
# Distributed under the MIT software license, see the accompanying
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5-
"""Test the parckblock and unparkblock RPC calls."""
5+
"""Test the parkblock and unparkblock RPC calls."""
66

77
from test_framework.test_framework import BitcoinTestFramework
88
from test_framework.util import assert_equal
@@ -11,8 +11,17 @@
1111
class ParkedChainTest(BitcoinTestFramework):
1212
def set_test_params(self):
1313
self.num_nodes = 2
14-
self.extra_args = [["-noparkdeepreorg",
15-
"-noautomaticunparking", "-whitelist=noban@127.0.0.1"], ["-maxreorgdepth=-1"]]
14+
self.extra_args = [
15+
[
16+
"-noparkdeepreorg",
17+
"-noautomaticunparking",
18+
"-whitelist=noban@127.0.0.1",
19+
],
20+
[
21+
"-automaticunparking=1",
22+
"-maxreorgdepth=-1"
23+
]
24+
]
1625

1726
def skip_test_if_missing_module(self):
1827
self.skip_if_no_wallet()
@@ -216,7 +225,7 @@ def check_reorg_protection(depth, extra_blocks):
216225
)
217226
wait_for_parked_block(node.getbestblockhash())
218227
# Restart the parking node without parkdeepreorg.
219-
self.restart_node(1, ["-parkdeepreorg=0"])
228+
self.restart_node(1, self.extra_args[1] + ["-parkdeepreorg=0"])
220229
parking_node = self.nodes[1]
221230
self.connect_nodes(node.index, parking_node.index)
222231
# The other chain should still be marked 'parked'.

test/functional/feature_bip68_sequence.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ def set_test_params(self):
4848
],
4949
[
5050
"-acceptnonstdtxn=0",
51-
"-maxreorgdepth=-1"
51+
"-maxreorgdepth=-1",
52+
"-automaticunparking=1",
5253
]
5354
]
5455

test/functional/feature_coinstatsindex.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,12 @@ def set_test_params(self):
3131
self.num_nodes = 2
3232
self.supports_cli = False
3333
self.extra_args = [
34-
[],
35-
["-coinstatsindex"]
34+
[
35+
"-automaticunparking=1",
36+
],
37+
[
38+
"-coinstatsindex",
39+
]
3640
]
3741

3842
def skip_test_if_missing_module(self):

test/functional/p2p_fingerprint.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ def run_test(self):
8383
node0.send_and_ping(msg_block(block))
8484

8585
# Check that reorg succeeded
86+
self.nodes[0].unparkblock(new_blocks[-1].hash)
8687
assert_equal(self.nodes[0].getblockcount(), 13)
8788

8889
stale_hash = int(block_hashes[-1], 16)

0 commit comments

Comments
 (0)