Commit Graph
399 Commits
Author SHA1 Message Date
j-berman 236ca60be0 cryptonote_basic: parse_and_validate_tx param to check max size
Simple API to check max blob size before parsing. This is useful
when reading blobs from untrusted sources.

@selsta pointed out that coinbase txs can technically be larger
than get_max_tx_size(), otherwise we could enforce it on all txs.
2026-08-13 09:12:10 -07:00
tobtoht ed0363031c Merge pull request #11067
bfe6990 cryptonote_basic: sanity check on key offsets (j-berman)

ACKs: jpk68*, SNeedlewoods, thomasbuilds, jeffro256
2026-08-13 13:03:22 +00:00
j-berman bfe699082e cryptonote_basic: sanity check on key offsets
Nice early check on allowed n key offsets per tx based on the
guaranteed ceiling for the entire chain.
2026-08-07 14:25:58 -07:00
Cole Munz 5f767c6e4e cryptonote_basic: keep additional derivations aligned in key image helper
generate_key_image_helper only appended to additional_recv_derivations when
generate_key_derivation succeeded. A tx pubkey that is not a valid point makes
that call fail, so every later derivation shifted down one slot.

is_out_to_acc_precomp indexes that vector by the output index, so once the
list is short the lookup either falls off the bounds check or reads the
derivation belonging to a different output. Either way the helper reports that
the output does not belong to the address, and the wallet cannot build a key
image for an output it owns. Anyone who can put a transaction in front of the
wallet chooses those pubkeys.

The main tx pubkey a few lines up already handles a failed derivation by
keeping its slot and padding with identity, and wallet2 does the same in the
three places it builds this list (wallet2.cpp:2393, :7887, :13397). Do it here
too.
2026-07-31 23:37:25 -05:00
jeffro256 edea8505db general: replace auto_scope_leave_caller with scope_guard
And replace unused inclusions of misc_language.h
2026-07-15 19:54:58 -05:00
tobtoht d6aa5ce38f Merge pull request #10851
7eb70c7 chore: remove msvc remnants (jpk68)

ACKs: selsta, tobtoht
2026-07-08 09:26:40 +00:00
tobtoht a7c93412fe Merge pull request #10839
dc45f67 cryptonote_basic: remove legacy address parser (Ap4sh)

ACKs: selsta, tobtoht
2026-07-06 16:46:50 +00:00
selstaandjeffro256 dc8bc028a6 cryptonote: scope 202612 PoW workaround
The block 202612 PoW workaround previously applied to any block at
height 202612. Restrict it to the object hashes of the known historical
mainnet, testnet, and stagenet block hashing blobs so new chains do not
inherit the fixed PoW hash, which would prevent sync or mining past that
height if their difficulty is higher.

Reported-by: DataHoarder
Co-authored-by: jeffro256 <jeffro256@tutanota.com>
2026-07-03 14:59:41 +02:00
tobtoht 381fce8dde Merge pull request #10828
fecef76 Fix spelling typos in comments and string literals (Thomas)

ACKs: tobtoht, selsta
2026-07-02 13:18:56 +00:00
tobtoht a9d9134f62 Merge pull request #10800
f4047ae cryptonote_basic: copy tx extra payment IDs (Ap4sh)

ACKs: jeffro256, selsta
2026-07-01 20:00:37 +00:00
Ap4sh dc45f673c9 cryptonote_basic: remove legacy address parser 2026-06-30 12:20:41 +02:00
jpk68 7eb70c7858 chore: remove msvc remnants 2026-06-29 21:29:19 -04:00
tobtoht 7f982b8c9d Merge pull request #10803
d7e2399 cryptonote_basic: remove unused function (jpk68)

ACKs: selsta, tobtoht
2026-06-27 12:02:08 +00:00
Thomas fecef767c9 Fix spelling typos in comments and string literals 2026-06-27 09:53:48 +02:00
Ap4sh f4047aeb41 cryptonote_basic: copy tx extra payment IDs 2026-06-21 16:41:13 +02:00
jpk68 d7e23999d9 cryptonote_basic: remove unused function 2026-06-16 21:34:48 -04:00
tobtoht 9854fbd420 Merge pull request #10742
248792a Miner: fixed thread 0 always mining with secure JIT (worse performance) (SChernykh)

ACKs: selsta, tobtoht
2026-06-15 14:44:11 +00:00
tobtoht d5b226d295 Merge pull request #10566
6460917 serialization: avoid blob memcpy of secret_key vector (selsta)

ACKs: vtnerd, tobtoht
2026-06-13 10:14:19 +00:00
SChernykh 248792a4be Miner: fixed thread 0 always mining with secure JIT (worse performance) 2026-06-08 19:35:10 +02:00
jpk68 5b34e138d6 src: fix formatting of copyright comments 2026-05-25 20:08:02 -04:00
Thomas 2c327aa325 fix spelling in comments and docs 2026-05-13 21:20:05 +02:00
selsta 6460917cab serialization: avoid blob memcpy of secret_key vector 2026-05-09 23:42:51 +02:00
tobtoht 90fc50c371 cmake: only link Boost Chrono where needed 2026-05-06 21:24:14 +02:00
j-berman 94089a8788 cryptonote_basic: pruned hash return bool 2026-04-21 12:04:31 -07:00
tobtoht 2404f1bc92 Merge pull request #10220
2eed71e cryptonote_basic: fix add_extra_nonce_to_tx_extra() length (jeffro256)
2026-03-01 11:27:03 +00:00
jeffro256 2eed71e575 cryptonote_basic: fix add_extra_nonce_to_tx_extra() length
Reviewed-by: selsta <selsta@sent.at>
Reviewed-by: SChernykh
2026-02-24 17:13:37 -06:00
jeffro256 6a99c22cbc rpc: return error gracefully on cryptonight v1 check 2026-01-31 10:14:05 -06:00
tobtoht 74dd968cd9 Merge pull request #10039
488bf71 cryptonote_basic: add overload for get_block_longhash() (jeffro256)
2026-01-29 15:43:22 +00:00
jeffro256 ca27d519df cryptonote_basic: remove redundant call to get_transaction_hash() in overload
Issue noticed by DataHoarder.
2025-10-05 16:47:57 -05:00
jeffro256 488bf71925 cryptonote_basic: add overload for get_block_longhash() 2025-09-07 09:58:20 -05:00
tobtoht da2c15b76e Merge pull request #10026
613ee85 cryptonote_basic: remove state_idle in connection_context (jeffro256)
2025-08-21 16:22:13 +00:00
tobtoht a8b5ae6dd2 Merge pull request #9919
06b74ae ringct & cryptonote_basic: detangle dependencies (jeffro256)
2025-08-21 16:18:14 +00:00
jeffro256 613ee85402 cryptonote_basic: remove state_idle in connection_context 2025-08-07 20:55:44 -05:00
jeffro256 06b74ae3f5 ringct & cryptonote_basic: detangle dependencies
`libringct` was linking against `libcryptonote_basic` for a single, one-line convenience function: `cryptonote::get_blob_hash`.
Since `cryptonote_basic.h` includes `rctTypes.h`, this one function effectively made an explicit circular dependency between
the two libraries. `cryptonote_format_utils.cpp` was including header `rctSigs.h` from `libringct`, when only `rctOps.h` from
`libringct_basic` needed to be included. `libcryptonote_basic` wasn't explictly linking against `libringct_basic` nor
`libringct` like it should have. And `libblockchain_db` wasn't linking against `libcryptonote_basic` like it should have. We
can also downgrade `libblockchain_db`'s dependency on `libringct` to `libringct_basic`.
2025-05-07 19:52:24 -05:00
0xFFFC0000 d106e21b74 src: fix clangd warnings 2025-05-01 05:27:35 +00:00
tobtoht 627bb04b98 Merge pull request #9851
70fe289d8 Improve move/copy/default constructor semantics for tx and block (Lee *!* Clagett)
2025-04-23 16:14:50 +00:00
jeffro256 7cb406e05a cryptonote_basic: is_coinbase() take prefix
Useful for wallet business logic, which stores the prefixes in `m_transfers`, not the whole transaction.
2025-04-02 11:01:49 -05:00
Lee *!* Clagett 55e6ba49cb Fix expected hash check 2025-03-24 10:56:53 -04:00
Lee *!* Clagett 70fe289d82 Improve move/copy/default constructor semantics for tx and block 2025-03-21 14:02:12 -04:00
tobtoht 44523cafff Merge pull request #9135
c069c04ed blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
2025-03-10 16:16:18 +00:00
jeffro256 c069c04ede blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:02:37 -05:00
tobtoht e87c16dd3e Merge pull request #9582
16b5c11f7 Some cleanup in span/connection_context + few more checks (Lee *!* Clagett)
2025-02-13 17:36:19 +00:00
luigi1111 785e3ac673 Merge pull request #9122
a79734c cryptonote_basic: faster and more readable is_valid_decomposed_amount (jeffro256)
2024-12-23 10:18:07 -05:00
Lee *!* Clagett 16b5c11f74 Some cleanup in span/connection_context + few more checks 2024-11-19 18:30:34 -05:00
jeffro256 ed955bf751 build: fix build with Boost 1.85 and remove instances of viewkey logging
1. Use `std::is_standard_layout` and `std::is_trivially_copyable` instead of `std::is_pod` for KV byte-wise serialization, which fixes compile issue for Boost UUIDs
2. Use `std::has_unique_object_representations` instead of `alignof(T) == 1` for epee byte spans and epee hex functions
3. Removed reimplementation of `std::hash` for `boost::uuids::uuid
4. Removed `<<` operator overload for `crypto::secret_key`
5. Removed instances in code where private view key was dumped to the log in plaintext
2024-09-06 11:46:22 -05:00
jeffro256 ac0af73222 rpc: add cumul weight field to block template resp
Resolves #9415
2024-08-01 01:03:41 -05:00
luigi1111 040bccc22f Merge pull request #9338
4a376d6 copyright: fix vector.h typo (hinto.janaiyo)
d61e8e9 workflows: delete copyright.yml (plowsof)
341771a copyright: bump to 2024 (copyCat)
2024-07-16 18:42:49 -04:00
j-berman e71c8bf190 wallet: background sync with just the view key
- When background syncing, the wallet wipes the spend key
from memory and processes all new transactions. The wallet saves
all receives, spends, and "plausible" spends of receives the
wallet does not know key images for.
- When background sync disabled, the wallet processes all
background synced txs and then clears the background sync cache.
- Adding "plausible" spends to the background sync cache ensures
that the wallet does not need to query the daemon to see if any
received outputs were spent while background sync was enabled.
This would harm privacy especially for users of 3rd party daemons.
- To enable the feature in the CLI wallet, the user can set
background-sync to reuse-wallet-password or
custom-background-password and the wallet automatically syncs in
the background when the wallet locks, then processes all
background synced txs when the wallet is unlocked.
- The custom-background-password option enables the user to
open a distinct background wallet that only has a view key saved
and can be opened/closed/synced separately from the main wallet.
When the main wallet opens, it processes the background wallet's
cache.
- To enable the feature in the RPC wallet, there is a new
`/setup_background_sync` endpoint.
- HW, multsig and view-only wallets cannot background sync.
2024-05-24 23:11:58 -07:00
copyCat 341771ac3e copyright: bump to 2024 2024-05-21 16:29:33 +00:00
jeffro256 38f354e89f Enforce Tx unlock_time is Zero by Relay Rule
Related to https://github.com/monero-project/research-lab/issues/78

Added a relay rule that enforces the `unlock_time` field is equal to 0 for non-coinbase transactions.

UIs changed:
* Removed `locked_transfer` and `locked_sweep_all` commands from `monero-wallet-cli`

APIs changed:
* Removed `unlock_time` parameters from `wallet2` transfer methods
* Wallet RPC transfer endpoints send error codes when requested unlock time is not 0
* Removed `unlock_time` parameters from `construct_tx*` cryptonote core functions
2024-02-24 14:27:17 -06:00