Skip to content
Open
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
5 changes: 3 additions & 2 deletions ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ if [ -z "${SKIP_PYTHON_INSTALL}" ]; then
python3 --version
fi

# NOTE: BUMP ALSO contrib/containers/ci//ci-slim.Dockerfile
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: typo //

${CI_RETRY_EXE} pip3 install codespell==2.2.1
${CI_RETRY_EXE} pip3 install flake8==4.0.1
${CI_RETRY_EXE} pip3 install lief==0.13.1
${CI_RETRY_EXE} pip3 install flake8==5.0.4
${CI_RETRY_EXE} pip3 install lief==0.13.2
Comment on lines +38 to +39
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# First, let's check the current state of the file
head -50 ci/lint/04_install.sh | tail -15

Repository: dashpay/dash

Length of output: 673


🌐 Web query:

flake8 5.0.4 security vulnerabilities CVE

💡 Result:

I found no public CVE entries for flake8 5.0.4. Flake8's own release notes for 5.0.4 list only a bugfix (importlib‑metadata bound) and no security advisory, and major vulnerability trackers (Snyk, Safety DB) show no direct CVE for that version. [1][2][3]

If you want, I can run a targeted CVE/NVD search (or check GitHub/security advisories) and return exact CVE database results.


🌐 Web query:

lief 0.13.2 security vulnerabilities CVE

💡 Result:

Yes — LIEF 0.13.2 is affected by CVE-2024-31636 (information disclosure via an uninitialized variable in machd_reader.c; affects versions < 0.15.0). Upgrade to >= 0.15.0 to obtain the fix. [1][2]

Sources:
[1] NVD entry for CVE-2024-31636.
[2] SafetyDB package page for lief (shows affected versions <0.15.0).


Upgrade lief to ≥0.15.0 to fix CVE-2024-31636.

lief 0.13.2 is vulnerable to CVE-2024-31636 (information disclosure via uninitialized variable in machd_reader.c). This affects all versions < 0.15.0. flake8 5.0.4 is secure with no known vulnerabilities.

🤖 Prompt for AI Agents
In @ci/lint/04_install.sh around lines 38-39, Replace the vulnerable pinned
lief==0.13.2 install with a safe version >=0.15.0: update the line that uses
${CI_RETRY_EXE} pip3 install lief==0.13.2 to use ${CI_RETRY_EXE} pip3 install
"lief>=0.15.0" (or pin to a specific secure release >=0.15.0) so the CI
installation command referenced by CI_RETRY_EXE installs a non-vulnerable lief.

${CI_RETRY_EXE} pip3 install mypy==0.981
${CI_RETRY_EXE} pip3 install pyzmq==24.0.1
${CI_RETRY_EXE} pip3 install vulture==2.6
Expand Down
5 changes: 3 additions & 2 deletions contrib/containers/ci/ci-slim.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ RUN set -ex; \
ENV UV_SYSTEM_PYTHON=1

# Install Python packages
# NOTE: if versions are changed, update ci/lint/04_install.sh
RUN uv pip install --system --break-system-packages \
codespell==2.1.0 \
flake8==4.0.1 \
codespell==2.2.1 \
flake8==5.0.4 \
jinja2 \
lief==0.13.2 \
multiprocess \
Expand Down
2 changes: 1 addition & 1 deletion contrib/linearize/linearize-hashes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def get_block_hashes(settings, max_blocks_per_call=10000):
if rpc.response_is_error(resp_obj):
print('JSON-RPC: error at height', height+x, ': ', resp_obj['error'], file=sys.stderr)
sys.exit(1)
assert(resp_obj['id'] == x) # assume replies are in-sequence
assert resp_obj['id'] == x # assume replies are in-sequence
if settings['rev_hash_bytes'] == 'true':
resp_obj['result'] = bytes.fromhex(resp_obj['result'])[::-1].hex()
print(resp_obj['result'])
Expand Down
4 changes: 2 additions & 2 deletions contrib/seeds/generate-seeds.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ def name_to_bip155(addr):
if i == 0 or i == (len(addr)-1): # skip empty component at beginning or end
continue
x += 1 # :: skips to suffix
assert(x < 2)
assert x < 2
else: # two bytes per component
val = int(comp, 16)
sub[x].append(val >> 8)
sub[x].append(val & 0xff)
nullbytes = 16 - len(sub[0]) - len(sub[1])
assert((x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0))
assert (x == 0 and nullbytes == 0) or (x == 1 and nullbytes > 0)
addr_bytes = bytes(sub[0] + ([0] * nullbytes) + sub[1])
if addr_bytes[0] == 0xfc:
# Assume that seeds with fc00::/8 addresses belong to CJDNS,
Expand Down
3 changes: 3 additions & 0 deletions test/functional/example_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ class ExampleTest(BitcoinTestFramework):
# Override the set_test_params(), skip_test_if_missing_module(), add_options(), setup_chain(), setup_network()
# and setup_nodes() methods to customize the test setup as required.

