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

seal is invalid when using --mining-public-key flag #66

Open
fzeeshan opened this issue Jun 12, 2024 · 7 comments
Open

seal is invalid when using --mining-public-key flag #66

fzeeshan opened this issue Jun 12, 2024 · 7 comments

Comments

@fzeeshan
Copy link

when you run a node with mining key, it gives out the following error "Unable to import mined block: seal is invalid"

@JoshOrndorff
Copy link
Collaborator

This happens when you are mining with an algorithm that is not accepted by your consensus. Try adding --minining-algo md5 to your cli. Then read about that flag and others with --help.

@fzeeshan
Copy link
Author

thank you Josh, seems like the issue was actually with --mining-public-key flag. For example:
./target/release/academy-pow --chain=production.json -d data/production/alice --validator
or
./target/release/academy-pow --chain=production.json -d data/production/alice --validator --mining-algo md5
works, but if I add --mining-public-key=0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d it gives the following message: Unable to import mined block: seal is invalid, i will add md5 for now and remove the key flag. thanks

@JoshOrndorff JoshOrndorff changed the title Unable to import mined block: seal is invalid seal is invalid when using --mining-public-key flag Jun 15, 2024
@JoshOrndorff
Copy link
Collaborator

JoshOrndorff commented Jun 15, 2024

The --mining-public-key flag seems to work for me even with the exact format and key you suggested:

joshy@pop-os:~/ProgrammingProjects/Academy-PoW$ ./target/release/academy-pow --chain local --validator --mining-public-key=0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
2024-06-15 15:28:22 Academy PoW Chain    
2024-06-15 15:28:22 ✌️  version 3.0.0-13b7b621342    
2024-06-15 15:28:22 ❤️  by Anonymous, 2019-2024    
2024-06-15 15:28:22 📋 Chain specification: Testnet    
2024-06-15 15:28:22 🏷  Node name: crabby-pizzas-5456    
2024-06-15 15:28:22 👤 Role: AUTHORITY    
2024-06-15 15:28:22 💾 Database: ParityDb at /home/joshy/.local/share/academy-pow/chains/testnet/paritydb/full    
2024-06-15 15:28:22 Using default protocol ID "sup" because none is configured in the chain specs    
2024-06-15 15:28:22 🏷  Local node identity is: 12D3KooWCknKUFLoDi6CZfSAb9wkvtR87gREpTtaociPS8Th1mea    
2024-06-15 15:28:22 💻 Operating system: linux    
2024-06-15 15:28:22 💻 CPU architecture: x86_64    
2024-06-15 15:28:22 💻 Target environment: gnu    
2024-06-15 15:28:22 💻 Virtual machine: no    
2024-06-15 15:28:22 📦 Highest known block at #0    
2024-06-15 15:28:22 Running JSON-RPC server: addr=127.0.0.1:9944, allowed origins=["http://localhost:*", "http://127.0.0.1:*", "https://localhost:*", "https://127.0.0.1:*", "https://polkadot.js.org"]    
2024-06-15 15:28:22 〽️ Prometheus exporter started at 127.0.0.1:9615    
2024-06-15 15:28:27 💤 Idle (0 peers), best: #0 (0x6b78…068b), finalized #0 (0x6b78…068b), ⬇ 0 ⬆ 0    
2024-06-15 15:28:32 💤 Idle (0 peers), best: #0 (0x6b78…068b), finalized #0 (0x6b78…068b), ⬇ 0 ⬆ 0    
2024-06-15 15:28:32 🙌 Starting consensus session on top of parent 0x6b784297c77d6485a17fb138f249210d8878e607ce841eb1349c3bdb00fd068b    
2024-06-15 15:28:32 🎁 Prepared block for proposing at 1 (1 ms) [hash: 0xab9f54d1ef101ea3c4f4f1efd72a70046b089c16364e1f17b3410049a0133857; parent_hash: 0x6b78…068b; extrinsics (2): [0x255a…adfd, 0xce05…4a3f]    
2024-06-15 15:28:34 ✅ Successfully mined block on top of: 0x6b78…068b    
2024-06-15 15:28:34 🙌 Starting consensus session on top of parent 0xdec5fd0dee41c397d73104329c5a17d639bd36f051d0a4b80113efa84a09f1b9    
2024-06-15 15:28:34 ✨ Imported #1 (0xdec5…f1b9)    
2024-06-15 15:28:34 🎁 Prepared block for proposing at 2 (0 ms) [hash: 0x1caa7dc5ec1480dd2a9f25557464df3cb890072a345a6dec00b6626af3aad5dc; parent_hash: 0xdec5…f1b9; extrinsics (2): [0x29f2…fb00, 0xce05…4a3f] 

Can you past your exact output? And also the content of the chain spec you are using?

@fzeeshan
Copy link
Author

production.json

@fzeeshan
Copy link
Author

I am not sure what I did, I am still seeing the same error (Unable to import mined block: seal is invalid) when I try this: ./target/release/academy-pow --chain local --validator --mining-public-key=0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d
I wonder if if there is something on my system that's causing this issue. I believe I built it using nightly-2024-05-23. I may have to start all over again.

@JoshOrndorff
Copy link
Collaborator

The toolchain should be fine as long as it compiled without error. Do you know what commit of the project you built? Try pulling the latest master and trying again.

IDK how much experience you have with Substrate, but you may have existing chain data interfering. Consider the purge-chain command or running with the --tmp to get a fresh temporary data directory.

@fzeeshan
Copy link
Author

I some what found the solution, I made a copy of this repo couple weeks ago, I think it is two commits behind this one, when I use my copy it works perfectly fine. I believe something changed and caused this repo to break. I am pretty sure anyone trying it out for the first time will encounter same issues. thanks
btw here is my repo: (https:/fzeeshan/Academy-PoW2)
I see there were some changed and sp-keyring = { workspace = true } was added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants