-
Notifications
You must be signed in to change notification settings - Fork 283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for slashing interchange format tests #8185
Add support for slashing interchange format tests #8185
Conversation
8102518
to
2c47da1
Compare
Regarding the |
Not comfortable ignoring the |
Yeah, I wasn't sure what needs to be done on that part. |
620a4ae
to
6a2a7b6
Compare
From description: If
We do the 1st option so I think nothing could be added as far as we match test result |
@@ -47,7 +47,10 @@ public static Stream<TestDefinition> findReferenceTests() throws IOException { | |||
private static Stream<TestDefinition> findTestTypes(final Path specDirectory) throws IOException { | |||
final String spec = specDirectory.getFileName().toString(); | |||
if (spec.equals("bls")) { | |||
return new BlsRefTestFinder().findTests(TestFork.PHASE0, spec, specDirectory); | |||
return new BlsRefTestFinder().findTests("", spec, specDirectory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this findTests
doesn't use fork at all, maybe remove parameter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is an interface method though, not sure how best to refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh sorry, haven't checked this
ok, it's a tests
return new BlsRefTestFinder().findTests("", spec, specDirectory); | ||
} | ||
if (spec.equals("slashing-protection-interchange")) { | ||
return new SlashingProtectionInterchangeRefTestFinder().findTests("", spec, specDirectory); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this findTests
uses fork in creating TestDefinition
, but inits it with bad fork actually. if createSpec()
is called, it will throw, confusing too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how I can change this without a bigger refactor. If we wrongly use Spec
when we don't need to, we will fail anyways.
TestDataUtils.loadJson(testDefinition, testDefinition.getTestName(), TestData.class); | ||
|
||
// our implementation fails when importing one of the keys in an interchange, which is already | ||
// in our slashprotection directory with a different genesis validators root. However, the test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add the name of the test which covers this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually there is no test for this, will add it.
da5389e
to
7882df3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Description
As per https://github.com/eth-clients/slashing-protection-interchange-tests
Things to note:
should_succeed_complete
containsSlashableData
. Seems we have no problems importing anyways.Fixed Issue(s)
fixes #7784
Documentation
doc-change-required
label to this PR if updates are required.Changelog