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

Add a manually-triggered workflow for mining a block on testnet #6025

Closed
teor2345 opened this issue Jan 24, 2023 · 11 comments
Closed

Add a manually-triggered workflow for mining a block on testnet #6025

teor2345 opened this issue Jan 24, 2023 · 11 comments
Labels
A-compatibility Area: Compatibility with other nodes or wallets, or standard rules A-consensus Area: Consensus rule updates A-devops Area: Pipelines, CI/CD and Dockerfiles A-rpc Area: Remote Procedure Call interfaces C-testing Category: These are tests

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jan 24, 2023

Motivation

We want to add a workflow to Zebra that:

  1. Only runs when a developer manually triggers it
  2. Launches a new zebrad node on testnet
  3. Launches a mining pool or solo miner to connect to zebrad
  4. Waits for zebrad to sync
  5. Mines a block
  6. Fails if no blocks are mined, or if the mined blocks are invalid, or if the miner has RPC errors

We also want to add this workflow to the release checklist, to make sure we haven't broken miner support.

Complex Code or Requirements

We'll need enough RPCs implemented to run the mining software, and we need to fix all the RPC bugs and incompatibilities.

Testing

We'll need to run the workflow manually a few times before merging the PR.

Timing

We're going to limit this ticket to 2 days of work, because it won't be usable in production. (We had to disable parts of s-nomp because it doesn't support NU5.)

Related Work

Create a Docker image for mining on Testnet with Zebra:

Check that a miner can connect to Zebra, but don't wait for the sync, and don't mine any blocks:

@teor2345 teor2345 added A-consensus Area: Consensus rule updates A-devops Area: Pipelines, CI/CD and Dockerfiles S-needs-triage Status: A bug report needs triage P-Medium ⚡ C-testing Category: These are tests A-rpc Area: Remote Procedure Call interfaces A-compatibility Area: Compatibility with other nodes or wallets, or standard rules labels Jan 24, 2023
@mpguerra mpguerra moved this to 🆕 New in Zebra Jan 24, 2023
@mpguerra mpguerra added this to Zebra Jan 24, 2023
@mpguerra
Copy link
Contributor

This should probably be the last issue we work on as part of the GBT work

@mpguerra
Copy link
Contributor

@upbqdn
Copy link
Member

upbqdn commented Feb 5, 2023

A prerequisite for this issue is to find a suitable miner that would run in the CI.

@teor2345
Copy link
Contributor Author

teor2345 commented Feb 6, 2023

A prerequisite for this issue is to find a suitable miner that would run in the CI.

I think nheqminer should work in CPU mode, following these instructions:
https://github.com/ZcashFoundation/s-nomp/blob/zebra-mining/zebra-instructions.md

It is relatively cheap to mine on testnet, the difficulty is around 1-5 CPU cores most of the time.

@mpguerra
Copy link
Contributor

mpguerra commented Feb 7, 2023

I think this issue is a nice to have so let's timebox it to a couple of days

@teor2345
Copy link
Contributor Author

teor2345 commented Feb 8, 2023

Is this a low priority or optional ticket?

@mpguerra
Copy link
Contributor

mpguerra commented Feb 9, 2023

Is this a low priority or optional ticket?

Depends on:

  • how useful the team thinks it will be
  • how often we will use it
  • what the maintenance burden (if any) will be (I guess this will be mitigated by having a Docker image)

We may also decide to make #6118 the same priority as this one, e.g if this is optional so should #6118 be

@teor2345
Copy link
Contributor Author

teor2345 commented Feb 9, 2023

Is this a low priority or optional ticket?

Depends on:
* how useful the team thinks it will be
* how often we will use it
* what the maintenance burden (if any) will be (I guess this will be mitigated by having a Docker image)

We may also decide to make #6118 the same priority as this one, e.g if this is optional so should #6118 be

If miners are using Zebra in production, we'll need to test the mining RPCs work before we do each release. (Because we're not doing integration testing with every PR.) So I think this workflow is actually a blocker for mainnet mining in production.

Otherwise, we could accidentally release a RPC bug, and miners would lose money and stop using Zebra.

For example, we recently released a lightwalletd bug into production that we claimed we'd fixed, because no-one tested the PR with that fork of lightwalletd. So this is reasonably likely to happen if we don't have a mining workflow.

@teor2345
Copy link
Contributor Author

@mpguerra did you want to reduce this estimate now we have split the docker image into #6118?

@mpguerra
Copy link
Contributor

@mpguerra did you want to reduce this estimate now we have split the docker image into #6118?

Sure

@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Mar 16, 2023
@teor2345
Copy link
Contributor Author

I don't think this ticket is a medium priority any more, our tests seem fine without it.

@teor2345 teor2345 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 18, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Zebra Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: Compatibility with other nodes or wallets, or standard rules A-consensus Area: Consensus rule updates A-devops Area: Pipelines, CI/CD and Dockerfiles A-rpc Area: Remote Procedure Call interfaces C-testing Category: These are tests
Projects
Archived in project
Development

No branches or pull requests

3 participants