Skip to content

Commit 0a70837

Browse files
authored
Stakenet Keeper: Failed to deserialize VoteAccount (#291)
#### Problem - Failed to deserialize this vote account https://solscan.io/account/DMPhNJFSvi34NmfcqR4B5rdKgDYY3kZbXpdXJBL4cJ1q #### Solution - If fail to deserialize, skip it
1 parent 9ec2657 commit 0a70837

4 files changed

Lines changed: 28 additions & 7 deletions

File tree

.cargo/audit.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[advisories]
2+
ignore = [
3+
"RUSTSEC-2022-0093",
4+
"RUSTSEC-2024-0344",
5+
"RUSTSEC-2024-0421",
6+
"RUSTSEC-2025-0022",
7+
"RUSTSEC-2025-0009",
8+
"RUSTSEC-2025-0004",
9+
"RUSTSEC-2024-0357",
10+
"RUSTSEC-2024-0336",
11+
"RUSTSEC-2025-0055",
12+
"RUSTSEC-2026-0049",
13+
"RUSTSEC-2026-0098",
14+
"RUSTSEC-2026-0099"
15+
]

.github/workflows/build.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
with:
2424
crate: cargo-audit
2525
version: "0.22.1"
26-
- run: cargo audit --ignore RUSTSEC-2022-0093 --ignore RUSTSEC-2024-0344 --ignore RUSTSEC-2024-0421 --ignore RUSTSEC-2025-0022 --ignore RUSTSEC-2025-0009 --ignore RUSTSEC-2025-0004 --ignore RUSTSEC-2024-0357 --ignore RUSTSEC-2024-0336 --ignore RUSTSEC-2025-0055 --ignore RUSTSEC-2026-0049
26+
- run: cargo audit
2727

2828
lint:
2929
name: lint

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

keepers/stakenet-keeper/src/entries/crank_steward.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,14 @@ pub fn _get_update_stake_pool_ixs(
153153

154154
let vote_pubkey =
155155
SolanaPubkey::new_from_array(validator_info.vote_account_address.to_bytes());
156-
let vote_account = VoteStateV4::deserialize(&raw_vote_account.data, &vote_pubkey)
157-
.expect("Could not deserialize vote account");
156+
let vote_account =
157+
match VoteStateV4::deserialize(&raw_vote_account.data, &vote_pubkey) {
158+
Ok(v) => v,
159+
Err(e) => {
160+
error!("Could not deserialize vote account {vote_pubkey}: {e:?}");
161+
continue;
162+
}
163+
};
158164

159165
if vote_account.epoch_credits.iter().last().is_none() {
160166
error!(

0 commit comments

Comments
 (0)