btccom / btcpool-ABANDONED

backend of pool.btc.com
https://pool.btc.com
MIT License
643 stars 408 forks source link

请教下关于联合挖矿触发新任务下发的算力损失问题 #396

Closed DebugFuture closed 4 years ago

DebugFuture commented 5 years ago

文档里建议当联合挖矿有新任务的时候,触发新的任务下发。请问下矿机在切换任务的时候,一般会损失多少的算力,可以忽略不计吗?因为联合挖矿的币种币价比较便宜,这样切换任务是否划算?

# policy used to determine the pace of merge mining jobs to be sent.
# 0: merge mining `getwork` does not trigger job updates.
# 1: update job when the `notify` flag in RSK `getwork` is true or the block height in Namecoin/VCash `getwork` higher than before.
# 2: update job when the current block hash of a merge mining `getwork` is different from before.
aux_merged_mining_notify = 1; # (1 is recommended and default)
rsk_merged_mining_notify = 1; # (1 is recommended and default)
vcash_merged_mining_notify = 1; # (1 is recommended and default)
duguyifang commented 4 years ago

联合挖矿触发的任务更新并不会要求矿机立即切换任务。只是尽可能将最新的联合挖矿任务下发给矿机,在矿机进行正常的任务切换时,能够及时处理包含最新联合挖矿任务的任务。需要考虑的是联合挖矿任务更新过快可能导致用户矿场网络堵塞,拒绝率升高。

DebugFuture commented 4 years ago

如果aux_merged_mining_notify设置为1,那么联合挖矿的高度更新时,是会通知矿机立马下发新任务的?

bool higherHeightUpdate = def()->auxmergedMiningNotifyPolicy_ == 1 &&
      currentNmcBlockHeight > latestNmcAuxBlockHeight;

bool isMergedMiningUpdate = higherHeightUpdate || differentHashUpdate;
  if (isMergedMiningUpdate) {
    isMergedMiningUpdate_ = true;
  }

// for Namecoin and RSK merged mining
isMergedMiningCleanJob_ = isMergedMiningUpdate;

bool isMergedMiningClean =
      sjob->isMergedMiningCleanJob_ && height >= lastHeight_;

// if job has clean flag, call server to send job
if (isClean || isMergedMiningClean) {
  sendMiningNotify(exJob);
  return;
}
DebugFuture commented 4 years ago

想通了,联合挖矿的高度只要不是频繁的更新,配置为1应该没什么影响。