Commit c9ca754
committed
S3-E.3-followup: hedera_dual 真实证 + adapter 单测 + KNOWN_BROKEN_MIXED 立 ledger
## 背景:用户反向压测发现 S3-E.3 (commit 2d007f2) 验证不足
前一 commit msg 说 "L3 PASS = 双协议路由生效",**但**:
- L3 只验 vegeta target schema 生成成功(exit=0)
- 从未真打 HTTP 验返码
- 新 adapter 0 个专属单测,只靠 cli e2e 偶然碰
- body 里 `params: ['0.0.801']` 缺 'latest' + 用 3-part ID,我看到了却写成 "已知 defer" 而未承认是当前 commit 的真实生产 blocker
## 真实证(C1 — 真打 endpoint)
curl POST https://mainnet.hashio.io/api -d \
'{"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0.0.801"]}'
→ HTTP 400 {"error":{"code":-32602,"message":"Invalid parameter 0:
Expected 0x prefixed string representing the address (20 bytes),
value: 0.0.801"}}
正确 payload 真返 balance:
curl POST ... -d '{"...","params":["0x0000000000000000000000000000000000000002","latest"]}'
→ HTTP 200 {"result":"0xdc190f51555e27b8e0800","jsonrpc":"2.0","id":1}
Mirror REST 真返 evm_address 字段:
curl https://mainnet-public.mirrornode.hedera.com/api/v1/accounts/0.0.2
→ {"account":"0.0.2","evm_address":"0x0000000000000000000000000000000000000002",
"balance":{"balance":1663012637744658}}
eth_blockNumber 纯活性:HTTP 200 result=0x5b10a68 ✓
## adapter 专属单测(C2/C3 — test_11, test_12)
(1) test_hedera_dual_adapter_routing —
- REST method 'GET /api/v1/accounts/{addr}' → GET Mirror URL,address 入 path
- eth_blockNumber → POST Hashio URL,empty params
- eth_getBalance + param_format='address_latest' → POST Hashio,
params=[addr, 'latest'](adapter 自身给得对!)
- 缺 _meta.json_rpc_url → ValueError
- 缺 BLOCKCHAIN_NODE → RuntimeError
(2) test_is_jsonrpc_method_regex —
- 7 个 JSON-RPC namespace(eth_/net_/web3_/debug_/trace_)正路由
- REST path / camelCase / 前缀干扰("ethReporter") 全否路由
L1 现 12/12 PASS(原 10 + 新 2)
## 关键发现:adapter 本身 OK,生产 mixed 失败在上游
test_11 证明 adapter 给 [addr, 'latest'] 正确 — 当 cli.py 传对 param_format。
但生产链路有两个上游 bug:
PARAM cli.py L40 `tpl.get("params", {})` 读 fetcher config,应读
`tpl.get("param_formats", {})`。adapter 收 param_format=""
→ JsonRpcAdapter `_build_params("")` → 默认 [] → 缺 'latest'。
影响所有 JSON-RPC chain 的 eth_* 调用。Fix wave: cli-param-bug
ADDR_FMT fetch_active_accounts.py 不支持 hedera,只能吐 3-part 0.0.N。
Mirror REST 接受(path 用原 ID),JSON-RPC Relay 要 0x 前缀
20-byte hex。Mirror /accounts/{id} 返 evm_address 字段可用,
但 fetcher 没接。Fix wave: S4(per-chain account fetcher)
## 诚实 ledger
(1) tests/test_chain_adapters.py 加 KNOWN_BROKEN_MIXED dict:
{hedera: ("PARAM+ADDR_FMT", "cli-param-bug + S4", evidence)}
不强制 assert,因为没有 mixed-path 自动测;留位给未来 wave。
(2) config/chains/hedera.json _meta 加 known_broken_mixed 字段:
status: ADAPTER_OK_BUT_UPSTREAM_BROKEN
evidence_date: 2026-05-24
live_http_test: 上述 curl 命令 + HTTP 400 实证
blockers: 上述 PARAM / ADDR_FMT 两条
## 校正前一 commit 的过度声明
commit 2d007f2 该说:
"hedera_dual adapter 已实现并通过 L1 schema 验证;mixed 真生产链路
阻于 cli.py PARAM bug 和 fetcher ADDR_FMT 缺失,见 KNOWN_BROKEN_MIXED。"
而不是:
"L3 PASS → 双协议路由生效"(暗示生产可跑,实际不可)
adapter 本身的工作不撤回(test_11 实证 routing 正确),但 hedera 不能
算 "broken set 14→13",该算 "broken_cli 14→13 + broken_mixed 0→1"。
## 自审 E1-E5(本 commit)
E1 调研:回头验 docs/zh/chains/14-hedera.md E1-E15 + 现场 curl
E2 无降级:不撤 adapter / 不砍 method;承认 mixed 阻于上游,显式 ledger
E3 实证:真打 4 个 HTTP request 各拿返码 / 12/12 单测 PASS
E4 parallel-entry-trap:无
E5 ledger 单调:KNOWN_BROKEN_CLI 仍 13(hedera CLI 路径 single 健康);
新建 KNOWN_BROKEN_MIXED = 1(hedera)— 这是新分类,
不算 CLI ledger 增长1 parent 2d007f2 commit c9ca754
2 files changed
Lines changed: 144 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
61 | 71 | | |
62 | 72 | | |
63 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
373 | 401 | | |
374 | 402 | | |
375 | 403 | | |
| |||
477 | 505 | | |
478 | 506 | | |
479 | 507 | | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
480 | 612 | | |
481 | 613 | | |
482 | 614 | | |
| |||
492 | 624 | | |
493 | 625 | | |
494 | 626 | | |
| 627 | + | |
| 628 | + | |
495 | 629 | | |
496 | 630 | | |
497 | 631 | | |
| |||
0 commit comments