-
Notifications
You must be signed in to change notification settings - Fork 40
Add Makefile targets for block producer operations #1221
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
Conversation
17edf94
to
38f58f2
Compare
429c10e
to
1023f56
Compare
38f58f2
to
21d3247
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Makefile targets for block producer operations, providing an alternative to Docker Compose for running block producers. The implementation includes key generation, network-specific targets, and comprehensive documentation.
- Adds
generate-block-producer-key
andrun-block-producer
targets with devnet/mainnet support - Includes CI workflow to validate documentation commands functionality
- Updates documentation with detailed setup instructions and usage examples
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
Makefile | Adds block producer configuration variables and new targets for key generation and running producers |
docs/block-producer-guide.md | Documents the new Make-based alternative with prerequisites, setup steps, and usage examples |
CLAUDE.md | Adds block producer operations section with target descriptions and usage patterns |
.github/workflows/doc-commands.yml | New CI workflow to test key generation and validate make targets |
Comments suppressed due to low confidence (1)
.github/workflows/doc-commands.yml:76
- The test uses a placeholder value "test" for COINBASE_RECEIVER but doesn't validate that it's a proper wallet address format. Consider using a valid test wallet address format to ensure proper validation.
timeout 30s make run-block-producer-devnet COINBASE_RECEIVER="test" || {
- name: Test key file can be read by run-block-producer | ||
run: | | ||
echo "Testing that generated key can be used by run-block-producer target..." |
Copilot
AI
Jul 22, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test doesn't set MINA_PRIVKEY_PASS which is required for the block producer to decrypt the private key. This could lead to misleading test results or expose error handling issues.
echo "Testing that generated key can be used by run-block-producer target..." | |
echo "Testing that generated key can be used by run-block-producer target..." | |
# Set MINA_PRIVKEY_PASS environment variable | |
export MINA_PRIVKEY_PASS="testpass" |
Copilot uses AI. Check for mistakes.
dee9780
to
5cc9adb
Compare
d8d4b4e
to
b5b7fa6
Compare
Or explicitly specify devnet: | ||
|
||
```bash | ||
make run-block-producer NETWORK=devnet COINBASE_RECEIVER="YourWalletAddress" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this kind of command, I will add later a script and add in the CI with a timeout 30 ./scripts/foo_bar.sh
.
b5b7fa6
to
076df9c
Compare
I removed the section from CLAUDE.md, it is now in the doc, and CLAUDE should read it to put in its context. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, but please check my comment about 30 seconds timeout (& let's make sure CI passes).
I checked generate-block-producer-key
, didn't run the other targets but they look reasonable from reading the code. I only have some reservations regarding CI role.
run: | | ||
echo "Testing that generated key can be used by run-block-producer target..." | ||
# Run with --help to avoid actually starting the producer but verify key validation passes | ||
timeout 30s make run-block-producer-devnet COINBASE_RECEIVER="test" || { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this make
call not trigger compilation process? If it does then 30 seconds will not be enough. Or do I misunderstand what this job is doing?
On my machine the time to do the following is about 3 minutes:
її> make run-block-producer-devnet COINBASE_RECEIVER="test"
make run-block-producer NETWORK=devnet
make[1]: Entering directory '/home/volhovm/code/openmina'
cargo build --release --package=cli --bin openmina
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/volhovm/code/openmina/ledger/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package: /home/volhovm/code/openmina/tools/fuzzing/Cargo.toml
workspace: /home/volhovm/code/openmina/Cargo.toml
Compiling mina-tree v0.16.0 (/home/volhovm/code/openmina/ledger)
Compiling snark v0.16.0 (/home/volhovm/code/openmina/snark)
Compiling vrf v0.16.0 (/home/volhovm/code/openmina/vrf)
Compiling node v0.16.0 (/home/volhovm/code/openmina/node)
Compiling openmina-node-common v0.16.0 (/home/volhovm/code/openmina/node/common)
Compiling openmina-node-native v0.16.0 (/home/volhovm/code/openmina/node/native)
Compiling cli v0.16.0 (/home/volhovm/code/openmina/cli)
Finished `release` profile [optimized] target(s) in 2m 52s
MINA_PRIVKEY_PASS="" \
cargo run --bin openmina \
--release -- \
node \
--producer-key ./openmina-workdir/producer-key \
--coinbase-receiver test \
\
--libp2p-port 8302 \
--network devnet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's because the code is recompiled because of action_kind.rs being changed. Gotta fix that first. Good point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be better now.
See https://github.com/o1-labs/openmina/actions/runs/16652525657/job/47128853688?pr=1221.
I changed the target definition by relying on build-release
, instead of calling `$(MAKE) build-release in the definition.
Also, thanks to #1276, it should not always recompile the binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW: you can always execute a CI job locally by using act. For instance, you can test locally the doc job using act -j test-doc-commands
.
7651eb3
to
1f1f1d9
Compare
- Add run-block-producer target with devnet/mainnet support - Add generate-block-producer-key target for key generation - Include CI workflow to test documentation commands - Update docs and CLAUDE.md with new target instructions Resolves #1198
1f1f1d9
to
30ab752
Compare
Resolves #1198