Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 633f061

Browse files
authored
slashing: add duplicate block proof verification (#7418)
* slashing: add duplicate block proof verification * pr feedback: use local record dep * pr feedback: update to v2.1 crates * pr feedback: rename errors for consistency * pr feedback: do not log pubkey * pass along workspace lints * pr feedback: use zerocopy for instruction data * add one epoch statue of limitations * pr feedback: zerocopy from proof account to proof data struct * Fix `proof_account_length` for the new size of a proof account * pr feedback: revert Cargo.lock * pr feedback: remove unecessary allow(dead_code) * pr feedback: use SLOT - 1 and constants in test code * pr feedback: return error if proof buffer is too small for shred1_length * pr feedback: remove lifetime on shred reference in get_payload * pr feedback: use rwlock in test rather than unsafe const modification * pr feedback: use epoch schedule sysvar instead of hardcoding length * Add Cargo.lock just for slashing crate
1 parent dcfc02b commit 633f061

File tree

14 files changed

+2409
-0
lines changed

14 files changed

+2409
-0
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ members = [
5050
"shared-memory/program",
5151
"single-pool/cli",
5252
"single-pool/program",
53+
"slashing/program",
5354
"stake-pool/cli",
5455
"stake-pool/program",
5556
"stateless-asks/program",

slashing/README.md

Whitespace-only changes.

slashing/program/Cargo.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[package]
2+
name = "spl-slashing"
3+
version = "0.1.0"
4+
description = "Solana Program Library Slashing"
5+
authors = ["Solana Labs Maintainers <[email protected]>"]
6+
repository = "https://github.com/solana-labs/solana-program-library"
7+
license = "Apache-2.0"
8+
edition = "2021"
9+
10+
[features]
11+
no-entrypoint = []
12+
test-sbf = []
13+
14+
[dependencies]
15+
bitflags = { version = "2.6.0", features = ["serde"] }
16+
bytemuck = { version = "1.19.0", features = ["derive"] }
17+
num_enum = "0.7.3"
18+
generic-array = { version = "0.14.7", features = ["serde"], default-features = false }
19+
bincode = "1.3.3"
20+
num-derive = "0.4"
21+
num-traits = "0.2"
22+
solana-program = "2.1.0"
23+
serde = "1.0.210" # must match the serde_derive version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
24+
serde_bytes = "0.11.15"
25+
serde_derive = "1.0.210" # must match the serde version, see https://github.com/serde-rs/serde/issues/2584#issuecomment-1685252251
26+
serde_with = { version = "3.11.0", default-features = false }
27+
28+
thiserror = "1.0"
29+
spl-pod = { version = "0.5.0", path = "../../libraries/pod" }
30+
31+
[dev-dependencies]
32+
lazy_static = "1.5.0"
33+
solana-program-test = "2.1.0"
34+
solana-sdk = "2.1.0"
35+
solana-ledger = "2.1.0"
36+
solana-entry = "2.1.0"
37+
solana-client = "2.1.0"
38+
spl-record = { version = "0.3.0", path = "../../record/program" }
39+
rand = "0.8.5"
40+
41+
[lib]
42+
crate-type = ["cdylib", "lib"]
43+
44+
[package.metadata.docs.rs]
45+
targets = ["x86_64-unknown-linux-gnu"]
46+
47+
[lints]
48+
workspace = true

slashing/program/program-id.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
S1ashing11111111111111111111111111111111111

0 commit comments

Comments
 (0)