Skip to content

Add on_chain.request so ERC-8183 jobs reach the right endpoint - #1

Open
PugarHuda wants to merge 1 commit into
shreshth006:mainfrom
PugarHuda:add-on-chain-request
Open

PugarHuda wants to merge 1 commit into
shreshth006:mainfrom
PugarHuda:add-on-chain-request

Conversation

@PugarHuda

Copy link
Copy Markdown

Hi. I run the amanat-weather-risk miner and a storm contract on Base Sepolia. Chasing why my contract's on-chain jobs kept coming back unanswerable, I audited every public registration YAML on the network. This one has the same one-block gap as most of the others, so here is the fix rather than just the finding.

What happens today

ERC-8183 jobs are routed by rank, and nothing in that path checks whether the miner it lands on declares an on_chain.request mapping. Without one the node cannot turn the job's OnChainData arrays into an HTTP call, so it falls back to the first endpoint in the file with no parameters. Preflight serves ten intents and /ssl-check is first, so a job for any of them arrives there with no domain.

Nothing is wrong with the miner. It answers correctly over HTTP and through the Engine, and the tolerant input handling in your input_schema is better than most. The node just cannot address it from a job.

What this PR adds

One on_chain block. Nothing else changes.

verdict, reason, confidence and risk_score are taken from this file's own output_schema, and domain, url, cve_query, address, hash, chain and asset from its own input_schema, following the "Used by /x" notes there. The block shape is copied from the protocol's example miner at telegraphprotocol/telegraph-examples, which uses query_params for GET.

I mapped six endpoints rather than all twelve, on the reasoning that the rest follow the same pattern and you will want to choose which ones matter. The file parses, and the audit I use flips it from closed to job-able.

Two things only you can confirm

  1. Which array index your callers use. There is no published protocol-wide convention for what an OnChainData payload carries per intent, so strings.0 is the natural first slot rather than a standard one.
  2. Whether the node picks from a multi-entry request list by intent. The protocol's example declares one endpoint, so the list form is inferred from it being a list. If it turns out to be one entry per registration, keep ssl-check and drop the rest.

Adjust or reject freely.

curl -s 'https://amanat-miner.vercel.app/api/jobable?intent=SSL_VERIFICATION' reports this per intent across the network. Write-up with the job ids is at https://github.com/PugarHuda/amanat/blob/main/docs/bug-report.md

🤖 Generated with Claude Code

https://claude.ai/code/session_01WRCg2ptKhTh362DukmeBCn

Without an on_chain.request mapping the node cannot turn a job's OnChainData
into an HTTP call, so it falls back to the first endpoint with no parameters.
Every field name and query parameter is taken from this file's own
output_schema and input_schema.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WRCg2ptKhTh362DukmeBCn
@vercel

vercel Bot commented Sep 7, 2026

Copy link
Copy Markdown

@PugarHuda is attempting to deploy a commit to the shreshthmishra333-9362's projects Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant