diff --git a/Cargo.lock b/Cargo.lock index 8f4dec0da26..95e9ccde720 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,7 @@ dependencies = [ "clap", "clap_utils", "directory", + "eip_3076", "environment", "eth2", "eth2_keystore", @@ -21,7 +22,6 @@ dependencies = [ "safe_arith", "sensitive_url", "serde_json", - "slashing_protection", "slot_clock", "tempfile", "tokio", @@ -2570,6 +2570,24 @@ dependencies = [ "types", ] +[[package]] +name = "eip_3076" +version = "0.1.0" +dependencies = [ + "arbitrary", + "ethereum_serde_utils", + "filesystem", + "r2d2", + "r2d2_sqlite", + "rayon", + "rusqlite", + "serde", + "serde_json", + "tempfile", + "tracing", + "types", +] + [[package]] name = "either" version = "1.15.0" @@ -2764,6 +2782,7 @@ name = "eth2" version = "0.1.0" dependencies = [ "derivative", + "eip_3076", "either", "enr", "eth2_keystore", @@ -2783,7 +2802,6 @@ dependencies = [ "sensitive_url", "serde", "serde_json", - "slashing_protection", "ssz_types", "test_random_derive", "tokio", @@ -5494,6 +5512,7 @@ dependencies = [ "console-subscriber", "database_manager", "directory", + "eip_3076", "environment", "eth2", "eth2_network_config", @@ -5510,7 +5529,6 @@ dependencies = [ "serde_json", "serde_yaml", "slasher", - "slashing_protection", "store", "task_executor", "tempfile", @@ -5586,6 +5604,7 @@ dependencies = [ "account_utils", "beacon_node_fallback", "doppelganger_service", + "eip_3076", "either", "environment", "eth2", @@ -5595,7 +5614,6 @@ dependencies = [ "parking_lot 0.12.3", "serde", "signing_method", - "slashing_protection", "slot_clock", "task_executor", "tokio", @@ -8576,24 +8594,6 @@ dependencies = [ "types", ] -[[package]] -name = "slashing_protection" -version = "0.1.0" -dependencies = [ - "arbitrary", - "ethereum_serde_utils", - "filesystem", - "r2d2", - "r2d2_sqlite", - "rayon", - "rusqlite", - "serde", - "serde_json", - "tempfile", - "tracing", - "types", -] - [[package]] name = "slot_clock" version = "0.2.0" @@ -9817,6 +9817,7 @@ dependencies = [ "directory", "dirs", "doppelganger_service", + "eip_3076", "environment", "eth2", "fdlimit", @@ -9830,7 +9831,6 @@ dependencies = [ "reqwest", "sensitive_url", "serde", - "slashing_protection", "slot_clock", "tokio", "tracing", @@ -9870,6 +9870,7 @@ dependencies = [ "directory", "dirs", "doppelganger_service", + "eip_3076", "eth2", "eth2_keystore", "ethereum_serde_utils", @@ -9888,7 +9889,6 @@ dependencies = [ "serde", "serde_json", "signing_method", - "slashing_protection", "slot_clock", "sysinfo", "system_health", @@ -9990,8 +9990,8 @@ dependencies = [ name = "validator_store" version = "0.1.0" dependencies = [ + "eip_3076", "eth2", - "slashing_protection", "types", ] @@ -10245,6 +10245,7 @@ version = "0.1.0" dependencies = [ "account_utils", "async-channel 1.9.0", + "eip_3076", "environment", "eth2", "eth2_keystore", @@ -10258,7 +10259,6 @@ dependencies = [ "serde", "serde_json", "serde_yaml", - "slashing_protection", "slot_clock", "task_executor", "tempfile", diff --git a/Cargo.toml b/Cargo.toml index 6a7b2f610e6..6b381f6ecb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ members = [ "common/compare_fields_derive", "common/deposit_contract", "common/directory", + "common/eip_3076", "common/eth2", "common/eth2_config", "common/eth2_interop_keypairs", @@ -86,7 +87,6 @@ members = [ "validator_client/initialized_validators", "validator_client/lighthouse_validator_store", "validator_client/signing_method", - "validator_client/slashing_protection", "validator_client/validator_metrics", "validator_client/validator_services", "validator_manager", @@ -142,6 +142,7 @@ eth2_key_derivation = { path = "crypto/eth2_key_derivation" } eth2_keystore = { path = "crypto/eth2_keystore" } eth2_network_config = { path = "common/eth2_network_config" } eth2_wallet = { path = "crypto/eth2_wallet" } +eip_3076 = { path = "common/eip_3076" } ethereum_hashing = "0.7.0" ethereum_serde_utils = "0.7" ethereum_ssz = "0.8.2" @@ -226,7 +227,6 @@ serde_yaml = "0.9" sha2 = "0.9" signing_method = { path = "validator_client/signing_method" } slasher = { path = "slasher", default-features = false } -slashing_protection = { path = "validator_client/slashing_protection" } slot_clock = { path = "common/slot_clock" } smallvec = { version = "1.11.2", features = ["arbitrary"] } snap = "1" diff --git a/account_manager/Cargo.toml b/account_manager/Cargo.toml index 071e2681dd1..54aba6fb6ec 100644 --- a/account_manager/Cargo.toml +++ b/account_manager/Cargo.toml @@ -19,11 +19,11 @@ eth2_keystore = { workspace = true } eth2_network_config = { workspace = true } eth2_wallet = { workspace = true } eth2_wallet_manager = { path = "../common/eth2_wallet_manager" } +eip_3076 = { workspace = true } filesystem = { workspace = true } safe_arith = { workspace = true } sensitive_url = { workspace = true } serde_json = { workspace = true } -slashing_protection = { workspace = true } slot_clock = { workspace = true } tokio = { workspace = true } types = { workspace = true } diff --git a/account_manager/src/validator/create.rs b/account_manager/src/validator/create.rs index 3db8c3f152d..988121bb7bf 100644 --- a/account_manager/src/validator/create.rs +++ b/account_manager/src/validator/create.rs @@ -7,9 +7,9 @@ use account_utils::{ use clap::{Arg, ArgAction, ArgMatches, Command}; use clap_utils::FLAG_HEADER; use directory::{parse_path_or_default_with_flag, DEFAULT_SECRET_DIR, DEFAULT_WALLET_DIR}; +use eip_3076::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use environment::Environment; use eth2_wallet_manager::WalletManager; -use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use std::ffi::OsStr; use std::fs; use std::fs::create_dir_all; @@ -272,8 +272,7 @@ fn existing_validator_count>(validator_dir: P) -> Result( } else if endpoint_version == V1 { Ok(warp::reply::json(&GenericResponse::from(aggregate_attestation)).into_response()) } else { - return Err(unsupported_version_rejection(endpoint_version)); + Err(unsupported_version_rejection(endpoint_version)) } } diff --git a/validator_client/slashing_protection/Cargo.toml b/common/eip_3076/Cargo.toml similarity index 87% rename from validator_client/slashing_protection/Cargo.toml rename to common/eip_3076/Cargo.toml index 3860af514db..688a7237116 100644 --- a/validator_client/slashing_protection/Cargo.toml +++ b/common/eip_3076/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "slashing_protection" +name = "eip_3076" version = "0.1.0" authors = ["Michael Sproul ", "pscott "] -edition = { workspace = true } +edition.workspace = true autotests = false [features] @@ -26,5 +26,5 @@ types = { workspace = true } rayon = { workspace = true } [[test]] -name = "slashing_protection_tests" +name = "eip_3076_tests" path = "tests/main.rs" diff --git a/validator_client/slashing_protection/Makefile b/common/eip_3076/Makefile similarity index 99% rename from validator_client/slashing_protection/Makefile rename to common/eip_3076/Makefile index 1b9729634e5..2d641c9e8dd 100644 --- a/validator_client/slashing_protection/Makefile +++ b/common/eip_3076/Makefile @@ -41,4 +41,3 @@ generate: clean: clean-test-files clean-archives .PHONY: clean clean-archives clean-test-files generate - diff --git a/common/eip_3076/interchange-tests/.github/workflows/check.yaml b/common/eip_3076/interchange-tests/.github/workflows/check.yaml new file mode 100644 index 00000000000..1da42929aa8 --- /dev/null +++ b/common/eip_3076/interchange-tests/.github/workflows/check.yaml @@ -0,0 +1,15 @@ +name: schema checks + +on: + push: + pull_request: + +jobs: + check_schema: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + - run: make check diff --git a/common/eip_3076/interchange-tests/.gitignore b/common/eip_3076/interchange-tests/.gitignore new file mode 100644 index 00000000000..335ec9573de --- /dev/null +++ b/common/eip_3076/interchange-tests/.gitignore @@ -0,0 +1 @@ +*.tar.gz diff --git a/common/eip_3076/interchange-tests/Makefile b/common/eip_3076/interchange-tests/Makefile new file mode 100644 index 00000000000..e6f89c94c19 --- /dev/null +++ b/common/eip_3076/interchange-tests/Makefile @@ -0,0 +1,9 @@ +VERSION:=$(shell git describe --tags) + +check: + cargo run --manifest-path schema_validator/Cargo.toml --release -- schema.json tests/generated + +# Build a tarball for a release. +# To make a new release: `git tag -s vX.Y.Z` +release: + tar -czvf eip-3076-tests-$(VERSION).tar.gz tests/ diff --git a/common/eip_3076/interchange-tests/README.md b/common/eip_3076/interchange-tests/README.md new file mode 100644 index 00000000000..4343b2455b8 --- /dev/null +++ b/common/eip_3076/interchange-tests/README.md @@ -0,0 +1,140 @@ +# Slashing Protection Interchange Tests (EIP-3076) + +Tests for EIP-3076: + +https://eips.ethereum.org/EIPS/eip-3076 + +Discussion: + +https://ethereum-magicians.org/t/eip-3076-validator-client-interchange-format-slashing-protection/4883 + +## How to run + +Each test directory contains an interchange file and some extra data about how to test it. + +For example: + +```json +{ + "name": "single_validator_genesis_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "0" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "0", + "should_succeed": false + } + ] + } + ] +} +``` + +To run a test, first initialize a new (empty) slashing protection database. + +Then for each entry in `steps`, import the `interchange`, process the `blocks` and `attestations`, +and continue to the next step. + +Determine the test outcome according to the meanings of each of the fields, +which are as follows: + +* `name: string`: the name of the test-case, informational. +* `genesis_validators_root: Root`: the genesis validators root to use when + creating the empty slashing protection database, or to compare the import + against. +* `steps[i].should_succeed: bool`: whether the `steps[i].interchange` given is valid and should + be imported successfully. +* `steps[i].contains_slashable_data: bool`: whether the `steps[i].interchange` contains some + slashable data with respect to itself or the existing contents of the database. +* `steps[i].interchange: Interchange`: slashing protection interchange data as described + by the spec. +* `steps[i].blocks: [object]`: a list of block signings to be attempted **after** + importing the `interchange`, detailed below. +* `steps[i].attestations: [object]`: a list of attestation signings to be attempted **after** + importing the `interchange`, detailed below. + +Each block in `blocks` is structured as: + +```json +{ + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true +} +``` + +Your test-runner should attempt to sign a block with `signing_root` at the given slot from the given +`pubkey`. The `should_succeed` field describes whether this signing should be accepted (true) or +rejected (false) _by a client using a minimal strategy_. Clients using a complete strategy should +instead use the `should_succeed_complete` field which allows signing to succeed in more cases. If +the block is signed successfully it should be incorporated into the slashing protection database. + +Each attestation in `attestations` is structured as: + +```json +{ + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "11", + "target_epoch": "12", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true +} +``` + +Similarly to above, your test-runner should attempt to sign an attestation with these parameters +using the given `pubkey`, and succeed based on the value of +`should_succeed`/`should_succeed_complete`. Again, implementations that use the _complete_ strategy +should use `should_succeed_complete`. All implementations should incorporate signed attestations +into the database. + +Note that the top-level `genesis_validators_root` is not necessarily the same +as the GVR contained in the interchange, to allow us to test the case where +they are mismatched. + +## Handling Slashable Data + +The `contains_slashable_data` parameter is to be interpreted as follows: + +- If `should_succeed` is false, then `contains_slashable_data` is irrelevant +- If `contains_slashable_data` is false, then the given interchange **must** be imported + successfully, and the given block/attestation checks must pass. +- If `contains_slashable_data` is true, then implementations have the option to do one of two + things: + - Import the interchange successfully, working around the slashable data by minification + or some other mechanism. If the import succeeds, all checks must pass and the test + should continue to the next step. + - Reject the interchange (or partially import it), in which case the block/attestation + checks and all future steps should be ignored. + +## Downloading the tests + +The `tests` directory is released as a versioned `.tar.gz` on the [Releases](https://github.com/eth-clients/slashing-protection-interchange-tests/releases) page. + +Alternatively, you could use a git submodule. diff --git a/common/eip_3076/interchange-tests/schema.json b/common/eip_3076/interchange-tests/schema.json new file mode 100644 index 00000000000..ad41a50b28c --- /dev/null +++ b/common/eip_3076/interchange-tests/schema.json @@ -0,0 +1,94 @@ +{ + "title": "Signing history", + "description": "This schema provides a record of the blocks and attestations signed by a set of validators", + "type": "object", + "properties": { + "metadata": { + "type": "object", + "properties": { + "interchange_format_version": { + "type": "string", + "description": "The version of the interchange format that this document adheres to" + }, + "genesis_validators_root": { + "type": "string", + "description": "Calculated at Genesis time; serves to uniquely identify the chain" + } + }, + "required": [ + "interchange_format_version", + "genesis_validators_root" + ] + }, + "data": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "pubkey": { + "type": "string", + "description": "The BLS public key of the validator (encoded as a 0x-prefixed hex string)" + }, + "signed_blocks": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "slot": { + "type": "string", + "description": "The slot number of the block that was signed" + }, + "signing_root": { + "type": "string", + "description": "The output of compute_signing_root(block, domain)" + } + }, + "required": [ + "slot" + ] + } + ] + }, + "signed_attestations": { + "type": "array", + "items": [ + { + "type": "object", + "properties": { + "source_epoch": { + "type": "string", + "description": "The attestation.data.source.epoch of the signed attestation" + }, + "target_epoch": { + "type": "string", + "description": "The attestation.data.target.epoch of the signed attestation" + }, + "signing_root": { + "type": "string", + "description": "The output of compute_signing_root(attestation, domain)" + } + }, + "required": [ + "source_epoch", + "target_epoch" + ] + } + ] + } + }, + "required": [ + "pubkey", + "signed_blocks", + "signed_attestations" + ] + } + ] + } + }, + "required": [ + "metadata", + "data" + ] +} diff --git a/common/eip_3076/interchange-tests/schema_validator/.gitignore b/common/eip_3076/interchange-tests/schema_validator/.gitignore new file mode 100644 index 00000000000..96ef6c0b944 --- /dev/null +++ b/common/eip_3076/interchange-tests/schema_validator/.gitignore @@ -0,0 +1,2 @@ +/target +Cargo.lock diff --git a/common/eip_3076/interchange-tests/schema_validator/Cargo.toml b/common/eip_3076/interchange-tests/schema_validator/Cargo.toml new file mode 100644 index 00000000000..95743c156f8 --- /dev/null +++ b/common/eip_3076/interchange-tests/schema_validator/Cargo.toml @@ -0,0 +1,9 @@ +[package] +name = "schema_validator" +version = "0.1.0" +authors = ["Michael Sproul "] +edition = "2018" + +[dependencies] +jsonschema = { version = "0.3.1", default-features = false } +serde_json = "1.0.59" diff --git a/common/eip_3076/interchange-tests/schema_validator/src/main.rs b/common/eip_3076/interchange-tests/schema_validator/src/main.rs new file mode 100644 index 00000000000..48ccc6fbbb9 --- /dev/null +++ b/common/eip_3076/interchange-tests/schema_validator/src/main.rs @@ -0,0 +1,44 @@ +use jsonschema::{Draft, JSONSchema}; +use serde_json::Value; +use std::env; +use std::fs::{self, File}; + +fn main() { + let args: Vec<_> = env::args().collect(); + + let schema_file = File::open(&args[1]).unwrap(); + let schema_value = serde_json::from_reader(schema_file).unwrap(); + let schema = JSONSchema::compile(&schema_value, Some(Draft::Draft7)).unwrap(); + + let tests_dir = &args[2]; + + let mut success_all = true; + + fs::read_dir(tests_dir) + .expect("read_dir succeeds on test directory") + .map(|e| e.unwrap().path()) + .filter(|path| path.is_file()) + .for_each(|path| { + let test_file = File::open(&path).unwrap(); + let test_value: Value = serde_json::from_reader(test_file).unwrap(); + let filename = path.file_name().unwrap().to_str().unwrap(); + + let steps = test_value.get("steps").unwrap(); + let mut success = true; + + for (i, step) in steps.as_array().unwrap().iter().enumerate() { + let interchange_value = step.get("interchange").unwrap(); + if let Err(errors) = schema.validate(interchange_value) { + for e in errors { + println!("{} .steps[{}].interchange, error: {:?}", filename, i, e); + } + success = false; + success_all = false; + } + } + if success { + println!("{}, ok", filename); + } + }); + assert!(success_all, "one or more tests failed, see above"); +} diff --git a/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_not_slashable.json b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_not_slashable.json new file mode 100644 index 00000000000..aa8e674a6cc --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_not_slashable.json @@ -0,0 +1,93 @@ +{ + "name": "duplicate_pubkey_not_slashable", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + }, + { + "slot": "11" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "12" + }, + { + "slot": "13" + } + ], + "signed_attestations": [ + { + "source_epoch": "1", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "1", + "target_epoch": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_attestation.json b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_attestation.json new file mode 100644 index 00000000000..4809c0cd0d6 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_attestation.json @@ -0,0 +1,74 @@ +{ + "name": "duplicate_pubkey_slashable_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000003" + } + ] + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "1", + "target_epoch": "2" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "1", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_block.json b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_block.json new file mode 100644 index 00000000000..8b18de40107 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/duplicate_pubkey_slashable_block.json @@ -0,0 +1,63 @@ +{ + "name": "duplicate_pubkey_slashable_block", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + } + ], + "signed_attestations": [ + { + "source_epoch": "1", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "11", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_multiple_validators_repeat_idem.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_multiple_validators_repeat_idem.json new file mode 100644 index 00000000000..09b43600b92 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_multiple_validators_repeat_idem.json @@ -0,0 +1,183 @@ +{ + "name": "multiple_interchanges_multiple_validators_repeat_idem", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + }, + { + "slot": "4" + }, + { + "slot": "6" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "1", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + }, + { + "slot": "4" + }, + { + "slot": "6" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "1", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "0", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "7", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "0", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "0", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_merge_stale.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_merge_stale.json new file mode 100644 index 00000000000..6b57c1a386f --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_merge_stale.json @@ -0,0 +1,234 @@ +{ + "name": "multiple_interchanges_overlapping_validators_merge_stale", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "100" + } + ], + "signed_attestations": [ + { + "source_epoch": "12", + "target_epoch": "13" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "101" + } + ], + "signed_attestations": [ + { + "source_epoch": "12", + "target_epoch": "13" + } + ] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "4" + } + ], + "signed_attestations": [ + { + "source_epoch": "4", + "target_epoch": "5" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + } + ], + "signed_attestations": [ + { + "source_epoch": "4", + "target_epoch": "5" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "3" + } + ], + "signed_attestations": [ + { + "source_epoch": "3", + "target_epoch": "4" + } + ] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "102" + } + ], + "signed_attestations": [ + { + "source_epoch": "12", + "target_epoch": "13" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "100", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "101", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "slot": "102", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "103", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "104", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "slot": "105", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "12", + "target_epoch": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "11", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "12", + "target_epoch": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "11", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "12", + "target_epoch": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "11", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "12", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "13", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "13", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_repeat_idem.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_repeat_idem.json new file mode 100644 index 00000000000..8aa95d17473 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_overlapping_validators_repeat_idem.json @@ -0,0 +1,217 @@ +{ + "name": "multiple_interchanges_overlapping_validators_repeat_idem", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + }, + { + "slot": "4" + }, + { + "slot": "6" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "1", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + }, + { + "slot": "4" + }, + { + "slot": "6" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "1", + "target_epoch": "2" + } + ] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "8" + }, + { + "slot": "10" + }, + { + "slot": "12" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "1", + "target_epoch": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "1", + "target_epoch": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_fail_iff_imported.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_fail_iff_imported.json new file mode 100644 index 00000000000..fba8bad5c39 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_fail_iff_imported.json @@ -0,0 +1,70 @@ +{ + "name": "multiple_interchanges_single_validator_fail_iff_imported", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "40" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "20" + }, + { + "slot": "50" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "50", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_first_surrounds_second.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_first_surrounds_second.json new file mode 100644 index 00000000000..e029d1d5082 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_first_surrounds_second.json @@ -0,0 +1,95 @@ +{ + "name": "multiple_interchanges_single_validator_first_surrounds_second", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "9", + "target_epoch": "21" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "10", + "target_epoch": "20" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_multiple_blocks_out_of_order.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_multiple_blocks_out_of_order.json new file mode 100644 index 00000000000..7ce1fd0d8ed --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_multiple_blocks_out_of_order.json @@ -0,0 +1,82 @@ +{ + "name": "multiple_interchanges_single_validator_multiple_blocks_out_of_order", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "0" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "30", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "20" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "29", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_second_surrounds_first.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_second_surrounds_first.json new file mode 100644 index 00000000000..ff27b90ffe0 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_second_surrounds_first.json @@ -0,0 +1,95 @@ +{ + "name": "multiple_interchanges_single_validator_second_surrounds_first", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "10", + "target_epoch": "20" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "9", + "target_epoch": "21" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_att_out_of_order.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_att_out_of_order.json new file mode 100644 index 00000000000..850f98d8d5b --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_att_out_of_order.json @@ -0,0 +1,87 @@ +{ + "name": "multiple_interchanges_single_validator_single_att_out_of_order", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "12", + "target_epoch": "13" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "10", + "target_epoch": "11" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "12", + "target_epoch": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "12", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "13", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_block_out_of_order.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_block_out_of_order.json new file mode 100644 index 00000000000..1473a5d7afc --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_block_out_of_order.json @@ -0,0 +1,60 @@ +{ + "name": "multiple_interchanges_single_validator_single_block_out_of_order", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "40" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "20" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_message_gap.json b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_message_gap.json new file mode 100644 index 00000000000..4e4be2269e8 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_interchanges_single_validator_single_message_gap.json @@ -0,0 +1,123 @@ +{ + "name": "multiple_interchanges_single_validator_single_message_gap", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "40" + } + ], + "signed_attestations": [ + { + "source_epoch": "2", + "target_epoch": "30" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + }, + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "50" + } + ], + "signed_attestations": [ + { + "source_epoch": "10", + "target_epoch": "50" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "41", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "45", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "49", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "50", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "51", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "31", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "49", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "51", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_validators_multiple_blocks_and_attestations.json b/common/eip_3076/interchange-tests/tests/generated/multiple_validators_multiple_blocks_and_attestations.json new file mode 100644 index 00000000000..06215aa587c --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_validators_multiple_blocks_and_attestations.json @@ -0,0 +1,287 @@ +{ + "name": "multiple_validators_multiple_blocks_and_attestations", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + }, + { + "slot": "15" + }, + { + "slot": "20" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "0", + "target_epoch": "2" + }, + { + "source_epoch": "1", + "target_epoch": "3" + }, + { + "source_epoch": "2", + "target_epoch": "4" + }, + { + "source_epoch": "4", + "target_epoch": "5" + } + ] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "3" + }, + { + "slot": "4" + }, + { + "slot": "100" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "0" + }, + { + "source_epoch": "0", + "target_epoch": "1" + }, + { + "source_epoch": "1", + "target_epoch": "2" + }, + { + "source_epoch": "2", + "target_epoch": "5" + }, + { + "source_epoch": "5", + "target_epoch": "6" + } + ] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "10" + }, + { + "slot": "15" + }, + { + "slot": "20" + } + ], + "signed_attestations": [ + { + "source_epoch": "1", + "target_epoch": "2" + }, + { + "source_epoch": "1", + "target_epoch": "3" + }, + { + "source_epoch": "2", + "target_epoch": "4" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "9", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "11", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "0", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "slot": "101", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "slot": "9", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "slot": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "5", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "6", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "4", + "target_epoch": "6", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "7", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "6", + "target_epoch": "8", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "1", + "target_epoch": "7", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "1", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "source_epoch": "5", + "target_epoch": "7", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "0", + "target_epoch": "0", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "0", + "target_epoch": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "source_epoch": "2", + "target_epoch": "5", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/multiple_validators_same_slot_blocks.json b/common/eip_3076/interchange-tests/tests/generated/multiple_validators_same_slot_blocks.json new file mode 100644 index 00000000000..c79e8c9c99f --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/multiple_validators_same_slot_blocks.json @@ -0,0 +1,66 @@ +{ + "name": "multiple_validators_same_slot_blocks", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "slot": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + "signed_attestations": [] + }, + { + "pubkey": "0xb89bebc699769726a318c8e9971bd3171297c61aea4a6578a7a4f94b547dcba5bac16a89108b6b6a1fe3695d1a874a0b", + "signed_blocks": [ + { + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001" + }, + { + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ], + "signed_attestations": [] + }, + { + "pubkey": "0xa3a32b0f8b4ddb83f1a0a853d81dd725dfe577d4f4c3db8ece52ce2b026eca84815c1a7e8e92a4de3d755733bf7e4a9b", + "signed_blocks": [ + { + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000002" + }, + { + "slot": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000002" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_genesis_attestation.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_genesis_attestation.json new file mode 100644 index 00000000000..852f88ff22b --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_genesis_attestation.json @@ -0,0 +1,39 @@ +{ + "name": "single_validator_genesis_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "0" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "0", + "target_epoch": "0", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_import_only.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_import_only.json new file mode 100644 index 00000000000..fa2f51272ae --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_import_only.json @@ -0,0 +1,34 @@ +{ + "name": "single_validator_import_only", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "22" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "2" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_block_attempts.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_block_attempts.json new file mode 100644 index 00000000000..a71e4bf1c8a --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_block_attempts.json @@ -0,0 +1,57 @@ +{ + "name": "single_validator_multiple_block_attempts", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "15" + }, + { + "slot": "16" + }, + { + "slot": "17" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "16", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "16", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "16", + "signing_root": "0x000000000000000000000000000000000000000000000000ffffffffffffffff", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_blocks_and_attestations.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_blocks_and_attestations.json new file mode 100644 index 00000000000..5b7b29c7345 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_multiple_blocks_and_attestations.json @@ -0,0 +1,165 @@ +{ + "name": "single_validator_multiple_blocks_and_attestations", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "2" + }, + { + "slot": "3" + }, + { + "slot": "10" + }, + { + "slot": "1200" + } + ], + "signed_attestations": [ + { + "source_epoch": "10", + "target_epoch": "11" + }, + { + "source_epoch": "12", + "target_epoch": "13" + }, + { + "source_epoch": "20", + "target_epoch": "24" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "2", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1200", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "256", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1201", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "9", + "target_epoch": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "12", + "target_epoch": "13", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "11", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "21", + "target_epoch": "22", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "10", + "target_epoch": "24", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "11", + "target_epoch": "12", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "20", + "target_epoch": "25", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_attestations.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_attestations.json new file mode 100644 index 00000000000..ff31d4ce661 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_attestations.json @@ -0,0 +1,67 @@ +{ + "name": "single_validator_out_of_order_attestations", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "4", + "target_epoch": "5" + }, + { + "source_epoch": "3", + "target_epoch": "4" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "4", + "target_epoch": "5", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "1", + "target_epoch": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_blocks.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_blocks.json new file mode 100644 index 00000000000..ae9706b2f41 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_out_of_order_blocks.json @@ -0,0 +1,54 @@ +{ + "name": "single_validator_out_of_order_blocks", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "6" + }, + { + "slot": "5" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "5", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "6", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "7", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_attestation.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_attestation.json new file mode 100644 index 00000000000..4c2a0324871 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_attestation.json @@ -0,0 +1,72 @@ +{ + "name": "single_validator_resign_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "5", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000203" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000203", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "6", + "target_epoch": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000267", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "14", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000203", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_block.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_block.json new file mode 100644 index 00000000000..a44b374ef17 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_resign_block.json @@ -0,0 +1,102 @@ +{ + "name": "single_validator_resign_block", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000097" + }, + { + "slot": "16", + "signing_root": "0x00000000000000000000000000000000000000000000000000000000000000a1" + }, + { + "slot": "17", + "signing_root": "0x00000000000000000000000000000000000000000000000000000000000000ab" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000097", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "16", + "signing_root": "0x00000000000000000000000000000000000000000000000000000000000000a1", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "17", + "signing_root": "0x00000000000000000000000000000000000000000000000000000000000000ab", + "should_succeed": false, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000098", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "15", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "16", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000097", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "17", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000097", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "18", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000097", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "14", + "signing_root": "0x00000000000000000000000000000000000000000000000000000000000000ab", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_single_attestation.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_attestation.json new file mode 100644 index 00000000000..664154bc181 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_attestation.json @@ -0,0 +1,71 @@ +{ + "name": "single_validator_single_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "15", + "target_epoch": "20" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "14", + "target_epoch": "19", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "15", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "16", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "15", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block.json new file mode 100644 index 00000000000..c202665dcb7 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block.json @@ -0,0 +1,58 @@ +{ + "name": "single_validator_single_block", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "32" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "32", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "33", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "31", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation.json new file mode 100644 index 00000000000..a62bd153ad4 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation.json @@ -0,0 +1,104 @@ +{ + "name": "single_validator_single_block_and_attestation", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "32" + } + ], + "signed_attestations": [ + { + "source_epoch": "15", + "target_epoch": "20" + } + ] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "32", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "33", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "31", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "14", + "target_epoch": "19", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "15", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "16", + "target_epoch": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "15", + "target_epoch": "21", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation_signing_root.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation_signing_root.json new file mode 100644 index 00000000000..ac678201cbc --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_single_block_and_attestation_signing_root.json @@ -0,0 +1,36 @@ +{ + "name": "single_validator_single_block_and_attestation_signing_root", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "19", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000002" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_double_vote.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_double_vote.json new file mode 100644 index 00000000000..8b60e85081d --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_double_vote.json @@ -0,0 +1,36 @@ +{ + "name": "single_validator_slashable_attestations_double_vote", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "2", + "target_epoch": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "source_epoch": "2", + "target_epoch": "3", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounded_by_existing.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounded_by_existing.json new file mode 100644 index 00000000000..3b3870246a4 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounded_by_existing.json @@ -0,0 +1,34 @@ +{ + "name": "single_validator_slashable_attestations_surrounded_by_existing", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "0", + "target_epoch": "4" + }, + { + "source_epoch": "2", + "target_epoch": "3" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounds_existing.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounds_existing.json new file mode 100644 index 00000000000..934b1cdf674 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_attestations_surrounds_existing.json @@ -0,0 +1,34 @@ +{ + "name": "single_validator_slashable_attestations_surrounds_existing", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "2", + "target_epoch": "3" + }, + { + "source_epoch": "0", + "target_epoch": "4" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks.json new file mode 100644 index 00000000000..bc6512f1ef2 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks.json @@ -0,0 +1,34 @@ +{ + "name": "single_validator_slashable_blocks", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + { + "slot": "10", + "signing_root": "0x000000000000000000000000000000000000000000000000000000000000000b" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks_no_root.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks_no_root.json new file mode 100644 index 00000000000..485f140c447 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_slashable_blocks_no_root.json @@ -0,0 +1,32 @@ +{ + "name": "single_validator_slashable_blocks_no_root", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + }, + { + "slot": "10" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target.json new file mode 100644 index 00000000000..db4ac97b5b5 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target.json @@ -0,0 +1,30 @@ +{ + "name": "single_validator_source_greater_than_target", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "8", + "target_epoch": "7" + } + ] + } + ] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_sensible_iff_minified.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_sensible_iff_minified.json new file mode 100644 index 00000000000..1d8cb9501c3 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_sensible_iff_minified.json @@ -0,0 +1,51 @@ +{ + "name": "single_validator_source_greater_than_target_sensible_iff_minified", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "5", + "target_epoch": "2" + }, + { + "source_epoch": "6", + "target_epoch": "7" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "5", + "target_epoch": "8", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + }, + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "6", + "target_epoch": "8", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": true, + "should_succeed_complete": true + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounded.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounded.json new file mode 100644 index 00000000000..e95130d1c73 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounded.json @@ -0,0 +1,39 @@ +{ + "name": "single_validator_source_greater_than_target_surrounded", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "5", + "target_epoch": "2" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "6", + "target_epoch": "1", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounding.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounding.json new file mode 100644 index 00000000000..135dbccbdd8 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_source_greater_than_target_surrounding.json @@ -0,0 +1,39 @@ +{ + "name": "single_validator_source_greater_than_target_surrounding", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": true, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [], + "signed_attestations": [ + { + "source_epoch": "5", + "target_epoch": "2" + } + ] + } + ] + }, + "blocks": [], + "attestations": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "source_epoch": "3", + "target_epoch": "4", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/single_validator_two_blocks_no_signing_root.json b/common/eip_3076/interchange-tests/tests/generated/single_validator_two_blocks_no_signing_root.json new file mode 100644 index 00000000000..3dd77bab760 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/single_validator_two_blocks_no_signing_root.json @@ -0,0 +1,40 @@ +{ + "name": "single_validator_two_blocks_no_signing_root", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "steps": [ + { + "should_succeed": true, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "signed_blocks": [ + { + "slot": "10" + }, + { + "slot": "20" + } + ], + "signed_attestations": [] + } + ] + }, + "blocks": [ + { + "pubkey": "0xa99a76ed7796f7be22d5b7e85deeb7c5677e88e511e0b337618f8c4eb61349b4bf2d153f649f7b53359fe8b94a38e44c", + "slot": "20", + "signing_root": "0x0000000000000000000000000000000000000000000000000000000000000000", + "should_succeed": false, + "should_succeed_complete": false + } + ], + "attestations": [] + } + ] +} diff --git a/common/eip_3076/interchange-tests/tests/generated/wrong_genesis_validators_root.json b/common/eip_3076/interchange-tests/tests/generated/wrong_genesis_validators_root.json new file mode 100644 index 00000000000..3cf5e2a0a81 --- /dev/null +++ b/common/eip_3076/interchange-tests/tests/generated/wrong_genesis_validators_root.json @@ -0,0 +1,19 @@ +{ + "name": "wrong_genesis_validators_root", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000001", + "steps": [ + { + "should_succeed": false, + "contains_slashable_data": false, + "interchange": { + "metadata": { + "interchange_format_version": "5", + "genesis_validators_root": "0x0000000000000000000000000000000000000000000000000000000000000000" + }, + "data": [] + }, + "blocks": [], + "attestations": [] + } + ] +} diff --git a/validator_client/slashing_protection/migration-tests/v0_no_enabled_column.sqlite b/common/eip_3076/migration-tests/v0_no_enabled_column.sqlite similarity index 100% rename from validator_client/slashing_protection/migration-tests/v0_no_enabled_column.sqlite rename to common/eip_3076/migration-tests/v0_no_enabled_column.sqlite diff --git a/validator_client/slashing_protection/src/attestation_tests.rs b/common/eip_3076/src/attestation_tests.rs similarity index 100% rename from validator_client/slashing_protection/src/attestation_tests.rs rename to common/eip_3076/src/attestation_tests.rs diff --git a/validator_client/slashing_protection/src/bin/test_generator.rs b/common/eip_3076/src/bin/test_generator.rs similarity index 98% rename from validator_client/slashing_protection/src/bin/test_generator.rs rename to common/eip_3076/src/bin/test_generator.rs index ff5866f9866..bb12c56d548 100644 --- a/validator_client/slashing_protection/src/bin/test_generator.rs +++ b/common/eip_3076/src/bin/test_generator.rs @@ -1,9 +1,9 @@ -use slashing_protection::interchange::{ +use eip_3076::interchange::{ Interchange, InterchangeData, InterchangeMetadata, SignedAttestation, SignedBlock, }; -use slashing_protection::interchange_test::{MultiTestCase, TestCase}; -use slashing_protection::test_utils::{pubkey, DEFAULT_GENESIS_VALIDATORS_ROOT}; -use slashing_protection::SUPPORTED_INTERCHANGE_FORMAT_VERSION; +use eip_3076::interchange_test::{MultiTestCase, TestCase}; +use eip_3076::test_utils::{pubkey, DEFAULT_GENESIS_VALIDATORS_ROOT}; +use eip_3076::SUPPORTED_INTERCHANGE_FORMAT_VERSION; use std::fs::{self, File}; use std::io::Write; use std::path::Path; diff --git a/validator_client/slashing_protection/src/block_tests.rs b/common/eip_3076/src/block_tests.rs similarity index 100% rename from validator_client/slashing_protection/src/block_tests.rs rename to common/eip_3076/src/block_tests.rs diff --git a/validator_client/slashing_protection/src/extra_interchange_tests.rs b/common/eip_3076/src/extra_interchange_tests.rs similarity index 100% rename from validator_client/slashing_protection/src/extra_interchange_tests.rs rename to common/eip_3076/src/extra_interchange_tests.rs diff --git a/validator_client/slashing_protection/src/interchange.rs b/common/eip_3076/src/interchange.rs similarity index 100% rename from validator_client/slashing_protection/src/interchange.rs rename to common/eip_3076/src/interchange.rs diff --git a/validator_client/slashing_protection/src/interchange_test.rs b/common/eip_3076/src/interchange_test.rs similarity index 100% rename from validator_client/slashing_protection/src/interchange_test.rs rename to common/eip_3076/src/interchange_test.rs diff --git a/validator_client/slashing_protection/src/lib.rs b/common/eip_3076/src/lib.rs similarity index 98% rename from validator_client/slashing_protection/src/lib.rs rename to common/eip_3076/src/lib.rs index 825a34cabc7..90947f65a57 100644 --- a/validator_client/slashing_protection/src/lib.rs +++ b/common/eip_3076/src/lib.rs @@ -1,10 +1,10 @@ mod attestation_tests; mod block_tests; mod extra_interchange_tests; -pub mod interchange; pub mod interchange_test; mod parallel_tests; -mod registration_tests; + +pub mod interchange; mod signed_attestation; mod signed_block; mod slashing_database; @@ -130,7 +130,7 @@ impl Display for NotSafe { #[cfg(test)] mod test { - use types::FixedBytesExtended; + use types::{FixedBytesExtended, Hash256}; use super::*; diff --git a/validator_client/slashing_protection/src/parallel_tests.rs b/common/eip_3076/src/parallel_tests.rs similarity index 100% rename from validator_client/slashing_protection/src/parallel_tests.rs rename to common/eip_3076/src/parallel_tests.rs diff --git a/validator_client/slashing_protection/src/registration_tests.rs b/common/eip_3076/src/registration_tests.rs similarity index 100% rename from validator_client/slashing_protection/src/registration_tests.rs rename to common/eip_3076/src/registration_tests.rs diff --git a/validator_client/slashing_protection/src/signed_attestation.rs b/common/eip_3076/src/signed_attestation.rs similarity index 100% rename from validator_client/slashing_protection/src/signed_attestation.rs rename to common/eip_3076/src/signed_attestation.rs diff --git a/validator_client/slashing_protection/src/signed_block.rs b/common/eip_3076/src/signed_block.rs similarity index 100% rename from validator_client/slashing_protection/src/signed_block.rs rename to common/eip_3076/src/signed_block.rs diff --git a/validator_client/slashing_protection/src/slashing_database.rs b/common/eip_3076/src/slashing_database.rs similarity index 100% rename from validator_client/slashing_protection/src/slashing_database.rs rename to common/eip_3076/src/slashing_database.rs diff --git a/validator_client/slashing_protection/src/test_utils.rs b/common/eip_3076/src/test_utils.rs similarity index 100% rename from validator_client/slashing_protection/src/test_utils.rs rename to common/eip_3076/src/test_utils.rs diff --git a/validator_client/slashing_protection/tests/interop.rs b/common/eip_3076/tests/interop.rs similarity index 96% rename from validator_client/slashing_protection/tests/interop.rs rename to common/eip_3076/tests/interop.rs index c32aab55a26..e5f396b0e83 100644 --- a/validator_client/slashing_protection/tests/interop.rs +++ b/common/eip_3076/tests/interop.rs @@ -1,4 +1,4 @@ -use slashing_protection::interchange_test::MultiTestCase; +use eip_3076::interchange_test::MultiTestCase; use std::fs::File; use std::path::PathBuf; use std::sync::LazyLock; diff --git a/validator_client/slashing_protection/tests/main.rs b/common/eip_3076/tests/main.rs similarity index 100% rename from validator_client/slashing_protection/tests/main.rs rename to common/eip_3076/tests/main.rs diff --git a/validator_client/slashing_protection/tests/migration.rs b/common/eip_3076/tests/migration.rs similarity index 97% rename from validator_client/slashing_protection/tests/migration.rs rename to common/eip_3076/tests/migration.rs index 3d4ec7ea9a8..a1b980f65c9 100644 --- a/validator_client/slashing_protection/tests/migration.rs +++ b/common/eip_3076/tests/migration.rs @@ -1,5 +1,5 @@ //! Tests for upgrading a previous version of the database to the latest schema. -use slashing_protection::{NotSafe, SlashingDatabase}; +use eip_3076::{NotSafe, SlashingDatabase}; use std::collections::HashMap; use std::fs; use std::path::{Path, PathBuf}; diff --git a/common/eth2/Cargo.toml b/common/eth2/Cargo.toml index 81666a64216..7fa32d6c9af 100644 --- a/common/eth2/Cargo.toml +++ b/common/eth2/Cargo.toml @@ -29,7 +29,7 @@ reqwest-eventsource = "0.5.0" sensitive_url = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } ssz_types = { workspace = true } test_random_derive = { path = "../../common/test_random_derive" } types = { workspace = true } diff --git a/common/eth2/src/lighthouse_vc/std_types.rs b/common/eth2/src/lighthouse_vc/std_types.rs index ae192312bdb..38ac1a1b2b2 100644 --- a/common/eth2/src/lighthouse_vc/std_types.rs +++ b/common/eth2/src/lighthouse_vc/std_types.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; use types::{Address, Graffiti, PublicKeyBytes}; use zeroize::Zeroizing; -pub use slashing_protection::interchange::Interchange; +pub use eip_3076::interchange::Interchange; #[derive(Debug, Deserialize, Serialize, PartialEq)] pub struct GetFeeRecipientResponse { diff --git a/lighthouse/Cargo.toml b/lighthouse/Cargo.toml index 6a8fa00c1e0..56098f841a7 100644 --- a/lighthouse/Cargo.toml +++ b/lighthouse/Cargo.toml @@ -84,7 +84,7 @@ eth2 = { workspace = true } initialized_validators = { workspace = true } lighthouse_network = { workspace = true } sensitive_url = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } tempfile = { workspace = true } validator_dir = { workspace = true } zeroize = { workspace = true } diff --git a/lighthouse/tests/account_manager.rs b/lighthouse/tests/account_manager.rs index d53d042fa4e..983406f0b0e 100644 --- a/lighthouse/tests/account_manager.rs +++ b/lighthouse/tests/account_manager.rs @@ -17,7 +17,7 @@ use account_utils::{ validator_definitions::{SigningDefinition, ValidatorDefinition, ValidatorDefinitions}, STDIN_INPUTS_FLAG, }; -use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; +use eip_3076::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use std::env; use std::fs::{self, File}; use std::io::{BufRead, BufReader, Write}; diff --git a/testing/web3signer_tests/Cargo.toml b/testing/web3signer_tests/Cargo.toml index b4637b4030f..985b1815422 100644 --- a/testing/web3signer_tests/Cargo.toml +++ b/testing/web3signer_tests/Cargo.toml @@ -22,7 +22,7 @@ reqwest = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } serde_yaml = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } slot_clock = { workspace = true } task_executor = { workspace = true } tempfile = { workspace = true } diff --git a/testing/web3signer_tests/src/lib.rs b/testing/web3signer_tests/src/lib.rs index 4bc0f623461..d6628c1f7cd 100644 --- a/testing/web3signer_tests/src/lib.rs +++ b/testing/web3signer_tests/src/lib.rs @@ -20,6 +20,7 @@ mod tests { use account_utils::validator_definitions::{ SigningDefinition, ValidatorDefinition, ValidatorDefinitions, Web3SignerDefinition, }; + use eip_3076::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use eth2::types::FullBlockContents; use eth2_keystore::KeystoreBuilder; use eth2_network_config::Eth2NetworkConfig; @@ -30,7 +31,6 @@ mod tests { use parking_lot::Mutex; use reqwest::Client; use serde::Serialize; - use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use slot_clock::{SlotClock, TestingSlotClock}; use std::env; use std::fmt::Debug; diff --git a/validator_client/Cargo.toml b/validator_client/Cargo.toml index a8c8fd59f13..4f2d2d0fe3a 100644 --- a/validator_client/Cargo.toml +++ b/validator_client/Cargo.toml @@ -29,7 +29,7 @@ parking_lot = { workspace = true } reqwest = { workspace = true } sensitive_url = { workspace = true } serde = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } slot_clock = { workspace = true } tokio = { workspace = true } tracing = { workspace = true } diff --git a/validator_client/http_api/Cargo.toml b/validator_client/http_api/Cargo.toml index 588aa2ca931..fc48d4e16df 100644 --- a/validator_client/http_api/Cargo.toml +++ b/validator_client/http_api/Cargo.toml @@ -32,7 +32,7 @@ sensitive_url = { workspace = true } serde = { workspace = true } serde_json = { workspace = true } signing_method = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } slot_clock = { workspace = true } sysinfo = { workspace = true } system_health = { workspace = true } diff --git a/validator_client/http_api/src/test_utils.rs b/validator_client/http_api/src/test_utils.rs index feb71c3a467..c49b905b425 100644 --- a/validator_client/http_api/src/test_utils.rs +++ b/validator_client/http_api/src/test_utils.rs @@ -6,6 +6,7 @@ use account_utils::{ }; use deposit_contract::decode_eth1_tx_data; use doppelganger_service::DoppelgangerService; +use eip_3076::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use eth2::{ lighthouse_vc::{http_client::ValidatorClientHttpClient, types::*}, types::ErrorMessage as ApiErrorMessage, @@ -17,7 +18,6 @@ use initialized_validators::{InitializedValidators, OnDecryptFailure}; use lighthouse_validator_store::{Config as ValidatorStoreConfig, LighthouseValidatorStore}; use parking_lot::RwLock; use sensitive_url::SensitiveUrl; -use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use slot_clock::{SlotClock, TestingSlotClock}; use std::future::Future; use std::net::{IpAddr, Ipv4Addr}; diff --git a/validator_client/http_api/src/tests.rs b/validator_client/http_api/src/tests.rs index 7d421cd7d58..d47a8978725 100644 --- a/validator_client/http_api/src/tests.rs +++ b/validator_client/http_api/src/tests.rs @@ -12,6 +12,7 @@ use account_utils::{ random_password_string, validator_definitions::ValidatorDefinitions, }; use deposit_contract::decode_eth1_tx_data; +use eip_3076::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use eth2::{ lighthouse_vc::{http_client::ValidatorClientHttpClient, types::*}, types::ErrorMessage as ApiErrorMessage, @@ -21,7 +22,6 @@ use eth2_keystore::KeystoreBuilder; use lighthouse_validator_store::{Config as ValidatorStoreConfig, LighthouseValidatorStore}; use parking_lot::RwLock; use sensitive_url::SensitiveUrl; -use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use slot_clock::{SlotClock, TestingSlotClock}; use std::future::Future; use std::net::{IpAddr, Ipv4Addr}; diff --git a/validator_client/http_api/src/tests/keystores.rs b/validator_client/http_api/src/tests/keystores.rs index 37f7513f379..54c55311ad5 100644 --- a/validator_client/http_api/src/tests/keystores.rs +++ b/validator_client/http_api/src/tests/keystores.rs @@ -1,6 +1,7 @@ use super::*; use account_utils::random_password_string; use bls::PublicKeyBytes; +use eip_3076::interchange::{Interchange, InterchangeMetadata}; use eth2::lighthouse_vc::types::UpdateFeeRecipientRequest; use eth2::lighthouse_vc::{ http_client::ValidatorClientHttpClient as HttpClient, @@ -10,7 +11,6 @@ use eth2::lighthouse_vc::{ use itertools::Itertools; use lighthouse_validator_store::DEFAULT_GAS_LIMIT; use rand::{rngs::SmallRng, Rng, SeedableRng}; -use slashing_protection::interchange::{Interchange, InterchangeMetadata}; use std::{collections::HashMap, path::Path}; use tokio::runtime::Handle; use types::{attestation::AttestationBase, Address}; diff --git a/validator_client/lighthouse_validator_store/Cargo.toml b/validator_client/lighthouse_validator_store/Cargo.toml index 0f8220bdc9f..8217866d181 100644 --- a/validator_client/lighthouse_validator_store/Cargo.toml +++ b/validator_client/lighthouse_validator_store/Cargo.toml @@ -16,7 +16,7 @@ logging = { workspace = true } parking_lot = { workspace = true } serde = { workspace = true } signing_method = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } slot_clock = { workspace = true } task_executor = { workspace = true } tokio = { workspace = true } diff --git a/validator_client/lighthouse_validator_store/src/lib.rs b/validator_client/lighthouse_validator_store/src/lib.rs index 67af1d73fed..3df2d4aadae 100644 --- a/validator_client/lighthouse_validator_store/src/lib.rs +++ b/validator_client/lighthouse_validator_store/src/lib.rs @@ -1,5 +1,6 @@ use account_utils::validator_definitions::{PasswordStorage, ValidatorDefinition}; use doppelganger_service::DoppelgangerService; +use eip_3076::{interchange::Interchange, InterchangeError, NotSafe, Safe, SlashingDatabase}; use eth2::types::PublishBlockRequest; use initialized_validators::InitializedValidators; use logging::crit; @@ -7,9 +8,6 @@ use parking_lot::{Mutex, RwLock}; use serde::{Deserialize, Serialize}; use signing_method::Error as SigningError; use signing_method::{SignableMessage, SigningContext, SigningMethod}; -use slashing_protection::{ - interchange::Interchange, InterchangeError, NotSafe, Safe, SlashingDatabase, -}; use slot_clock::SlotClock; use std::marker::PhantomData; use std::path::Path; diff --git a/validator_client/slashing_protection/.gitignore b/validator_client/slashing_protection/.gitignore deleted file mode 100644 index 10366122bd3..00000000000 --- a/validator_client/slashing_protection/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -interchange-tests -generated-tests diff --git a/validator_client/src/lib.rs b/validator_client/src/lib.rs index 73dcb793dc9..f27cc5b4a15 100644 --- a/validator_client/src/lib.rs +++ b/validator_client/src/lib.rs @@ -3,11 +3,12 @@ pub mod config; use crate::cli::ValidatorClient; pub use config::Config; +use eip_3076::SlashingDatabase; +use eip_3076::SLASHING_PROTECTION_FILENAME; use initialized_validators::InitializedValidators; use metrics::set_gauge; use monitoring_api::{MonitoringHttpClient, ProcessType}; use sensitive_url::SensitiveUrl; -use slashing_protection::{SlashingDatabase, SLASHING_PROTECTION_FILENAME}; use account_utils::validator_definitions::ValidatorDefinitions; use beacon_node_fallback::{ diff --git a/validator_client/validator_store/Cargo.toml b/validator_client/validator_store/Cargo.toml index 8c5451b2d00..91913c87baf 100644 --- a/validator_client/validator_store/Cargo.toml +++ b/validator_client/validator_store/Cargo.toml @@ -6,5 +6,5 @@ authors = ["Sigma Prime "] [dependencies] eth2 = { workspace = true } -slashing_protection = { workspace = true } +eip_3076 = { workspace = true } types = { workspace = true } diff --git a/validator_client/validator_store/src/lib.rs b/validator_client/validator_store/src/lib.rs index c3b551c249b..96dac6cb3b5 100644 --- a/validator_client/validator_store/src/lib.rs +++ b/validator_client/validator_store/src/lib.rs @@ -1,5 +1,5 @@ +use eip_3076::NotSafe; use eth2::types::{FullBlockContents, PublishBlockRequest}; -use slashing_protection::NotSafe; use std::fmt::Debug; use std::future::Future; use std::sync::Arc;