-
Notifications
You must be signed in to change notification settings - Fork 24
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
SignedSSVMessage #345
Merged
Merged
SignedSSVMessage #345
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
3ea4b69
Add SignedSSVMessage
MatheusFranco99 3aebee8
Add SSZ encoding
MatheusFranco99 0fc89ba
Test structures for SignedSSVMessage
MatheusFranco99 f919fda
Test utils and encoding test
MatheusFranco99 5d151fb
Tests
MatheusFranco99 7965ba8
Generate tests
MatheusFranco99 1c3ace2
Adapt message validation
MatheusFranco99 e67c4b5
Fix expected error; Bring back commented tests
MatheusFranco99 e2e279b
Add comment on signature
MatheusFranco99 43da24c
Merge branch 'main' into signed-ssv-msg
MatheusFranco99 9b1750d
Adjust ssz-max in SignedSSVMessage
MatheusFranco99 c74a5c1
Include RSA check in test
MatheusFranco99 b9469eb
Generate JSONs
MatheusFranco99 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ package types | |
//go:generate go run github.com/ferranbt/fastssz/sszgen --path share.go --include ./operator.go,./messages.go,./signer.go,./domain_type.go | ||
|
||
// rm -f ./messages_encoding.go | ||
// go run github.com/ferranbt/fastssz/sszgen --path messages.go --exclude-objs ValidatorPK,MessageID,MsgType | ||
// go run github.com/ferranbt/fastssz/sszgen --path messages.go --include ./operator.go --exclude-objs ValidatorPK,MessageID,MsgType | ||
|
||
//go:generate rm -f ./beacon_types_encoding.go | ||
//go:generate go run github.com/ferranbt/fastssz/sszgen --path beacon_types.go --include $GOPATH/pkg/mod/github.com/attestantio/[email protected]/spec/phase0 --exclude-objs BeaconNetwork,BeaconRole | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
types/spectest/generate/state_comparison/signedssvmsg_EncodingTest/encoding.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"Name": "encoding", | ||
"Data": "AQAAAAAAAAAQAAAAEAEAAJ4RbcE7rt9XkrU0Gz+CmiUMg88fH/b8hB/oHOpFocKDdcWx5Q5xbAjiCHmq8rZtUHzrskOqPoZLsR9UY3LRAlJF9ban+DOnDnmloFi67e82d6EAfk6AYZ1ZNSZinWVYkRvP03J5gk3yRddHhPOWVDc4rwdxGYrTOLNZTTwyMcEiBqrPMrJ2SDwVpmw9RXGdEDNLrpVsuBRsCQKjr+7X1PBijkvmDfZO78uzyELIr/WUXWjgeBt1JK+4EVS2fn6DHY+t4E+kjKOrwsTw/+I6h7onqZa4kN7MM/10Cftu/NRTFhLiSwAxGgu6PcrDfDfmpaqFZgr1kdGrrGp8gDgB4CcBAAAAAAAAAAAAAwGOgAZlUagbMYJYcJ7a990fY81oag5NuLKbu3rP5lYIZ3r1pSfZRI7keDVIXgK1C8AAAAAARAAAAGwAAAC4Hs0i5KpVrepqk99cOgnRwFklXk1z+iLSuhz7kDMpGlKR3Fcf+DnJb/Hl+PSPwFcARY04jz4nVo8NdgTUduo7GOUm+WixamknKtLuJv5boz/EBTmKKiYlItZjiR4ztSABAAAAAAAAAAIAAAAAAAAADAAAAAAAAAAUAAAApHmwI9nyjrnM3TW7lg+1wmVTDf8Xiufkqbd/AX91nKWiEl5ya94M2SozMAlUlMjAB4Kif6iQfowarePazbjgYUaGxn4fYoMEYF14YeDtmAPGriFrSq5VqP+0nu0ZPL6nRiYR0sWSvfUhTxJP56Ummrc9RO/J5s4avjL4GWrlJt4BAAAAAAAAAA==" | ||
} |
12 changes: 12 additions & 0 deletions
12
...rate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg empty signature.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Name": "empty signature", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "", | ||
"Data": "AQIDBA==" | ||
} | ||
], | ||
"ExpectedError": "Signature has length 0 in SignedSSVMessage", | ||
"RSAPublicKey": null | ||
} |
12 changes: 12 additions & 0 deletions
12
...est/generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg no data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Name": "no data", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "AQIDBA==", | ||
"Data": "" | ||
} | ||
], | ||
"ExpectedError": "Data has length 0 in SignedSSVMessage", | ||
"RSAPublicKey": null | ||
} |
12 changes: 12 additions & 0 deletions
12
...ctest/generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg valid.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Name": "valid", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "asg313UXGPJPH1X4S5kFA0mP0EViK+/fiAudKPNWxmgSLAOOZa+zwhUCkd1lI6Mzxta8GsUwxxRekEclK7ipkjqeND6S9M5+EyyKOIXPkv3jaSHSJgy3czrM95vmr+ZEvlFeNVc1ueCVSc4tYn1WPE2Jgv5x2yGiI65gxOptXXUULfwxeTt+N+9nhKwYkHkosHYLEcSzVJ8+VSBLtQUQhZPAIhQBAQU5QO2xlHQaGz3AYoWXf1dMI3fmDJzxxT+We2pwW8mZ5uFiZnKxJKbo0Qjw6Pp8ZGBHAf9+3O3AxHjpwgJq7enmMTPVcgf8igiB4lqPSS2EbpNUBkAo6CyXqg==", | ||
"Data": "AQAAAAAAAAAAAAMBjoAGZVGoGzGCWHCe2vfdH2PNaGoOTbiym7t6z+ZWCGd69aUn2USO5Hg1SF4CtQvAAAAAAEQAAABsAAAAuB7NIuSqVa3qapPfXDoJ0cBZJV5Nc/oi0roc+5AzKRpSkdxXH/g5yW/x5fj0j8BXAEWNOI8+J1aPDXYE1HbqOxjlJvlosWppJyrS7ib+W6M/xAU5iiomJSLWY4keM7UgAQAAAAAAAAACAAAAAAAAAAwAAAAAAAAAFAAAAKR5sCPZ8o65zN01u5YPtcJlUw3/F4rn5Km3fwF/dZylohJecmveDNkqMzAJVJTIwAeCon+okH6MGq3j2s244GFGhsZ+H2KDBGBdeGHg7ZgDxq4ha0quVaj/tJ7tGTy+p0YmEdLFkr31IU8ST+elJpq3PUTvyebOGr4y+Blq5SbeAQAAAAAAAAA=" | ||
} | ||
], | ||
"ExpectedError": "", | ||
"RSAPublicKey": "LS0tLS1CRUdJTiBSU0EgUFVCTElDIEtFWS0tLS0tCk1JSUJJakFOQmdrcWhraUc5dzBCQVFFRkFBT0NBUThBTUlJQkNnS0NBUUVBdU1WaU9YbWZ6aTA5MnZ6aUZrVUkKRHNRdEhLemlRZXh2cDhCa0lBd3R4cXpadFJXT2IzVFp3NG8zbDB3Z2RiQ0wvQzBLUWlMOUFCOGViTUQzUi9UdApFRXJtcEhHdTlDOTY5OTdyNlhtbjk2a3RabjN2RjdXUzN4elFHTytkR2Z0S0hLMG5YdldLVXAvcUJ6KzFFNnBYCkVTeVNHR01lZ2w5L3BSQkdXSEZVZUVXODRDV0ttaWlXVU1aYXBlTE1BalJwK20zTi96Unc3dHVpMmZrVnNFV0UKNGwxck01VlZ1R0JOUFc2dDR3cUJpbDdHY3pHNmpyQ3Z2TDJEZzF6eDM3cUVWZHBkMVBQdjc1VzdQUlVuTzV5NApkVTVwSEZPUENwbmZvRkJENjgwOTZHYW5EU2NTaDRpd3VkeGgyTGg0MmREVzI2eUNQYTQ3OUZXd0NFMk9JVEk1Cjl3SURBUUFCCi0tLS0tRU5EIFJTQSBQVUJMSUMgS0VZLS0tLS0K" | ||
} |
12 changes: 12 additions & 0 deletions
12
.../generate/state_comparison/signedssvmsg_SignedSSVMessageTest/signedssvmsg wrong data.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"Name": "wrong data", | ||
"Messages": [ | ||
{ | ||
"OperatorID": 1, | ||
"Signature": "AQIDBA==", | ||
"Data": "AQIDBA==" | ||
} | ||
], | ||
"ExpectedError": "could not decode SSVMessage from data in SignedSSVMessage: incorrect size", | ||
"RSAPublicKey": null | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
maybe this is a complaint to myself.. but we should have deleted MsgValidation since it is definitely not what the code does at the moment
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.
Sure, let's remove it in another PR