[pr] Fix solana-runtime#2
Conversation
There was a problem hiding this comment.
Still weird but if the compiler wants it, so ok... 🤷😄
neutrinoks
left a comment
There was a problem hiding this comment.
Looks very good and clean to me 🚀
Yiwen-Gao
left a comment
There was a problem hiding this comment.
I left a couple of questions, but the PR looks good to me overall. Thanks!
| pubkey::Pubkey, | ||
| }, | ||
| std::{ | ||
| io::{Read, Write}, |
There was a problem hiding this comment.
nit: can we comment this out instead of deleting it so that we know what our changes are when looking back? 🙏
| foundation_rate, | ||
| prev_epoch_duration_in_years, | ||
| capitalization, | ||
| validator_rate: _, |
There was a problem hiding this comment.
That is ignored variables. We can put :_ to ignore them as their unused in the function. Simply it is to avoid complains from cargo clippy
There was a problem hiding this comment.
These variables are not used. They use interesting property of Rust, they return a struct and instead of creating an object corresponding to that struct they declare its fields. I used ":_" in order to avoid cargo clippy complains about unused variables.
for instance
warning: unused variable: `validator_rate`
--> runtime/src/bank/partitioned_epoch_rewards/calculation.rs:109:13
|
109 | validator_rate,
| ^^^^^^^^^^^^^^ help: try ignoring the field: `validator_rate: _`
|
= note: `#[warn(unused_variables)]` on by default
| prev_epoch_duration_in_years, | ||
| validator_rate, | ||
| foundation_rate, | ||
| prev_epoch_duration_in_years: _, |
| } else { | ||
| MAX_TRANSACTION_FORWARDING_DELAY_GPU | ||
| }; | ||
| // let api = perf_libs::api(); |
There was a problem hiding this comment.
Is perf_libs from the solana-performance crate?
|
@DudessaPr can you squash d1ec319 (apply risc0 changes) and f48695c (address warnings) into a single commit to clean up the history on this branch? Then when you merge this into |
apply risc0 changes lint resolve some warnings return address warnings
* remove ztsd * remove lz4 * remove gz and fix others * remove filetime/tar * remove perf from runtime * fix accountsdb const * comment out solana perf * remove symlink * update cargo lock * remove flate2 again * retrun bz instead of hz * try brackets * revert return removed and comment
* Apply the retry code to the async pubsub client
Create a test server
```ts
import http from "http";
import { WebSocketServer } from "ws";
let attemptCount = 0;
const server = http.createServer();
const wss = new WebSocketServer({ noServer: true });
wss.on("connection", (ws) => {
ws.send("Connection accepted.");
ws.on("message", (msg) => console.log(`Received: ${msg}`));
});
server.on("upgrade", (req, socket, head) => {
attemptCount += 1;
if (attemptCount <= 4) {
socket.write("HTTP/1.1 429 Too Many Requests\r\n\r\n");
socket.destroy();
console.log(`Rejected connection #${attemptCount} (429)`);
return;
}
wss.handleUpgrade(req, socket, head, (ws) => {
wss.emit("connection", ws, req);
console.log("Connection accepted on attempt", attemptCount);
});
});
server.listen(8080, () => {
console.log("Server listening on port 8080");
});
```
Run `test_slot_subscription_async`:
```
Rejected connection #1 (429)
Rejected connection #2 (429)
Rejected connection #3 (429)
Rejected connection #4 (429)
Connection accepted on attempt 5
Received: {"id":1,"jsonrpc":"2.0","method":"slotSubscribe","params":[]}
```
* `s/async_with_retry/with_retry/`
Problem
Summary of Changes
Alleviating complications with importing solana-runtime into svm-rollup
Fixes #