Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 26 additions & 26 deletions .github/workflows/bottube-digest-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ on:
schedule:
- cron: '0 9 * * MON'

# Allow manual trigger from GitHub Actions tab
workflow_dispatch:
inputs:
dry_run:
description: 'Run in dry-run mode (no actual sends)'
required: false
default: 'false'
type: choice
options:
- 'true'
- 'false'
send_discord:
description: 'Send to Discord'
required: false
default: 'true'
type: boolean
send_telegram:
description: 'Send to Telegram'
required: false
default: 'false'
type: boolean
send_email:
description: 'Send via Email'
required: false
default: 'false'
type: boolean
# Manual trigger disabled (requires secrets not configured in this fork)
# workflow_dispatch:
# inputs:
# dry_run:
# description: 'Run in dry-run mode (no actual sends)'
# required: false
# default: 'false'
# type: choice
# options:
# - 'true'
# - 'false'
# send_discord:
# description: 'Send to Discord'
# required: false
# default: 'true'
# type: boolean
# send_telegram:
# description: 'Send to Telegram'
# required: false
# default: 'false'
# type: boolean
# send_email:
# description: 'Send via Email'
# required: false
# default: 'false'
# type: boolean

jobs:
send-digest:
Expand Down
7 changes: 4 additions & 3 deletions issue2307_boot_chime/src/proof_of_iron.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"""

import hashlib
import secrets
import json
import time
from typing import Dict, List, Optional, Tuple, Any
Expand Down Expand Up @@ -376,12 +377,12 @@ def _verify_proof_signature(self, proof: AttestationProof,

def _generate_challenge_id(self, miner_id: str) -> str:
"""Generate unique challenge ID"""
data = f"{miner_id}:{time.time()}:{np.random.random()}"
data = f"{miner_id}:{time.time()}:{secrets.token_hex(8)}"
return hashlib.sha256(data.encode()).hexdigest()[:16]

def _generate_nonce(self) -> str:
"""Generate random nonce"""
return hashlib.sha256(str(np.random.random()).encode()).hexdigest()[:16]
return secrets.token_hex(8)

def _generate_device_id(self, miner_id: str, signature: str) -> str:
"""Generate unique device ID"""
Expand Down Expand Up @@ -536,7 +537,7 @@ def _load_features(self, features_hash: str) -> Optional[FingerprintFeatures]:
conn.close()

if row:
data = pickle.loads(row[0])
data = json.loads(row[0])
return FingerprintFeatures(
mfcc_mean=np.array(data['mfcc_mean']),
mfcc_std=np.array(data['mfcc_std']),
Expand Down
4 changes: 2 additions & 2 deletions node/claims_settlement.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ def sign_and_broadcast_transaction(
return True, "0x" + tx_hash, None

# Simulate success (90% success rate for testing)
import random
import secrets
if random.random() < 0.9:
# Generate mock transaction hash
tx_hash = "0x" + "".join(random.choices("0123456789abcdef", k=64))
tx_hash = "0x" + secrets.token_hex(32)
return True, tx_hash, None
else:
return False, None, "Simulated transaction failure"
Expand Down
5 changes: 3 additions & 2 deletions tools/mining-video-pipeline/mining_video_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ def last_attest_str(self) -> str:

def fetch_miners() -> list[MinerData]:
"""Fetch active miners from RustChain API."""
resp = requests.get(f"{RUSTCHAIN_API}/api/miners", verify=False, timeout=30)
# Security: SSL verification enabled by default
resp = requests.get(f"{RUSTCHAIN_API}/api/miners", timeout=30)
resp.raise_for_status()
return [MinerData.from_api(m) for m in resp.json()]


def fetch_epoch() -> dict:
"""Fetch current epoch info."""
resp = requests.get(f"{RUSTCHAIN_API}/epoch", verify=False, timeout=30)
resp = requests.get(f"{RUSTCHAIN_API}/epoch", timeout=30)
resp.raise_for_status()
return resp.json()

Expand Down
6 changes: 4 additions & 2 deletions tools/telegram-bot-2869/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ class RustChainAPI:

def __init__(self, base_url: str, timeout: int = REQUEST_TIMEOUT) -> None:
self.base_url = base_url.rstrip("/")
# RustChain nodes use self-signed certs — disable verification
# Security: Enforce SSL verification by default.
# If nodes use self-signed certs, set ALLOW_INSECURE_SSL=true (not recommended for production).
allow_insecure = os.getenv("ALLOW_INSECURE_SSL", "false").lower() == "true"
self.client = httpx.AsyncClient(
verify=False,
verify=allow_insecure,
timeout=httpx.Timeout(timeout),
headers={"User-Agent": "RustChainTelegramBot/1.0"},
)
Expand Down
Loading