-
Notifications
You must be signed in to change notification settings - Fork 33
docs: Polygon post-Bor reference coverage (eth_getProof note, bor_* + getProof pages, decom dead trace_* pages) #577
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,141 @@ | ||
| { | ||
| "openapi": "3.0.0", | ||
| "info": { | ||
| "title": "eth_getProof example", | ||
| "version": "1.0.0", | ||
| "description": "Get the account and storage values of the specified account including the Merkle proof." | ||
| }, | ||
| "servers": [ | ||
| { | ||
| "url": "https://nd-828-700-214.p2pify.com" | ||
| } | ||
| ], | ||
| "paths": { | ||
| "/a9bca2f0f84b54086ceebe590316fff3": { | ||
| "post": { | ||
| "tags": [ | ||
| "Ethereum Operations" | ||
| ], | ||
| "summary": "eth_getProof", | ||
| "operationId": "eth_getProof", | ||
|
Comment on lines
+15
to
+20
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win Document Bor’s proof-retention limit in the OpenAPI operation. The standalone contract does not disclose that proofs are available only for roughly the latest 128 blocks, while 🤖 Prompt for AI Agents |
||
| "requestBody": { | ||
| "required": true, | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "required": [ | ||
| "jsonrpc", | ||
| "method", | ||
| "id", | ||
| "params" | ||
| ], | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string", | ||
| "default": "2.0" | ||
| }, | ||
| "method": { | ||
| "type": "string", | ||
| "default": "eth_getProof" | ||
| }, | ||
| "id": { | ||
| "type": "integer", | ||
| "default": 1 | ||
| }, | ||
| "params": { | ||
| "type": "array", | ||
| "default": [ | ||
| "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270", | ||
| [], | ||
| "latest" | ||
| ], | ||
| "items": { | ||
| "oneOf": [ | ||
| { | ||
| "type": "string" | ||
| }, | ||
| { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "Result", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string" | ||
| }, | ||
| "id": { | ||
| "type": "integer" | ||
| }, | ||
| "result": { | ||
| "type": "object", | ||
| "properties": { | ||
| "address": { | ||
| "type": "string" | ||
| }, | ||
| "accountProof": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "balance": { | ||
| "type": "string" | ||
| }, | ||
| "codeHash": { | ||
| "type": "string" | ||
| }, | ||
| "nonce": { | ||
| "type": "string" | ||
| }, | ||
| "storageHash": { | ||
| "type": "string" | ||
| }, | ||
| "storageProof": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "object", | ||
| "properties": { | ||
| "key": { | ||
| "type": "string" | ||
| }, | ||
| "value": { | ||
| "type": "string" | ||
| }, | ||
| "proof": { | ||
| "type": "array", | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| { | ||
| "openapi": "3.0.0", | ||
| "info": { | ||
| "title": "bor_getAuthor example", | ||
| "version": "1.0.0", | ||
| "description": "Get the address that produced (signed) a given block." | ||
| }, | ||
| "servers": [ | ||
| { | ||
| "url": "https://nd-828-700-214.p2pify.com" | ||
| } | ||
| ], | ||
| "paths": { | ||
| "/a9bca2f0f84b54086ceebe590316fff3": { | ||
| "post": { | ||
| "tags": [ | ||
| "Ethereum Operations" | ||
| ], | ||
|
Comment on lines
+16
to
+18
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Files in openapi/polygon_node_api/bor:"
git ls-files 'openapi/polygon_node_api/bor/*.json' | sort
echo
echo "Tag lines for Bor operation files:"
python3 - <<'PY'
import json, pathlib
root = pathlib.Path('openapi/polygon_node_api/bor')
for p in sorted(root.glob('*.json')):
try:
data = json.loads(p.read_text())
except Exception as e:
print(f"{p}: parse error {e}")
continue
if "tags" in data:
for line_no in range(1, min(len(p.read_text().splitlines()), 40)+1):
if '"tags"' in p.read_text().splitlines()[line_no-1]:
pass
print(f"{p}: tags={data.get('tags')}")
PY
echo
echo "OpenAPI tag definitions across polygon_node_api / openapi (if present):"
rg -n '"tags":|^- name:|tags:' openapi -g '*.json' -g '*.yaml' -g '*.yml' | head -200Repository: chainstack/dev-portal Length of output: 16534 🏁 Script executed: #!/bin/bash
set -euo pipefail
echo "Search for specific current tag in Bor files and broader occurrences:"
rg -n '"Ethereum Operations"|tags|name:' openapi/polygon_node_api/bor openapi/polygon* eth ethereum -g '*.json' -g '*.yaml' -g '*.yml' 2>/dev/null | head -50 || true
echo
echo "One Bor file top block:"
cat -n openapi/polygon_node_api/bor/bor_getAuthor.json | sed -n '1,80p'
echo
echo "Count exact current tag in repo JSON:"
rg -n '"Ethereum Operations"' -g '*.json' . | wc -lRepository: chainstack/dev-portal Length of output: 7249 Use a Bor-native tag for Polygon Bor operations. These Bor methods are currently grouped under 📍 Affects 5 files
🤖 Prompt for AI AgentsSource: MCP tools |
||
| "summary": "bor_getAuthor", | ||
| "operationId": "bor_getAuthor", | ||
| "requestBody": { | ||
| "required": true, | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "required": [ | ||
| "jsonrpc", | ||
| "method", | ||
| "id", | ||
| "params" | ||
| ], | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string", | ||
| "default": "2.0" | ||
| }, | ||
| "method": { | ||
| "type": "string", | ||
| "default": "bor_getAuthor" | ||
| }, | ||
| "id": { | ||
| "type": "integer", | ||
| "default": 1 | ||
| }, | ||
| "params": { | ||
| "type": "array", | ||
| "default": [ | ||
| "0x561294b" | ||
| ], | ||
| "items": { | ||
| "type": "string" | ||
| } | ||
| } | ||
|
Comment on lines
+46
to
+54
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Files matching bor RPC OpenAPI params:\n'
git ls-files 'openapi/polygon_node_api/bor/*.json' | sort
printf '\nOpenAPI param snippets:\n'
for f in $(git ls-files 'openapi/polygon_node_api/bor/*.json' | sort); do
echo "--- $f"
rg -n -C 3 '"params"' "$f" || true
done
printf '\nReference docs matching bor rpc parameter sections:\n'
git ls-files 'reference/*bor*.mdx' 'reference/polygon-bor*.mdx' | sort | sed -n '1,80p'Repository: chainstack/dev-portal Length of output: 3654 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import json, pathlib, re
base = pathlib.Path("openapi/polygon_node_api/bor")
docs = {
"reference/polygon-borgetauthor.mdx": "GET_AUTHOR",
"reference/polygon-borgetcurrentproposer.mdx": "GET_CURRENT_PROPOSER",
"reference/polygon-borgetcurrentvalidators.mdx": "GET_CURRENT_VALIDATORS",
"reference/polygon-borgetroothash.mdx": "GET_ROOT_HASH",
"reference/polygon-borgetsignersathash.mdx": "GET_SIGNERS_AT_HASH",
}
patterns = {
"GET_AUTHOR": [re.compile(r"params:\s*.block.*\n\s*type:\s*string", re.S)],
"GET_CURRENT_PROPOSER": [re.compile(r"params:\s*—\n.*blocks\s*.*\n\s*type:\s*array", re.S), re.compile(r"params:\s*—\n", re.S)],
"GET_CURRENT_VALIDATORS": [re.compile(r"params:\s*—\n.*blocks\s*.*\n\s*type:\s*array", re.S), re.compile(r"params:\s*—\n", re.S)],
"GET_ROOT_HASH": [re.compile(r"params:\s*•.*fromIndex\s*\n.*integer", re.S), re.compile(r"params:\s*•.*toIndex\s*\n.*integer", re.S)],
"GET_SIGNERS_AT_HASH": [re.compile(r"params:\s*•.*block.*hash.*\n\s*type:\s*string", re.S)],
}
for json_path in sorted(base.glob("*.json")):
data = json.loads(json_path.read_text())
params = data["components"]["schemas"]["RequestBody"]["properties"]["params"]
# Extract constraints only present
constraints = {}
for k in ("type","minItems","maxItems","enum","items"):
if k in params:
constraints[k] = params[k]
name = json_path.stem
print(f"{json_path}: {constraints}")
print("\nReference doc param-count evidence:")
for doc_path, key in docs.items():
text = pathlib.Path(doc_path).read_text(errors="replace")
print(f"\n--- {doc_path}")
count = 0
# Show context around "params" heading for no-parameter docs
if "GET_CURRENT_PROPOSER" in key or "GET_CURRENT_VALIDATORS" in key:
# look for methods table params section by counting param rows if available
for m in re.finditer(r"(Get Current Proposer|Get Current Validators)", text):
start=max(0,m.start()-200); end=min(len(text), m.start()+1600)
sec=text[start:end]; print(sec[:2200])
rows=sec.count("- `blocks`")
print("blocks rows:", rows)
else:
for m in re.finditer(r"^\s*####\s*Params", text, re.M):
sec=text[m.start():]
# count explicit params starting with leading bullets/dashes/numbers
rows = re.findall(r"^[\s]*(?:•|-|\d+)\s", sec.splitlines(True)[1:12], re.M)
print(sec[:2200])
print("rows:", rows)
break
PYRepository: chainstack/dev-portal Length of output: 256 🏁 Script executed: #!/bin/bash
set -euo pipefail
python3 - <<'PY'
import json, pathlib, re
for json_path in sorted(pathlib.Path("openapi/polygon_node_api/bor").glob("*.json")):
data = json.loads(json_path.read_text())
def walk(obj, path=""):
if isinstance(obj, dict):
if obj.get("type") == "array" and "params" in path:
print(f"{json_path}:{path}")
for k in ("type","minItems","maxItems","enum","items"):
if k in obj:
print(" ", k, ":", obj[k])
for k,v in obj.items():
walk(v, f"{path}.{k}")
elif isinstance(obj, list):
for i,v in enumerate(obj):
walk(v, f"{path}[{i}]")
walk(data)
PY
printf '\nDocument params sections for no-param methods:\n'
for f in reference/polygon-borgetcurrentproposer.mdx reference/polygon-borgetcurrentvalidators.mdx; do
echo "--- $f"
sed -n '1,220p' "$f" | rg -C 8 'Params|`params`|blocks|type:' || true
done
printf '\nDocument params sections for single/two-param methods:\n'
for f in reference/polygon-borgetauthor.mdx reference/polygon-borgetroothash.mdx reference/polygon-borgetsignersathash.mdx; do
echo "--- $f"
sed -n '1,240p' "$f" | rg -C 6 'Params|`params`|block hash|fromIndex|toIndex|type:' || true
done
echo 'json:'
python3 - <<'PY'
import json, pathlib, re
for json_path in sorted(pathlib.Path("openapi/polygon_node_api/bor").glob("*.json")):
data = json.loads(json_path.read_text())
print(json_path.name, json.dumps(data.get("params") or data.get("requestBody", {}).get("content", {}).get("application/json", {}).get("schema", {}), indent=2))
PYRepository: chainstack/dev-portal Length of output: 2939 Enforce exact Bor RPC parameter counts. These schemas currently only declare
📍 Affects 5 files
🤖 Prompt for AI Agents |
||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "Result", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string" | ||
| }, | ||
| "id": { | ||
| "type": "integer" | ||
| }, | ||
| "result": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| { | ||
| "openapi": "3.0.0", | ||
| "info": { | ||
| "title": "bor_getCurrentProposer example", | ||
| "version": "1.0.0", | ||
| "description": "Get the address of the current block proposer." | ||
| }, | ||
| "servers": [ | ||
| { | ||
| "url": "https://nd-828-700-214.p2pify.com" | ||
| } | ||
| ], | ||
| "paths": { | ||
| "/a9bca2f0f84b54086ceebe590316fff3": { | ||
| "post": { | ||
| "tags": [ | ||
| "Ethereum Operations" | ||
| ], | ||
| "summary": "bor_getCurrentProposer", | ||
| "operationId": "bor_getCurrentProposer", | ||
| "requestBody": { | ||
| "required": true, | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "required": [ | ||
| "jsonrpc", | ||
| "method", | ||
| "id", | ||
| "params" | ||
| ], | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string", | ||
| "default": "2.0" | ||
| }, | ||
| "method": { | ||
| "type": "string", | ||
| "default": "bor_getCurrentProposer" | ||
| }, | ||
| "id": { | ||
| "type": "integer", | ||
| "default": 1 | ||
| }, | ||
| "params": { | ||
| "type": "array", | ||
| "default": [] | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "description": "Result", | ||
| "content": { | ||
| "application/json": { | ||
| "schema": { | ||
| "type": "object", | ||
| "properties": { | ||
| "jsonrpc": { | ||
| "type": "string" | ||
| }, | ||
| "id": { | ||
| "type": "integer" | ||
| }, | ||
| "result": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
Remove and rotate the exposed endpoint credential.
This publishes a concrete node URL and opaque access path in a public OpenAPI document. Revoke/rotate it, then use the repository’s endpoint injection mechanism or placeholders such as
YOUR_API_KEY.As per coding guidelines, public content must “never include secrets, internal infrastructure details,” and must use placeholders for secrets.
🤖 Prompt for AI Agents
Source: Coding guidelines