-
Notifications
You must be signed in to change notification settings - Fork 0
NDEV-3839. Send update_account only for changed accounts #2
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
base: master
Are you sure you want to change the base?
Conversation
3e8a562 to
226ee37
Compare
runtime/src/account_saver.rs
Outdated
| return false; | ||
| } | ||
|
|
||
| if account_is_executable { |
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.
Why the executable accounts are extracted to the separate case? As I understand they have account_owner which should match invoked_program_id as regular accounts.
226ee37 to
64a6d63
Compare
* 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/`
…unt is writable in transaction
c6df636 to
59563b8
Compare
… might be changed by runtime
59563b8 to
d8045c1
Compare
| account_owner: &Pubkey, | ||
| account_pubkey: &Pubkey, | ||
| ) -> bool { | ||
| let pubkey_str = account_pubkey.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.
You can check that the owner is Sysvar1111111.....
NDEV-3839. Send update_account only for changed accounts, even if the account is writable in the transaction