def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
"""Override test parameters for your individual test.

Expand Down
2 changes: 2 additions & 0 deletions test/functional/feature_addressindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
from test_framework.util import assert_equal

class AddressIndexTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = True
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_asset_locks.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
HEIGHT_DIFF_EXPIRING = 48

class AssetLocksTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(2, 0, [[
"-whitelist=127.0.0.1",
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_bip68_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
NOT_FINAL_ERROR = "non-BIP68-final"

class BIP68Test(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.num_nodes = 2
self.extra_args = [
Expand Down
6 changes: 3 additions & 3 deletions test/functional/feature_coinstatsindex.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def _test_coin_stats_index(self):

self.generate(index_node, 1, sync_fun=self.no_op)
res10 = index_node.gettxoutsetinfo('muhash')
assert(res8['txouts'] < res10['txouts'])
assert res8['txouts'] < res10['txouts']

self.log.info("Test that the index works with -reindex")

Expand Down Expand Up @@ -286,12 +286,12 @@ def _test_reorg_index(self):
res2 = index_node.gettxoutsetinfo(hash_type='muhash', hash_or_height=112)
assert_equal(res["bestblock"], block)
assert_equal(res["muhash"], res2["muhash"])
assert(res["muhash"] != res_invalid["muhash"])
assert res["muhash"] != res_invalid["muhash"]

# Test that requesting reorged out block by hash is still returning correct results
res_invalid2 = index_node.gettxoutsetinfo(hash_type='muhash', hash_or_height=reorg_block)
assert_equal(res_invalid2["muhash"], res_invalid["muhash"])
assert(res["muhash"] != res_invalid2["muhash"])
assert res["muhash"] != res_invalid2["muhash"]

# Add another block, so we don't depend on reconsiderblock remembering which
# blocks were touched by invalidateblock
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_config_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@


class ConfArgsTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 1
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_dip3_deterministicmns.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
from test_framework.util import assert_equal, force_finish_mnsync, p2p_port, softfork_active

class DIP3Test(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.num_initial_mn = 11 # Should be >= 11 to make sure quorums are not always the same MNs
self.num_nodes = 1 + self.num_initial_mn + 2 # +1 for controller, +1 for mn-qt, +1 for mn created after dip3 activation
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_dip3_v19.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def getmnlistdiff(self, base_block_hash, block_hash):


class DIP3V19Test(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.extra_args = [[
'-deprecatedrpc=legacy_mn',
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_dip4_coinbasemerkleroots.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def getmnlistdiff(self, baseBlockHash, blockHash):


class LLMQCoinbaseCommitmentsTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.extra_args = [[ f'-testactivationheight=dip0008@{DIP0008_HEIGHT}', f'-testactivationheight=dip0024@{DIP0024_HEIGHT}', "-vbparams=testdummy:999999999999:999999999999" ]] * 4
self.set_dash_test_params(4, 3, extra_args = self.extra_args)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@


class FilelockTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_governance.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
GOVERNANCE_UPDATE_MIN = 60 * 60 # src/governance/object.h

class DashGovernanceTest (DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(6, 5, [[
"-budgetparams=10:10:10",
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_governance_cl.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
from test_framework.util import assert_equal, satoshi_round

class DashGovernanceTest (DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(6, 5, [["-budgetparams=10:10:10"]] * 6)

Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_governance_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ def validate_object(prepared, rpc_prepared):
assert_equal(prepared["data"], rpc_prepared["data"])

class DashGovernanceTest (DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(2, 1)

Expand Down
6 changes: 3 additions & 3 deletions test/functional/feature_index_prune.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def run_test(self):
for node in filter_nodes:
assert_greater_than(len(node.getblockfilter(tip)['filter']), 0)
for node in stats_nodes:
assert(node.gettxoutsetinfo(hash_type="muhash", hash_or_height=tip)['muhash'])
assert node.gettxoutsetinfo(hash_type="muhash", hash_or_height=tip)['muhash']

self.mine_batches(500)
self.sync_index(height=700)
Expand All @@ -85,14 +85,14 @@ def run_test(self):
for node in filter_nodes:
assert_greater_than(len(node.getblockfilter(tip)['filter']), 0)
for node in stats_nodes:
assert(node.gettxoutsetinfo(hash_type="muhash", hash_or_height=tip)['muhash'])
assert node.gettxoutsetinfo(hash_type="muhash", hash_or_height=tip)['muhash']

self.log.info("check if we can access the blockfilter and coinstats of a pruned block")
height_hash = self.nodes[0].getblockhash(2)
for node in filter_nodes:
assert_greater_than(len(node.getblockfilter(height_hash)['filter']), 0)
for node in stats_nodes:
assert(node.gettxoutsetinfo(hash_type="muhash", hash_or_height=height_hash)['muhash'])
assert node.gettxoutsetinfo(hash_type="muhash", hash_or_height=height_hash)['muhash']

# mine and sync index up to a height that will later be the pruneheight
self.generate(self.nodes[0], 51)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class InitStressTest(BitcoinTestFramework):
subsequent starts.
"""

