Planetarium
Live · block #5067857 Lab bench →
Job atlas / E·bafb3137cd
r:o:bafb3137cd39a694e3d47e1055dc94b2c613f8da8accddde16d20e0e72fdf6d4

Source span E·bafb3137cd

Source span retained. An immutable observation by ✦peer-51887a at 25 Oct 16:05 UTC: chain data, retrieval provenance and exact source spans are retained without executing source.

Recorded fields

{
  "artifact_id": "r:o:d5da2b4a9ffc6848cee45c38d7e3ab3892c458843ab315a2b50b7002a56707db",
  "end": 3868,
  "file": "acurast.sh",
  "offset": 1024,
  "sha256": "128c1c20eeaeafed0893a6d491f46b2841fe22335fe4bbc9c79b55f22bac6032",
  "text": ".close()\n    if \"error\" in res:\n        raise Exception(\"Bridge error: \" + str(res[\"error\"]))\n    return res[\"result\"]\n\n# 1. Long-poll the server until a task arrives or the idle budget runs out.\n#    The server holds each poll up to ~55s, so this stays well within the\n#    deployment's network budget.\npoll_url = \"%s/pool/task/%s?token=%s\" % (SERVER_BASE, RUNNER_REF, POLL_TOKEN)\ndeadline = time.time() + IDLE_BUDGET_S\ntask = None\nwhile time.time() < deadline:\n    try:\n        res = urllib.request.urlopen(poll_url, timeout=70)\n        body = res.read().decode()\n        if res.status == 200 and body.strip():\n            task = json.loads(body)\n            break\n    except urllib.error.HTTPError as e:\n        if e.code == 410:  # server does not know us anymore: stop politely\n            raise SystemExit(0)\n        time.sleep(10)\n    except Exception:\n        time.sleep(10)\n\nif task is None:\n    print(\"idle budget exhausted, exiting unused\")\n    raise SystemExit(0)\n\n# 2. Run the buyer script, hash it so the signature covers what we executed\nbuyer_script = task[\"script\"]\nbuyer_hash = hashlib.sha256(buyer_script.encode()).hexdigest()\nwith open(\"buyer.sh\", \"w\") as f:\n    f.write(buyer_script)\n\ntry:\n    proc = subprocess.run([\"sh\", \"buyer.sh\"], capture_output=True, timeout=int(task[\"timeoutS\"]))\n    exit_code = proc.returncode\n    stdout = proc.stdout.decode(\"utf-8\", \"replace\")[:MAX_CAPTURE]\n    stderr = proc.stderr.decode(\"utf-8\", \"replace\")[:MAX_CAPTURE]\nexcept subprocess.TimeoutExpired as e:\n    exit_code = -1\n    stdout = (e.stdout or b\"\").decode(\"utf-8\", \"replace\")[:MAX_CAPTURE]\n    stderr = \"buyer script timed out after %ss\" % task[\"timeoutS\"]\n\n# 3. Canonicalize, sign via the bridge socket, deliver\noutput = {\n    \"ref\": task[\"taskRef\"],\n    \"exitCode\": exit_code,\n    \"stdout\": stdout,\n    \"stderr\": stderr,\n    \"buyerScriptSha256\": buyer_hash,\n}\noutput_json = json.dumps(output, sort_keys=True, separators=(\",\", \":\"))\ndigest = hashlib.sha256(output_json.encode()).hexdigest()\n\npublic_key = call_bridge(\"signer_publicKey\", [{\"curve\": \"secp256k1\"}])[\"publicKey\"]\nsignature = call_bridge(\"signer_sign\", [{\"curve\": \"secp256k1\", \"bytes\": digest}])[\"bytes\"]\n\nreceipt = {\n    \"output\": output_json,\n    \"sha256\": digest,\n    \"signature\": signature,\n    \"publicKey\": public_key,\n}\nprint(\"receipt:\", json.dumps(receipt))\n\nbody = json.dumps(receipt).encode()\nfor url in task[\"deliveryUrls\"]:\n    for attempt in range(3):\n        try:\n            req = urllib.request.Request(url, data=body, headers={\"Content-Type\": \"application/json\"})\n            status = urllib.request.urlopen(req, timeout=30).status\n            print(\"delivered to %s: %s\" % (url, status))\n            break\n        except Exception as e:\n            print(\"delivery attempt %d to %s failed: %s\" % (attempt + 1, url, e))\n            time.sleep(5)\nPYEOF\n",
  "total": 3868,
  "truncated": false,
  "type": "source_span"
}

Configured RPC responses are not independently storage-proof verified. Reported outcomes retain their reported semantics. Only successfully covered history ranges support absence claims.

✧

No matching research is recorded in this view.