Skip to content

Commit eaa3577

Browse files
Replace allow_partial_import with contains_slashable_data (#9)
1 parent 3730f57 commit eaa3577

File tree

32 files changed

+52
-38
lines changed

32 files changed

+52
-38
lines changed

README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ For example:
2121
"steps": [
2222
{
2323
"should_succeed": true,
24-
"allow_partial_import": false,
24+
"contains_slashable_data": false,
2525
"interchange": {
2626
"metadata": {
2727
"interchange_format_version": "5",
@@ -68,9 +68,8 @@ which are as follows:
6868
against.
6969
* `steps[i].should_succeed: bool`: whether the `steps[i].interchange` given is valid and should
7070
be imported successfully.
71-
* `steps[i].allow_partial_import: bool`: whether the `steps[i].interchange` contains some
72-
slashable data with respect to itself or the existing contents of the database, and therefore
73-
a partial import is justified.
71+
* `steps[i].contains_slashable_data: bool`: whether the `steps[i].interchange` contains some
72+
slashable data with respect to itself or the existing contents of the database.
7473
* `steps[i].interchange: Interchange`: slashing protection interchange data as described
7574
by the spec.
7675
* `steps[i].blocks: [object]`: a list of block signings to be attempted **after**
@@ -115,6 +114,21 @@ Note that the top-level `genesis_validators_root` is not necessarily the same
115114
as the GVR contained in the interchange, to allow us to test the case where
116115
they are mismatched.
117116

117+
## Handling Slashable Data
118+
119+
The `contains_slashable_data` parameter is to be interpreted as follows:
120+
121+
- If `should_succeed` is false, then `contains_slashable_data` is irrelevant
122+
- If `contains_slashable_data` is false, then the given interchange **must** be imported
123+
successfully, and the given block/attestation checks must pass.
124+
- If `contains_slashable_data` is true, then implementations have the option to do one of two
125+
things:
126+
- Import the interchange successfully, working around the slashable data by minification
127+
or some other mechanism. If the import succeeds, all checks must pass and the test
128+
should continue to the next step.
129+
- Reject the interchange (or partially import it), in which case the block/attestation
130+
checks and all future steps should be ignored.
131+
118132
## Downloading the tests
119133

120134
The `tests` directory is released as a versioned `.tar.gz` on the [Releases](https://github.com/eth2-clients/slashing-protection-interchange-tests/releases) page.

tests/generated/duplicate_pubkey_not_slashable.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

tests/generated/duplicate_pubkey_slashable_attestation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": true,
7+
"contains_slashable_data": true,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

tests/generated/duplicate_pubkey_slashable_block.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": true,
7+
"contains_slashable_data": true,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

tests/generated/multiple_interchanges_single_validator_fail_iff_imported.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"should_succeed": true,
30-
"allow_partial_import": true,
30+
"contains_slashable_data": true,
3131
"interchange": {
3232
"metadata": {
3333
"interchange_format_version": "5",

tests/generated/multiple_interchanges_single_validator_single_message_gap.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",
@@ -32,7 +32,7 @@
3232
},
3333
{
3434
"should_succeed": true,
35-
"allow_partial_import": false,
35+
"contains_slashable_data": false,
3636
"interchange": {
3737
"metadata": {
3838
"interchange_format_version": "5",

tests/generated/multiple_interchanges_single_validator_single_message_out_of_order.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",
@@ -27,7 +27,7 @@
2727
},
2828
{
2929
"should_succeed": true,
30-
"allow_partial_import": true,
30+
"contains_slashable_data": true,
3131
"interchange": {
3232
"metadata": {
3333
"interchange_format_version": "5",

tests/generated/multiple_validators_multiple_blocks_and_attestations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

tests/generated/multiple_validators_same_slot_blocks.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

tests/generated/single_validator_genesis_attestation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"steps": [
55
{
66
"should_succeed": true,
7-
"allow_partial_import": false,
7+
"contains_slashable_data": false,
88
"interchange": {
99
"metadata": {
1010
"interchange_format_version": "5",

0 commit comments

Comments
 (0)