-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore: adds unsafeSignEOTS for testing double signing #193
Conversation
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.
Great work!
eotsmanager/eotsmanager.go
Outdated
@@ -31,6 +31,9 @@ type EOTSManager interface { | |||
// or passPhrase is incorrect | |||
SignEOTS(uid []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) | |||
|
|||
// UnsafeSignEOTS should only be used in e2e tests for demonstration purposes. Use SignEOTS for real operations |
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.
We should mention that UnsafeSignEOTS
does not check double-sign
@@ -31,6 +31,9 @@ type EOTSManager interface { | |||
// or passPhrase is incorrect | |||
SignEOTS(uid []byte, chainID []byte, msg []byte, height uint64, passphrase string) (*btcec.ModNScalar, error) |
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.
We can mention that SignEOTS
should have built-in anti-slashing mechanism to ensure signature for the same height will not be signed twice
itest/e2e_test.go
Outdated
//require.NotNil(t, extractedKey) | ||
//localKey := tm.GetFpPrivKey(t, fpIns.GetBtcPkBIP340().MustMarshal()) | ||
//require.True(t, localKey.Key.Equals(&extractedKey.Key) || localKey.Key.Negate().Equals(&extractedKey.Key)) | ||
_, extractedKey, err = fpIns.TestSubmitFinalitySignatureAndExtractPrivKey(b) |
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 was thinking that maybe we should keep an option to use SignEOTS
within TestSubmitFinalitySignatureAndExtractPrivKey
other than only the unsafe one so that we can test if the slashing protection works
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.
Could you also add logs when duplicated vote from db is sent?
No description provided.