Convert protocolMetadata, Blacklist and BlockHeader to canoto - #435
Draft
yacovm wants to merge 4 commits into
Draft
Convert protocolMetadata, Blacklist and BlockHeader to canoto#435yacovm wants to merge 4 commits into
yacovm wants to merge 4 commits into
Conversation
yacovm
marked this pull request as draft
July 13, 2026 20:54
yacovm
force-pushed
the
protocolMD
branch
9 times, most recently
from
July 22, 2026 17:03
0532afd to
405e560
Compare
yacovm
marked this pull request as ready for review
July 22, 2026 18:20
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
samliok
approved these changes
Jul 31, 2026
samliok
left a comment
Collaborator
There was a problem hiding this comment.
TestGarbageCollectedWALAppendOutOfOrder is failing
| @@ -227,21 +257,75 @@ func ParseEmptyVoteRecord(rawEmptyVote []byte) (ToBeSignedEmptyVote, error) { | |||
| } | |||
|
|
|||
| func BlockRecordRetentionTerm(record []byte) (uint64, error) { | |||
Collaborator
There was a problem hiding this comment.
should we also canoto the records?
Collaborator
Author
There was a problem hiding this comment.
The point of canoto-ing the protocol metadata and blacklist was that we won't need to parse them in the StateMachineBlock.
If we are to canoto the block records, that's a separate change.
| // requireEqualQuorumRounds compares quorum rounds semantically, avoiding | ||
| // reflect.DeepEqual on canoto-encoded values (whose unexported size cache and | ||
| // nil-vs-empty slices differ between freshly-built and round-tripped values). | ||
| func requireEqualQuorumRounds(t *testing.T, expected, actual []common.VerifiedQuorumRound) { |
Collaborator
There was a problem hiding this comment.
// nil-vs-empty slices differ between freshly-built and round-tripped values
?
Collaborator
Author
There was a problem hiding this comment.
It just means it is different if the test built it or it's a message sent in the test. I will remove it.
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
yacovm
marked this pull request as draft
July 31, 2026 19:28
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Currently, protocol metadata and blacklist are encoded as opaque bytes in the StateMachineBlocks and have a custom serialization format.
This makes it cumbersome and inefficient to extract each time there is a need to read a protocol metadata or blacklist field.
This commit simply converts them to plain structs encoded with canoto, which removes custom serialization code and removes the need to manually deserialize them each time.