Skip to content
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

Alan - New message sizes #398

Merged
merged 23 commits into from
Jun 9, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d59d9a0
Update message structures' ssz sizes
MatheusFranco99 May 14, 2024
dd18cde
Generate ssz files
MatheusFranco99 May 14, 2024
3ef0c4e
Fix roots for create msg tests
MatheusFranco99 May 14, 2024
fd5ed03
Use previous DataSSZ size to keep consistency
MatheusFranco99 May 31, 2024
cea11fa
Generate encoding files
MatheusFranco99 May 31, 2024
61597d8
Fix create message tests' roots
MatheusFranco99 May 31, 2024
e0a96c5
Merge branch 'alan' into alan-new-message-sizes
MatheusFranco99 Jun 5, 2024
2dad06b
Update justification sizes with values from structures hierarchy appr…
MatheusFranco99 Jun 5, 2024
4146e12
Update SSVMessage.Data size with values from hierarchy approach (as i…
MatheusFranco99 Jun 5, 2024
feb937e
Generate SSZ
MatheusFranco99 Jun 5, 2024
ce0aee0
Add generated SSZ leftover from other PRs
MatheusFranco99 Jun 5, 2024
e360d42
Set ssz sizes according to encoded value from tests
MatheusFranco99 Jun 6, 2024
a9d2f7f
Define spec test to check maximum message sizes
MatheusFranco99 Jun 6, 2024
024e6c3
Add "maximum-size" tests
MatheusFranco99 Jun 6, 2024
1d5dbd8
Generate JSON tests
MatheusFranco99 Jun 6, 2024
a1e649d
Add tests for expected sizes
MatheusFranco99 Jun 7, 2024
1a1aee5
Rename max-size test filenames
MatheusFranco99 Jun 7, 2024
4ba3440
Rename MaxMessageTest to StructureSizeTest
MatheusFranco99 Jun 7, 2024
918f92a
Add "Max" to test cases that test maximum sizes
MatheusFranco99 Jun 7, 2024
c869b8a
Generate JSON tests
MatheusFranco99 Jun 7, 2024
839d019
Rename field IsMaxSizeForType to IsMaxSize
MatheusFranco99 Jun 7, 2024
63ba860
Generate JSON tests
MatheusFranco99 Jun 7, 2024
8c13b82
Re-order tests
MatheusFranco99 Jun 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions qbft/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type Message struct {

Root [32]byte `ssz-size:"32"`
DataRound Round // The last round that obtained a Prepare quorum
RoundChangeJustification [][]byte `ssz-max:"13,65536"` // 2^16
PrepareJustification [][]byte `ssz-max:"13,65536"` // 2^16
RoundChangeJustification [][]byte `ssz-max:"13,50624"` // 2^16
PrepareJustification [][]byte `ssz-max:"13,3616"` // 2^16
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Want to look at your ipynb together for this

}

// Creates a Message object from bytes
Expand Down
22 changes: 11 additions & 11 deletions qbft/messages_encoding.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"RoundChangeJustifications": null,
"PrepareJustifications": null,
"CreateType": "CreateCommit",
"ExpectedRoot": "ce830104bddf6905db857b74df322663359c3c4bb31d8f0554b3ff4a78f96dda",
"ExpectedRoot": "d6a58346ff2236d3c5e818d8b9d825a879e78886d895e5b645a20a22d7f50cbb",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"RoundChangeJustifications": null,
"PrepareJustifications": null,
"CreateType": "CreatePrepare",
"ExpectedRoot": "adf79bdbc15b8954cb75f60f3917410106ae8c36bbc3819f3313b4899a684aab",
"ExpectedRoot": "0d1ed244a454b3df5e80fac60ed426ee1d3166534b35cd2f6b1602cddef42ded",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@
],
"PrepareJustifications": null,
"CreateType": "createProposal",
"ExpectedRoot": "310725e97a6c1566433ca70d4ae3ff4b91f8d32809a753ea2c64125a1bb98db2",
"ExpectedRoot": "6eb9a3c33be480e348a745b6f1f21aa719f7ee99434dcf29b0ad3b16ca1aff1a",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,6 @@
}
],
"CreateType": "createProposal",
"ExpectedRoot": "e43422be8b818596733c9492e6e3731a6ea1d9809a8cf1192b2ef0fd6b889c0d",
"ExpectedRoot": "d8692529738f1e107cde1bbf560403c7627d639a8ae56b6bf32dead23c28a775",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"RoundChangeJustifications": null,
"PrepareJustifications": null,
"CreateType": "createProposal",
"ExpectedRoot": "a52caeaa01af9479834aeea962392d6df6ad373565f309700812c4062edb7840",
"ExpectedRoot": "5c523ce76cab4281dd868713e1d4d04427f1a4cd3e5665f86b7ec75aa7f05761",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,6 @@
}
],
"CreateType": "CreateRoundChange",
"ExpectedRoot": "fd7b5fef9c1cc3a1d769f602a1a6d3d776e615d468cc4e38ddc669bb80a81ff8",
"ExpectedRoot": "02575efc3ae03ac4265b5ef81beea896ca404f4843dd289e21e3576fa9065f3a",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,6 @@
}
],
"CreateType": "CreateRoundChange",
"ExpectedRoot": "d31ba4f08c790d96b6951cf632c51923ce3e77fbc896336b1def371476b13743",
"ExpectedRoot": "da8a16c59e5c5a1e454ed318770e64d7e22b9209d1dbddb0445abca459cd5199",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@
"RoundChangeJustifications": null,
"PrepareJustifications": null,
"CreateType": "CreateRoundChange",
"ExpectedRoot": "d31ba4f08c790d96b6951cf632c51923ce3e77fbc896336b1def371476b13743",
"ExpectedRoot": "da8a16c59e5c5a1e454ed318770e64d7e22b9209d1dbddb0445abca459cd5199",
"ExpectedError": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,38 @@
],
"ExpectedRoots": [
[
175,
148,
200,
125,
73,
48,
18,
147,
75,
81,
222,
191,
92,
10,
28,
118,
101,
200,
216,
63,
215,
70,
69,
167,
81,
50,
226,
145,
148,
178,
124,
91,
27,
221,
60,
199,
96,
23,
143,
187,
20,
224,
23,
11,
39,
129,
163,
14,
84,
115,
90,
181,
159
82,
201,
142,
108,
171,
5,
107,
27
]
],
"ExpectedError": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,38 +78,38 @@
],
"ExpectedRoots": [
[
144,
92,
164,
212,
249,
149,
148,
180,
106,
150,
155,
80,
142,
228,
34,
185,
45,
95,
0,
237,
192,
118,
248,
202,
18,
28,
71,
35,
45,
120,
19,
86,
205,
234,
50,
251,
106,
88,
165,
73,
175
159,
130,
238,
114,
16,
81,
27,
96,
6,
67,
19,
76,
253,
206,
142,
76,
9,
11,
142,
54
]
],
"ExpectedError": ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,38 +76,38 @@
"EncodedMessages": null,
"ExpectedRoots": [
[
64,
157,
154,
153,
202,
201,
202,
55,
130,
23,
186,
181,
183,
23,
31,
113,
239,
244,
198,
80,
76,
38,
103,
66,
237,
174,
9,
89,
42,
40,
36,
190,
169,
97,
197,
172,
10,
90,
65,
124,
232,
127,
4,
55,
251,
178,
197
250,
160,
23,
123,
199,
2,
123,
2,
230,
147,
152,
149,
211,
81,
1
]
],
"ExpectedError": ""
Expand Down
Loading
Loading