Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yiimp/stratum report "LBRY Credits #block not reporting" #74

Closed
roylee17 opened this issue Jul 28, 2022 · 1 comment · Fixed by #75
Closed

yiimp/stratum report "LBRY Credits #block not reporting" #74

roylee17 opened this issue Jul 28, 2022 · 1 comment · Fixed by #75
Assignees
Labels
mining Mining (including pool) related issues

Comments

@roylee17
Copy link
Collaborator

roylee17 commented Jul 28, 2022

15:56:30: LBRY Credits 1198462 not reporting
16:12:24: LBRY Credits 1198470 not reporting
16:13:28: LBRY Credits 1198471 not reporting
16:16:17: LBRY Credits 1198472 not reporting
16:18:45: LBRY Credits 1198473 not reporting
16:19:27: LBRY Credits 1198474 not reporting

yimmp was still able to conducting the mining cycle:

  1. getblocktemplate()
  2. distribute jobs to miners
  3. submiteblock() back to the lbcd

But the accepted blocks () was not reported and entered into yimmp database, and requires operator's intervene.

@roylee17 roylee17 added the mining Mining (including pool) related issues label Jul 28, 2022
@roylee17 roylee17 self-assigned this Jul 28, 2022
@roylee17
Copy link
Collaborator Author

Follow the logic, the templ->height (acquired via getblocktemplate rpc is more recent than coind->height by 5+ blocks.

https://github.com/LBRYFoundation/pool/blob/next/stratum/coind_template.cpp#L550-L563

	int height = coind->height;
	coind->height = templ->height-1;

	if(height > coind->height)
	{
		stratumlog("%s went from %d to %d\n", coind->name, height, coind->height);
	//	coind->auto_ready = false;
	}

	if(height < coind->height && !coind->newblock)
	{
		if(coind->auto_ready && coind->notreportingcounter++ > 5)
			stratumlog("%s %d not reporting\n", coind->name, coind->height);
	}

yiimp learns block height / update by two ways:

  1. actively calling lbcd rpc, such as getinfo, getblocktemplate, etc
  2. notified by a stratum message mining.block_update
    In our case, the lbcblocknotify acts as a bridge, which subscribes to lbcd's blockupdate websocket message, and send mining.update_block message to stratum server.

We decided to investigate the 2) route first, and it turned out to be the root cause.

https://github.com/LBRYFoundation/pool/blob/next/stratum/client.cpp#L306-L307

	int coinid = json_params->u.array.values[1]->u.integer;
	if(!coinid) return false;

The stratum server silently rejects the mimg.block_update messages from the lbcdblocknotify bridge.
As the coinid field was reported as string"1425" instead of integer 1425 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mining Mining (including pool) related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant