Skip to content

cuprated: broadcast newly added alt blocks to peers#577

Merged
Boog900 merged 1 commit intoCuprate:mainfrom
redsh4de:feat/broadcast-alt-blocks
Feb 10, 2026
Merged

cuprated: broadcast newly added alt blocks to peers#577
Boog900 merged 1 commit intoCuprate:mainfrom
redsh4de:feat/broadcast-alt-blocks

Conversation

@redsh4de
Copy link
Contributor

@redsh4de redsh4de commented Feb 5, 2026

What

Broadcasts newly cached alt blocks to peers

Closes #524

Why

Prevent nodes from initiating a sync if they don't have a alt block and the alt chain wins

Where

  • cuprated
    • blockchain/manager/handler.rs - split Cached bool in AddAltBlock into two variants - AlreadyCached and NewlyCached(bytes), which points to the block blob. Used in handle_incoming_block to determine whether the block is newly added, and broadcasts the block if it is

How

Effectively the same pattern as for main blocks

@github-actions github-actions bot added the A-binaries Area: Related to binaries. label Feb 5, 2026
Comment on lines +132 to +135
let chain_height = self
.blockchain_context_service
.blockchain_context()
.chain_height;
Copy link
Member

Choose a reason for hiding this comment

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

monerod seems to assume this is the block's height in its logs, which for alt blocks it might not be. This shouldn't be an issue just wanted to note it.

@Boog900 Boog900 merged commit 4e2701a into Cuprate:main Feb 10, 2026
12 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-binaries Area: Related to binaries.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broadcast new alt blocks

2 participants