Commit Graph
724 Commits
Author SHA1 Message Date
jeffro256andsuch-gitea a8818ce56d Blockchain: improve check_block_timestamp() overloads
(cherry picked from commit 478df04f38c60d4459e2a514055e7031c0f3ec32)
2026-10-04 18:52:22 -04:00
j-bermanandsuch-gitea 1d5bf8cc8e 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.

(cherry picked from commit b66e2227c2f937a3e09dd62ed770b0667bff0779)
2026-10-04 18:50:24 -04:00
j-bermanandsuch-gitea 39647836f4 blockchain: limit offsets cache size
(cherry picked from commit d232dc09c55104f011133425f22a1c0e4e0b21ee)
2026-10-04 18:50:23 -04:00
j-bermanandsuch-gitea 7ff4a5567a cryptonote_basic: serialization checks
(cherry picked from commit d869dc0981ac55f90d5b52a1a794b124ae274716)
2026-10-04 18:50:23 -04:00
j-bermanandsuch-gitea 2687f95798 blockchain: if block is known invalid, fail block verification
(cherry picked from commit 9044450974d5b9fe228f746d2f580e83e58ddec0)
2026-10-04 18:50:23 -04:00
selstaandsuch-gitea 809a263e11 rpc: hide sensitive txs from restricted block templates
(cherry picked from commit 1d45021cd0e452b60846b458701e612ab01db5c7)
2026-10-04 18:50:22 -04:00
Masamuneandsuch-gitea 881dcfbd43 Blockchain: fix data race in get_dynamic_base_fee_estimate
(cherry picked from commit 7368e166feef49be38dd96af309ac4746bbfe2b7)
2026-10-04 18:50:22 -04:00
selstaandsuch-gitea f289933e67 blockchain: improve incoming block scan table handling
(cherry picked from commit 05426c36cf6f77a7b0f9bcb0f46a0fd5219f6fa4)
2026-10-04 18:50:21 -04:00
SChernykhandsuch-gitea eb71cc9633 Blockchain: fix wrong block_weight in handle_get_objects
- When there are missing IDs, blocks.size() != arg.blocks.size(), so arg.blocks can't be indexed by `i` - the indices will be wrong, the wrong weight will be returned to some peer and this peer will ban our node.

Use `bl.second` instead of `arg.blocks[i]`. Also it saves one DB query per returned block.

(cherry picked from commit 3d856f4825283e66a7ebbe9ac32e3f864bc906e2)
2026-10-04 18:50:20 -04:00
wowario fbe80518cb update checkpoints 2026-05-15 02:30:12 +03:00
j-bermanandjwinterm 06fed93f74 p2p: fix race causing dropped connections during sync
Without this commit:
1) read height from DB
2) add block to chain in separate thread
3) read chain for block id's and request them from peer
4) ERR in handle_response_chain_entry, peer's first block is the
one that was added to the chain, which has block idx=height from
step 1.

This commit reads the chain for height and highest block id's
in one go while holding the m_blockchain_lock to avoid the race.

(cherry picked from commit d8d3cf97300480b9d3942c667978dd4860b76feb)
2026-05-05 18:19:53 -04:00
j-bermanandwowario 48e34c2336 Cleaner validation (faster and saner) 2025-10-10 08:47:44 +03:00
WeebDataHoarderandwowario 7a5cc4afb9 Send ZMQ miner notifications after txpool additions
Bug was introduced in c069c04ede, before this txpool additions were not notified on block addition

When receiving blocks with previously unknown conditions, miner data was sent first, but txpool add events for already-added transactions in previous block were sent afterward. Miners would then include already-mined transactions in their new templates due to receiving the mistimed txpool add event.

The fix is to send miner notifications AFTER txpool events are sent, and before normal block notifications are sent (for mining switch speed purposes)

