Skip to content

merge 7.0.3 from dev - #221

Merged
victor-tucci merged 29 commits into
connection_checkfrom
dev
Aug 29, 2026
Merged

victor-tucci merged 29 commits into
connection_checkfrom
dev

Conversation

@victor-tucci

Copy link
Copy Markdown
Member

No description provided.

tunacanfinder and others added 29 commits June 3, 2026 16:55
The get<T> templates at beldex_name_system.cpp:301-306 compare
sizeof(T) against 32, but sizeof is bytes not bits, so every
integer type takes the 32-bit reader and 64-bit columns are
silently truncated. The matching bind<T> templates at line 178
already use the correct predicate (<= 4). Mainnet heights and
timestamps will start losing precision once they cross INT32_MAX.

mapping_value::make_decrypted at line 1584 calls encrypt() instead
of decrypt(), and the assert(!result.encrypted) on the next line
cannot hold after that call. The function has no callers right
now; fixing it before anything starts using it.
…eights

Four NOTIFY handlers in cryptonote_protocol_handler.inl accept incoming
messages without verifying correlation against pending requests.
handle_response_get_blocks at line 1216 derefs context.m_last_request_time
without checking it; an unsolicited NOTIFY_RESPONSE_GET_BLOCKS reaches
that line and crashes the daemon.

Adds per-request correlation tokens:
- m_requested_objects (existing) for GET_BLOCKS (must be non-empty)
- m_requested_objects (existing) for CHAIN_ENTRY (must be empty; chain
  responses do not consume a pending block-response timer)
- new m_requested_flash_heights field on connection_context populated
  at the NOTIFY_REQUEST_BLOCK_FLASHES send-site for BLOCK_FLASHES
  responses
- CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT cap on
  NOTIFY_REQUEST_BLOCK_FLASHES heights
have_tx_keyimges_as_spent walks tx.vin and appends every conflicting
txid per spent key image. If one mempool tx shares 2+ key images with
the incoming tx, its txid is appended multiple times.

remove_flash_conflicts iterates that vector and calls remove_tx per
entry. The first call succeeds; the second on the same txid fails at
the sorted-container check. remove_flash_conflicts treats failure as
fatal and returns early, so the LockedTXN destructor aborts the DB
batch. The LMDB row is restored, but in-memory mutations from the
first call (m_txpool_weight decrement, remove_transaction_keyimages,
sorted-container erase) are not rolled back. m_spent_key_images then
no longer contains entries for that txs inputs, so subsequent txs
spending the same outputs are not rejected by have_tx_keyimges_as_spent
until the orphaned row is aged out or the daemon restarts.

Triggered by a single signer producing two txs sharing 2+ inputs.

Dedupes the conflict list at source in have_tx_keyimges_as_spent via
unordered_set. Makes remove_tx idempotent when called without stc_it:
a missing sorted-container entry is treated as already-removed with
an MWARNING log so the path stays observable.
The receiver already drops connections that request more than
CURRENCY_PROTOCOL_MAX_OBJECT_REQUEST_COUNT flash heights. Cap the sender so a
node with a large flash backlog cannot exceed the limit in a single request and
get dropped by a peer that enforces it. Overflow heights stay flagged in
m_flash_state and are re-requested when the peer next advertises a changed
flash set.
When remove_tx is called without a sorted-container iterator and the tx is not
in the sorted container, it previously returned success unconditionally. A tx
can be sorted-erased while still present in the backing store (the parse-failure
window in remove_stuck_transactions leaves the DB row, key images, and counted
weight). Check the backend: absent -> idempotent success; present and parseable
-> complete the skipped cleanup; present but unparseable -> return failure so the
orphan is surfaced rather than leaving orphaned key images.
Only send a NOTIFY_REQUEST_BLOCK_FLASHES when no request is already pending. A
new advertisement re-arms m_need_flash_sync and re-fires on_callback, so a second
request could be built while the first was still in flight; both share one
m_requested_flash_heights set, so the first response clears it and the second
response finds it empty and drops the connection. Gating the send on an empty
pending set keeps a single request in flight, so every response correlates.
Skipped heights stay flagged in m_flash_state and go out on the next sync round.
1. Nonce Consumption: Updated wallet2::get_multisig_k to immediately memwipe and erase secret nonces upon first lookup, preventing single-use nonces from being reused across signing variants.

2. Pairwise Nonce Disjointness: Added validation in wallet2::sign_multisig_tx to ensure used_L nonce sets across all signature variants are strictly pairwise disjoint, aborting signing if duplicates are detected.

3. Cryptographic Scalar Validation: Added strict non-zero scalar checks (sc_check and sc_isnonzero) in signMultisigMLSAG and signMultisigCLSAG to validate k, secret_key, msout.c, and msout.mu_p.

4. RPC Sanity Checks: Added non-empty payload verification in SIGN_MULTISIG RPC handler to safely reject malformed input sets.
Strictly bound the maximum allowed size of encrypted_value in BNS decryption requests to BUFFER_SIZE * 2 across all input types, preventing excessive memory usage and sanitizing the error message output.
wallet, rpc: fix multisig signing security logic and BNS decryption bounds
wallet: restrict sensitive RPC commands under --restricted-rpc
fix(bns): correct SQLite read-width predicate and make_decrypted helper
-master_node_voting: the signature-failure log read
quorum.workers[vote.state_change.worker_index] for all vote types, but
worker_index only exists on obligation votes -- for a checkpoint vote it
aliases attacker-controlled bytes and indexes an empty vector. Guard it by
vote type. Also re-enable the two success logs at MTRACE (level 3) instead
of leaving them commented out.

-pos: only accept a random value reveal from a quorum position that actually
committed a hash, so the commit-reveal binding is enforced locally rather
than relying on the stage timeout.

-pos: drop the dead std::sample in signature selection and fix the comment --
the loop always used the first N.
When the requested amount is missing from the light wallet server's response, the search loop in light_wallet_get_outs exits with amount_key == amount_outs.size(). The error message then indexes amount_outs at that position, reading one past the end of the vector.

Report `amount` instead: it is the value being searched for, and on the success path it equals amount_outs[amount_key].amount by definition.
fix(tx_pool): dedupe key-image conflict list; make remove_tx idempotent
fix(p2p): correlate NOTIFY responses with prior requests; cap flash heights
Fix unguarded worker_index read and harden POS commit-reveal
fix: wallet RPC validation and mempool key image handling
fix: p2p chain-entry response correlation, flash cap follow-up, IPv6 …
@coderabbitai

coderabbitai Bot commented Aug 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 95a2d620-e435-464c-942a-6dfd689d6b78

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@victor-tucci
victor-tucci merged commit a09faa0 into connection_check Aug 29, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants