Skip to content

Commit c616bde

Browse files
committed
making of eip-3076 (#7894)
Signed-off-by: Aliaksei Misiukevich <[email protected]>
1 parent e5b4983 commit c616bde

File tree

33 files changed

+383
-253
lines changed

33 files changed

+383
-253
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ members = [
2323
"common/compare_fields_derive",
2424
"common/deposit_contract",
2525
"common/directory",
26+
"common/eip_3076",
2627
"common/eth2",
2728
"common/eth2_config",
2829
"common/eth2_interop_keypairs",
@@ -79,6 +80,7 @@ members = [
7980
"testing/validator_test_rig",
8081
"testing/web3signer_tests",
8182
"validator_client",
83+
"validator_client/slashing_protection",
8284
"validator_client/beacon_node_fallback",
8385
"validator_client/doppelganger_service",
8486
"validator_client/graffiti_file",
@@ -87,7 +89,6 @@ members = [
8789
"validator_client/initialized_validators",
8890
"validator_client/lighthouse_validator_store",
8991
"validator_client/signing_method",
90-
"validator_client/slashing_protection",
9192
"validator_client/validator_metrics",
9293
"validator_client/validator_services",
9394
"validator_manager",
@@ -144,6 +145,7 @@ eth2_key_derivation = { path = "crypto/eth2_key_derivation" }
144145
eth2_keystore = { path = "crypto/eth2_keystore" }
145146
eth2_network_config = { path = "common/eth2_network_config" }
146147
eth2_wallet = { path = "crypto/eth2_wallet" }
148+
eip_3076 = { path = "common/eip_3076" }
147149
ethereum_hashing = "0.7.0"
148150
ethereum_serde_utils = "0.8.0"
149151
ethereum_ssz = "0.9.0"
@@ -234,7 +236,6 @@ serde_yaml = "0.9"
234236
sha2 = "0.9"
235237
signing_method = { path = "validator_client/signing_method" }
236238
slasher = { path = "slasher", default-features = false }
237-
slashing_protection = { path = "validator_client/slashing_protection" }
238239
slot_clock = { path = "common/slot_clock" }
239240
smallvec = { version = "1.11.2", features = ["arbitrary"] }
240241
snap = "1"
@@ -275,6 +276,7 @@ validator_http_metrics = { path = "validator_client/http_metrics" }
275276
validator_metrics = { path = "validator_client/validator_metrics" }
276277
validator_services = { path = "validator_client/validator_services" }
277278
validator_store = { path = "validator_client/validator_store" }
279+
slashing_protection = { path = "validator_client/slashing_protection" }
278280
validator_test_rig = { path = "testing/validator_test_rig" }
279281
warp = { version = "0.3.7", default-features = false, features = ["tls"] }
280282
warp_utils = { path = "common/warp_utils" }

account_manager/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,13 @@ eth2_keystore = { workspace = true }
1919
eth2_network_config = { workspace = true }
2020
eth2_wallet = { workspace = true }
2121
eth2_wallet_manager = { path = "../common/eth2_wallet_manager" }
22+
eip_3076 = { workspace = true }
2223
filesystem = { workspace = true }
2324
safe_arith = { workspace = true }
2425
sensitive_url = { workspace = true }
2526
serde_json = { workspace = true }
26-
slashing_protection = { workspace = true }
2727
slot_clock = { workspace = true }
28+
slashing_protection = { workspace = true }
2829
tokio = { workspace = true }
2930
types = { workspace = true }
3031
validator_dir = { workspace = true }

account_manager/src/validator/slashing_protection.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
use clap::{Arg, ArgAction, ArgMatches, Command};
2+
use eip_3076::interchange::{Interchange, InterchangeError, InterchangeImportOutcome};
23
use environment::Environment;
3-
use slashing_protection::{
4-
InterchangeError, InterchangeImportOutcome, SLASHING_PROTECTION_FILENAME, SlashingDatabase,
5-
interchange::Interchange,
6-
};
4+
use slashing_protection::{SLASHING_PROTECTION_FILENAME, SlashingDatabase};
75
use std::fs::File;
86
use std::path::PathBuf;
97
use std::str::FromStr;

beacon_node/store/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ ethereum_ssz = { workspace = true }
1717
ethereum_ssz_derive = { workspace = true }
1818
itertools = { workspace = true }
1919
leveldb = { version = "0.8.6", optional = true, default-features = false }
20-
logging = { workspace = true }
2120
lru = { workspace = true }
2221
metrics = { workspace = true }
2322
parking_lot = { workspace = true }
@@ -30,7 +29,6 @@ state_processing = { workspace = true }
3029
strum = { workspace = true }
3130
superstruct = { workspace = true }
3231
tracing = { workspace = true }
33-
tracing-subscriber = { workspace = true }
3432
types = { workspace = true }
3533
xdelta3 = { workspace = true }
3634
zstd = { workspace = true }

common/eip_3076/Cargo.toml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[package]
2+
name = "eip_3076"
3+
version = "0.1.0"
4+
authors = ["Michael Sproul <[email protected]>", "pscott <[email protected]>"]
5+
edition.workspace = true
6+
autotests = false
7+
8+
[features]
9+
arbitrary-fuzz = ["types/arbitrary-fuzz"]
10+
portable = ["types/portable"]
11+
12+
[dependencies]
13+
arbitrary = { workspace = true, features = ["derive"] }
14+
ethereum_serde_utils = { workspace = true }
15+
r2d2 = { workspace = true }
16+
rusqlite = { workspace = true }
17+
serde = { workspace = true }
18+
serde_json = { workspace = true }
19+
tracing = { workspace = true }
20+
types = { workspace = true }
21+
22+
[dev-dependencies]
23+
rayon = { workspace = true }

common/eip_3076/Makefile

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
TESTS_TAG := v5.3.0
2+
GENERATE_DIR := generated-tests
3+
OUTPUT_DIR := interchange-tests
4+
TARBALL := $(OUTPUT_DIR)-$(TESTS_TAG).tar.gz
5+
ARCHIVE_URL := https://github.com/eth-clients/slashing-protection-interchange-tests/tarball/$(TESTS_TAG)
6+
7+
ifeq ($(OS),Windows_NT)
8+
ifeq (, $(shell where rm))
9+
rmfile = if exist $(1) (del /F /Q $(1))
10+
rmdir = if exist $(1) (rmdir /Q /S $(1))
11+
makedir = if not exist $(1) (mkdir $(1))
12+
else
13+
rmfile = rm -f $(1)
14+
rmdir = rm -rf $(1)
15+
makedir = mkdir -p $(1)
16+
endif
17+
else
18+
rmfile = rm -f $(1)
19+
rmdir = rm -rf $(1)
20+
makedir = mkdir -p $(1)
21+
endif
22+
23+
$(OUTPUT_DIR): $(TARBALL)
24+
$(call rmdir,$@)
25+
$(call makedir,$@)
26+
tar --strip-components=1 -xzf $^ -C $@
27+
28+
$(TARBALL):
29+
curl --fail -L -o $@ $(ARCHIVE_URL)
30+
31+
clean-test-files:
32+
$(call rmdir,$(OUTPUT_DIR))
33+
34+
clean-archives:
35+
$(call rmfile,$(TARBALL))
36+
37+
generate:
38+
$(call rmdir,$(GENERATE_DIR))
39+
cargo run --release --bin test_generator -- $(GENERATE_DIR)
40+
41+
clean: clean-test-files clean-archives
42+
43+
.PHONY: clean clean-archives clean-test-files generate

0 commit comments

Comments
 (0)