Release v4.0.0: SWQoS transport improvements and Binary-Tx response handling

Major changes:
- Switch BlockRazor default transport from gRPC to HTTP to avoid FRAME_SIZE_ERROR
  - gRPC mode still available via explicit SwqosTransport configuration
- Fix ZeroSlot Binary-Tx JSON-RPC 2.0 response parsing
  - Properly handle success responses with "result" field
  - Properly handle error responses with "error" field containing code and message
- Update version to 4.0.0
- Update README files to reflect new version

Technical details:
- BlockRazor: HTTP mode is now the default (SwqosTransport::Http or None)
- ZeroSlot: Parse JSON-RPC 2.0 format responses instead of plain text
- Proto code: Pre-generated gRPC code for BlockRazor (no protoc required)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Wood
2026-03-18 21:32:23 +08:00
co-authored by Claude Sonnet 4.6
parent 20d053bab3
commit 07e45d136f
10 changed files with 530 additions and 112 deletions
+42
View File
@@ -0,0 +1,42 @@
# Proto 生成的代码说明
## 概述
这个目录包含了从 `.proto` 文件预生成的 Rust 代码。
## 文件说明
- `serverpb.rs` - 从 `blockrazor.proto` 生成的 gRPC 代码
- 消息类型: `SendRequest`, `SendResponse`, `HealthRequest`, `HealthResponse`
- gRPC 客户端: `server_client::ServerClient`
- gRPC 服务端: `server_server::Server`
## 用户使用
用户**不需要**安装 `protoc` 或编译 proto 文件。这些代码已经预生成好了,可以直接使用。
`blockrazor.rs` 中使用:
```rust
pub mod serverpb {
include!("pb/serverpb.rs");
}
```
## 开发者如何重新生成代码
如果你修改了 `.proto` 文件并需要重新生成代码:
```bash
cd sol-trade-sdk/proto/gen
cargo run
```
这会在 `src/swqos/pb/serverpb.rs` 生成新的代码。
## 技术细节
生成工具使用 `tonic-prost-build` crate
- 输出目录: `src/swqos/pb`
- Proto 文件: `proto/blockrazor.proto`
- 生成工具: `proto/gen/`
- 包含完整的客户端和服务端代码