[BUG]: Handle JSON-RPC notifications and empty batches correctly
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- python
调研方向
从minichain/rpc.py开始,追踪请求如何被分派以及响应如何组装。检查现有的RPC请求和批处理测试,然后添加对通知、批处理中包含通知以及空批处理的测试。完成标准是通知不产生响应,空批处理返回一个-32600 Invalid Request错误,并且现有RPC测试通过。
由索引模型根据 Issue 内容生成。
描述
Bug Description
Description
I noticed two JSON-RPC 2.0 compliance issues in MiniChain's RPC request handling.
Currently, requests without an id receive a response with "id": null, even though JSON-RPC notifications should not receive any response. Also, sending an empty batch ([]) returns an empty array instead of an Invalid Request error.
Steps to Reproduce
1. Notification handling
Send the following request:
{
"jsonrpc": "2.0",
"method": "mc_blockNumber"
}
Observe that the server returns a JSON-RPC response even though the request is a notification.
2. Empty batch handling
Send an empty batch:
[]
Observe that the server returns an empty array instead of an error response.
Expected Behavior
- Valid notification requests should be processed without returning a JSON-RPC response.
- An empty batch should return a single error response with code
-32600and messageInvalid Request.
Actual Behavior
- Notifications currently receive a response with
"id": null. - Empty batches currently return
[].
Proposed Fix
Update the request-handling logic in minichain/rpc.py to follow JSON-RPC 2.0 notification and batch-processing requirements.
Testing
- Test valid notification requests.
- Test notifications inside a batch.
- Test empty batch requests.
- Ensure existing RPC request and batch tests continue to pass.
Steps to Reproduce
No response
Logs and Screenshots
No response
Environment Details
No response
Impact
Medium
Code of Conduct
- I have joined the Discord server and will post updates there
- I have searched existing issues to avoid duplicates
- 主要语言
- Python
- 星标
- 12
- 派生
- 27
- 平均合并
- 2 分钟
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
StabilityNexus/MiniChain 的其他 Issue
-
automatic-copyright-year: keep README copyright current可能已有人在做 @anshulchikhale30-p 于 7 天前认领。 未关闭documentation enhancement
难度 3/5 半天 新手友好度 35/100
StabilityNexus/MiniChain#189 ·
维护者通常 1 天内回复
-
Difficulty: bound per-block EMA moves, add a difficulty floor, and preserve state across restarts可能已有人在做 @anshulchikhale30-p 于 7 天前认领。 未关闭bug documentation enhancement
难度 4/5 3-5 天 新手友好度 25/100
StabilityNexus/MiniChain#187 ·
维护者通常 1 天内回复
-
[BUG]: Blocks on a different parent are classified INVALID and get the sender banned可能已有人在做 @kansalakshat 于 7 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 35/100
StabilityNexus/MiniChain#185 ·
维护者通常 1 天内回复
-
[BUG]: P2P sync downloads full 500-block chunks without headers-first validation可能已有人在做 @anshulchikhale30-p 于 14 天前认领。 未关闭bug documentation enhancement
难度 5/5 一周以上 新手友好度 25/100
StabilityNexus/MiniChain#178 ·
维护者通常 1 天内回复
-
[FEATURE]: Add transaction and receipt lookup RPC methods可能已有人在做 @Thushara3005 于 10 天前认领。 未关闭enhancement
难度 4/5 3-5 天 新手友好度 58/100
StabilityNexus/MiniChain#176 ·
维护者通常 1 天内回复
查看 StabilityNexus/MiniChain 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
huggingface/datasets#9128 ·
维护者通常 1 天内回复
-
priority:low ready-for-dev
难度 2/5 1-3 小时 新手友好度 68/100
OpenHands/extensions#975 ·
维护者通常 1 天内回复
-
Function/dict state handlers can't supply provider-state injected values (`generate.provider_state`)未关闭
难度 2/5 1-3 小时 新手友好度 78/100
pact-foundation/pact-python#1789 ·
维护者通常 9 天内回复
-
documentation
难度 2/5 1-3 小时 新手友好度 82/100
juandresrodca/AdminForge#66 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复