-
Notifications
You must be signed in to change notification settings - Fork 90
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
[deps] update rpc deps #2044
[deps] update rpc deps #2044
Conversation
vegetabledogdog
commented
Jul 1, 2024
•
edited
Loading
edited
- Closes [deps] Upgrade jsonrpsee to 0.20.x #1930
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
@baichuan3 help to review. |
@@ -50,8 +44,7 @@ impl ClientBuilder { | |||
|
|||
let http_client = Arc::new( | |||
HttpClientBuilder::default() | |||
.max_request_body_size(2 << 30) | |||
.max_concurrent_requests(self.max_concurrent_requests) |
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.
新版本的 jsonrpsee 移除了max_concurrent_requests支持?
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.
是的
参考这个:paritytech/jsonrpsee#1377
let global_state_filter = | ||
UTXOFilterView::into_global_state_filter(filter, resolve_address)?; | ||
let global_state_filter = UTXOFilterView::into_global_state_filter(filter, resolve_address) | ||
.map_err(|e| err_obj(e.to_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.
还有一种思路, 现在 RPC 是直接使用 Jsonrpcsee里的RpcResult
和Error
,可以考虑封装Rooch 自己的RpcResult
和Error
,将 Jsonrpcsee 的 Error 自动转换成 RpcResult里的 Error,这样的好处就是,不需要在每一个 RPC API实现里,显示的调用map_err(|e| err_obj(e.to_string()))?
方法,代码会更简洁。
可参考 sui 的实现 https://github.com/MystenLabs/sui/blob/a7bc3198073f29d285ae36acf77ceda8032a548d/crates/sui-json-rpc/src/error.rs#L35-L36
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.
可以,我试试
@@ -337,8 +336,7 @@ pub async fn run_start_server(opt: RoochOpt, server_opt: ServerOpt) -> Result<Se | |||
|
|||
// Build server | |||
let server = ServerBuilder::default() | |||
.set_logger(RpcLogger) |
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.
rpc logger 为啥也去掉了?
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.
Jsonrpcseed的logger转移到了middware,现在用的middware是tower库的
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.
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.
等我改一下
jsonrpcsee 0.16x 版本有个 bug,在构造http builder时,需要强制传入端口, 当时代码里暂时用了workaround 的办法,https://dev-seed.rooch.network:443/ jsonrpcsee在 0.17版本中修复了该 bug,可以验证下升级后 |
去掉端口,工作正常 |
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.
LGTM