def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = False
self.num_nodes = 1
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_chainlocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
import time

class LLMQChainLocksTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(5, 4)
self.delay_v20_and_mn_rr(height=200)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
from test_framework.util import assert_greater_than_or_equal

class LLMQConnections(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(15, 14)
self.set_dash_llmq_test_params(5, 3)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_data_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@


class QuorumDataRecoveryTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
extra_args = [["-vbparams=testdummy:0:999999999999:0:10:8:6:5:-1"] for _ in range(7)]
self.set_dash_test_params(7, 6, extra_args=extra_args)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_dkgerrors.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
'''

class LLMQDKGErrors(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(4, 3, [["-whitelist=127.0.0.1"]] * 4)

Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_evo.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def getmnlistdiff(self, baseBlockHash, blockHash):
return self.last_mnlistdiff

class LLMQEvoNodesTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
# we just need a couple of regular nodes to be ensured that they are not included in platform quorum, 2 is enough
self.set_dash_test_params(3, 2, evo_count=4)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_is_cl_conflicts.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ def on_getdata(self, message):


class LLMQ_IS_CL_Conflicts(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(5, 4)
self.set_dash_llmq_test_params(4, 4)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_is_retroactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@


class LLMQ_IS_RetroactiveSigning(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
# -whitelist is needed to avoid the trickling logic on node0
self.set_dash_test_params(5, 4, [["-whitelist=127.0.0.1"], [], [], [], ["-minrelaytxfee=0.001"]])
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_llmq_rotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ def getmnlistdiff(self, baseBlockHash, blockHash):
return self.last_mnlistdiff

class LLMQQuorumRotationTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(9, 8, extra_args=[["-vbparams=testdummy:999999999999:999999999999"]] * 9)
self.set_dash_llmq_test_params(4, 4)
Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_llmq_signing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def set_test_params(self):
self.set_dash_llmq_test_params(5, 3)

def add_options(self, parser):
self.add_wallet_options(parser)
parser.add_argument("--spork21", dest="spork21", default=False, action="store_true",
help="Test with spork21 enabled")

Expand Down
1 change: 1 addition & 0 deletions test/functional/feature_llmq_simplepose.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def set_test_params(self):
self.delay_v20_and_mn_rr(height=9999)

def add_options(self, parser):
self.add_wallet_options(parser)
parser.add_argument("--disable-spork23", dest="disable_spork23", default=False, action="store_true",
help="Test with spork23 disabled")

Expand Down
4 changes: 3 additions & 1 deletion test/functional/feature_llmq_singlenode.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@

q_type=100
class LLMQSigningTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(1, 0, [["-llmqtestinstantsenddip0024=llmq_test_instantsend", "-peertimeout=300000000"]],
evo_count=2)
self.set_dash_llmq_test_params(1, 1)


def mine_single_node_quorum(self):
node = self.nodes[0]
quorums = node.quorum('list')['llmq_test']
Expand Down
16 changes: 10 additions & 6 deletions test/functional/feature_masternode_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@


class MasternodeParamsTest(BitcoinTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
Expand Down Expand Up @@ -77,12 +80,13 @@ def run_test(self):
self.stop_node(1)

# Check debug log for parameter interaction messages during startup
with self.nodes[1].assert_debug_log(["parameter interaction: -masternodeblsprivkey set -> setting -disablewallet=1"]):
self.start_node(1, extra_args=[
f"-masternodeblsprivkey={bls_key}",
"-peerblockfilters=0",
"-blockfilterindex=0"
])
if self.is_wallet_compiled():
with self.nodes[1].assert_debug_log(["parameter interaction: -masternodeblsprivkey set -> setting -disablewallet=1"]):
self.start_node(1, extra_args=[
f"-masternodeblsprivkey={bls_key}",
"-peerblockfilters=0",
"-blockfilterindex=0"
])
# Note: The peerblockfilters and blockfilterindex messages won't be in the log
# when explicitly disabled, only when auto-enabled

Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_mnehf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
)

class MnehfTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
extra_args = [["-vbparams=testdummy:0:999999999999:0:4:4:4:5:1", "-persistmempool=0"]] * 4
self.set_dash_test_params(4, 3, extra_args=extra_args)
Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ def notify_outputname(walletname, txid):


class NotificationsTest(DashTestFramework):
def add_options(self, parser):
self.add_wallet_options(parser)

def set_test_params(self):
self.set_dash_test_params(6, 4)

Expand Down
Loading
Loading