Skip to content

Commit

Permalink
feat: change microblock mining strategy
Browse files Browse the repository at this point in the history
Make a miner start mining microblocks immediately after it mines an
anchor block. Since this is a single miner environment, there is no need
to continue RBF-ing the block-commit transaction, spamming the L1
mempool. Instead, the miner can just send one block-commit as soon as a
new L1 block arrives, then build microblocks until the next L1 block
arrives.
  • Loading branch information
obycode committed Jun 21, 2023
1 parent b702561 commit dcbc0b5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions testnet/stacks-node/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1163,10 +1163,10 @@ impl NodeConfig {
miner: false,
mock_mining: false,
mine_microblocks: true,
microblock_frequency: 30_000,
microblock_frequency: 15_000,
max_microblocks: u16::MAX as u64,
wait_time_for_microblocks: 30_000,
wait_before_first_anchored_block: 5 * 60_000,
wait_time_for_microblocks: 0,
wait_before_first_anchored_block: 0,
prometheus_bind: None,
marf_cache_strategy: None,
marf_defer_hashing: true,
Expand Down
4 changes: 0 additions & 4 deletions testnet/stacks-node/src/neon_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,6 @@ fn spawn_miner_relayer(
// stale request
continue;
}
if last_mined_blocks.contains_key(&burnchain_tip.burn_header_hash) {
// this miner has already made an anchored block for this burn block
continue;
}
if let Some(cur_sortition) = get_last_sortition(&last_sortition) {
if burnchain_tip.sortition_id != cur_sortition.sortition_id {
debug!("Drop stale RunMicroblockTenure for {}/{}: current sortition is for {} ({})", &burnchain_tip.consensus_hash, &burnchain_tip.winning_stacks_block_hash, &cur_sortition.consensus_hash, &cur_sortition.burn_header_hash);
Expand Down

0 comments on commit dcbc0b5

Please sign in to comment.