-
Notifications
You must be signed in to change notification settings - Fork 0
Genesis Block TODO
Code written: β
Yes
Compiles: β
Yes
Enabled: β No (disabled due to startup crash)
Priority: π΄ HIGH (critical for bootstrap)
β
Deterministic key generation (GenerateGenesisKey)
β
Genesis user creation (CreateGenesisSeedUsers)
β
50 seed users (5 currencies Γ 10 users)
β
USER_VERIFY transactions with proper signatures
Symptom: Node segfaults (exit code 139) on startup when genesis seed users are enabled
Location: During genesis block creation or validation
Probable Causes:
-
Hash()function not safe to call at genesis creation time - O transaction validation runs before databases initialized
- Missing null checks in
CUserVerificationData::ToScript() - Genesis block merkle root calculation with O transactions
static std::vector<CMutableTransaction> CreateGenesisSeedUsers() {
try {
// ... seed user creation ...
return seed_txs;
} catch (const std::exception& e) {
LogPrintf("ERROR: CreateGenesisSeedUsers failed: %s\n", e.what());
return std::vector<CMutableTransaction>(); // Return empty on error
}
}// Instead of 50 users, test with just 1
for (int i = 0; i < 1; i++) { // Only 1 user instead of 10
// ...
}// In validation.cpp
if (pindex->nHeight > 0) { // Skip genesis block
OConsensus::ProcessOTransactions(block, pindex);
}Instead of genesis block, add users at block 1:
// In miner.cpp CreateNewBlock()
if (nHeight == 1) {
auto seed_users = CreateGenesisSeedUsers();
for (const auto& seed_tx : seed_users) {
pblock->vtx.push_back(MakeTransactionRef(seed_tx));
}
}Until genesis seeds work, use manual seeding:
# Admin creates seed users for major currencies
bitcoin-cli creategenesisusers USD 10
bitcoin-cli creategenesisusers EUR 10
bitcoin-cli creategenesisusers JPY 10
bitcoin-cli creategenesisusers GBP 10
bitcoin-cli creategenesisusers CNY 10
# Mine block to include them
bitcoin-cli generatetoaddress 1 [address]
# Check readiness
bitcoin-cli getmeasurementreadinessstatistics# bitcoin.conf
genesis-seed-users=USD:10,EUR:10,JPY:10,GBP:10,CNY:10
#!/usr/bin/env python3
# seed_genesis.py
for currency in ["USD", "EUR", "JPY", "GBP", "CNY"]:
for i in range(10):
# Generate deterministic key
key = generate_genesis_key(currency, i)
# Create USER_VERIFY transaction
rpc.submituserverificationtx(...)For immediate testing and deployment:
Use Bootstrap Threshold Only (No Genesis Users)
Block 0: 0 users
Admin manually creates 10 users per currency via RPC
Block 1-10: Users registered
Block 10: Check readiness β 10 users >= 10 (bootstrap) β
READY
Block 10: Create invitations
Block 11+: System operational
Pros:
- β Works immediately
- β No genesis block changes
- β No crash risk
Cons:
β οΈ Requires manual interventionβ οΈ Not automaticβ οΈ Admin must seed each network
Impact: π΄ HIGH
Why critical:
- Without genesis seeds OR manual seeding, system cannot start
- Requires admin intervention for every deployment
- Not user-friendly
Why not blocking:
- Bootstrap threshold works (10-user minimum)
- Manual seeding is viable workaround
- Can deploy and seed manually
- Add error handling
- Find crash cause
- Fix and re-enable
- Add seed users at block 1 instead of genesis
- Avoids genesis complexity
- Still automatic
- Create
seedgenesisusersRPC command - Admin seeds when deploying
- Simple and reliable
Decision needed: Which approach to pursue?
Β© O International
A Nonprofit Association Focused on the Creation of a Water Price-Based Stable Coin
Association de Loi 1901 β France NumΓ©ro de Siret (French SIREN): 924 014 467 00014