Fixes c069c04ede / #9135
Fixes dfee15eee1 / #7891
2025-09-29 06:24:51 +03:00
wowario 1a94126ae4 update checkpoints 2025-09-19 21:01:46 +03:00
wowario 4a80a4a693 add checkpoints and fork heights 2025-09-19 21:01:45 +03:00
wowario de22caa968 cleanup old bp 2025-09-19 21:01:43 +03:00
wowario f7299beb66 vote by block 2025-09-19 21:01:43 +03:00
wowario 88e126db9c miner block header signing 2025-09-19 21:01:43 +03:00
wowario 2c544dee74 add nettype to diff algo 2025-09-19 21:01:43 +03:00
wowario 8077b9473a difficulty is fun 2025-09-19 21:01:42 +03:00
wowario b7fb563f83 shorten timestamp check window 2025-09-19 21:01:41 +03:00
wowario bf12e2745d limit future blk time to 10 min 2025-09-19 21:01:40 +03:00
wowario 30dba37f1f bump unlock time to 288 blks 2025-09-19 21:01:40 +03:00
wowario 8851bf7d14 set genesis block timestamp 2025-09-19 21:01:36 +03:00
wowario f3631823a8 bump ring size to 22 2025-09-19 21:01:36 +03:00
wowario 189b0d17fc del monero tx bug fixes 2025-09-19 07:05:44 +03:00
selsta f921431f34 checkpoints: update to a recent block height 2025-08-20 18:42:13 +02:00
selsta 32f701b0cd build: prepare v0.18.4.2 2025-08-01 17:25:46 +02:00
selsta b96af8e17a build: prepare v0.18.4.1 2025-07-09 16:12:16 +02:00
tobtoht f1311d4237 Merge pull request #9864
97e1a49dd checkpoints: update to a recent block height (selsta)
2025-03-26 12:37:43 +00:00
selsta 97e1a49dd7 checkpoints: update to a recent block height 2025-03-25 21:22:47 +01:00
tobtoht 4b7263d587 Merge pull request #9854
c7f01e57f Blockchain: remove skip for pruned txs in `check_tx_inputs()` (jeffro256)
2025-03-24 02:56:51 +00:00
jeffro256 c7f01e57f5 Blockchain: remove skip for pruned txs in check_tx_inputs()
I can't see how this would trigger in the current codebase, so it's not a *current* safety issue,
but I can very well see it becoming on in the future if downstream code doesn't handle the passing
of pruned transactions correctly. I think the safe/good choice would be to remove this skip now
that all transactions that pass into the mempool are supposed to be unpruned. And for all in-block
txs, `check_tx_inputs()` isn't called for checkpointed blocks, and we sync pruned blocks only if
syncing checkpointed blocks.
2025-03-19 23:25:48 -05:00
jeffro256 ce1c864b4d cryptonote_protocol: fix handling of pruned blocks during sync 2025-03-19 17:37:53 -05:00
tobtoht 3da68db978 Merge pull request #9740
008ba966d blockchain sync: reduce disk writes from 2 to 1 per tx (jeffro256)
2025-03-10 16:20:00 +00:00
jeffro256 008ba966da blockchain sync: reduce disk writes from 2 to 1 per tx 2025-03-10 01:32:08 -05:00
Lee *!* Clagett 01bcd52924 Fix build with boost ASIO 0.87. Support boost 1.66+ 2025-02-14 13:29:57 -05:00
selsta 3fef296082 build: prepare v0.18.4.0 2025-02-13 18:32:51 +01:00
tobtoht 9029001127 Merge pull request #9689
4d2aad837 Revert "blockchain: detect and log bad difficulty calculations" (selsta)
2025-01-22 22:51:55 +00:00
tobtoht 460412b10e Merge pull request #9622
41c4bc4 Blockchain: get height of RingCT fork programmatically (jeffro256)
2025-01-14 14:16:02 +00:00
selsta 4d2aad8378 Revert "blockchain: detect and log bad difficulty calculations"
This reverts commit 5741b4d74d.
2025-01-14 13:04:49 +01:00
luigi1111 8f531676b5 Merge pull request #9400
f0a574c Blockchain: fix temp fails causing alt blocks to be permanently invalid (jeffro256)
2024-12-23 10:33:54 -05:00
jeffro256 41c4bc4557 Blockchain: get height of RingCT fork programmatically
Get height of the RingCT fork to start the output distributuon programmatically, instead of using a hardcoded index.

If using a hardcoded index, when the hardfork tables are modified, this can cause segmentation faults or horrific privacy issues: https://codeberg.org/wownero/wownero/issues/488#issuecomment-2514880.
2024-12-16 15:23:27 -06:00
selsta 956d55c35f build: prepare v0.18.3.4 2024-07-22 14:23:40 +02:00
jeffro256 f0a574c3a9 Blockchain: fix temp fails causing alt blocks to be permanently invalid 2024-07-15 12:29:10 -05:00
selsta 97e3ce5f18 build: prepare v0.18.3.3 2024-03-11 15:20:10 +01:00
luigi1111 c6ff0d3820 Merge pull request #9136
f2360a7 build: prepare v0.18.3.2 (selsta)
2024-02-24 10:18:40 -05:00
selsta f2360a725e build: prepare v0.18.3.2 2024-02-20 15:37:47 +01:00
selsta 0cc8f7aaa3 cryptonote_core: early out on out of bounds scaling parameter 2024-02-20 15:21:27 +01:00
luigi1111 2656cdf505 Merge pull request #9014
69de381 add a test for the long term weight cache (Boog900)
810f6a6 Fix: long term block weight cache The long term block weight cache was doing a wrong calculation when adding a new block to the cache. (Boog900)
2023-10-02 15:28:11 -04:00