Skip to content

Add dedicated miner role for block production#16

Closed
0xZaddyy wants to merge 2 commits intopayjoin:masterfrom
0xZaddyy:miner-role
Closed

Add dedicated miner role for block production#16
0xZaddyy wants to merge 2 commits intopayjoin:masterfrom
0xZaddyy:miner-role

Conversation

@0xZaddyy
Copy link
Copy Markdown
Contributor

@0xZaddyy 0xZaddyy commented Apr 8, 2026

This pr implements a dedicated miner role that allows wallets to focus solely on block production without participating in payment obligations, enabling more realistic network simulations.

closes #15

@0xZaddyy 0xZaddyy force-pushed the miner-role branch 3 times, most recently from 27165f3 to 12d475c Compare April 8, 2026 21:04
Comment thread src/lib.rs Outdated
Comment on lines +430 to +439
// Find the first wallet that is a miner
let miner = self
.wallet_data
.iter()
.find(|w| w.is_miner)
.map(|w| w.id)
.unwrap_or_else(|| {
// Fallback to wallet 0 if no miner is found
WalletId(0)
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we need to create a new startegy for miners. That would only be useful if we want to simulate different mining behavior. Instead lets just allocate the first address Addresss(0) to the miner.

Implement `MinerStrategy` to allow wallets that only mine blocks without handling payment obligations
Comment thread config.toml.example
coordination_weight = 0.0

[[wallet_types]]
name = "Payjoiner"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why did this change from default -> payjoiner

Comment thread src/config.rs
#[serde(default)]
pub script_type: ScriptType,
#[serde(default)]
pub is_miner: bool,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The latest commit is mainly doing the samething just refactored. did this not work:

. Instead lets just allocate the first address Addresss(0) to the miner.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

#18

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.

Miner role

2 participants