Skip to content

Conversation

@wen-coding
Copy link
Contributor

No description provided.

Copy link

@starrcara86 starrcara86 left a comment

Choose a reason for hiding this comment

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

good to me

+---------------------------------------+
| block_user_agent (0-255 bytes) |
+---------------------------------------+
| final_cert_len (2 bytes) | ← NEW
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we have this be 1 byte, where it's 0x00 if there's not final_cert and 0x01 if there is a final_cert?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm, 1 byte only encodes up to 255, we will have up to ~1300 bytes for 2000 validators, we can do length * 8, then we can encode the length in 1 byte, what will wincode prefer here?

Copy link
Contributor

Choose a reason for hiding this comment

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

to clarify, I'm saying that final_cert_len shouldn't actually be a len; rather, it should purely denote a bool that states true or false as to whether there exists a final_cert

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

Comment on lines 136 to 137
If `final_cert` is present, it is serialized as a whole using
`wincode::serialize`.
Copy link
Contributor

@ksn6 ksn6 Nov 18, 2025

Choose a reason for hiding this comment

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

we should explicitly write out the serialization format in tabular form as done above.

in particular:

  • notar_aggregate: Option<VotesAggregate> should use a single u8 to denote whether a VotesAggregate is present (i.e., 0x00 if not present and 0x01 if present)

  • by default wincode will use 8 bytes to serialize the length of bitmap; we could probably get away with a fewer number of bytes, right? e.g., would 2 bytes work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


## Summary

This SIMD introduces addition of an Alpenglow finalization certificate to the
Copy link
Contributor

Choose a reason for hiding this comment

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

something is wrong here (grammatically), I don't quite get the sentence.

Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we want to be more specific? we want to say that we add a finalization certificate such that somebody who just observes blocks understands that they are finalized without having to understand the all-to-all communication between the validators.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the suggestion. Changed.

You can also make comments in the Google doc if that's easier.

This shift removes the on-chain visibility previously provided by vote
transactions and vote account state, which zero-staked validators currently
rely on to infer validator delinquency. It also affects any party that depends
on the ability to observe votes on-chain. To address this, Alpenglow SIMD
Copy link
Contributor

@rogerANZA rogerANZA Nov 18, 2025

Choose a reason for hiding this comment

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

(remove "SIMD", it sounds wrong)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

+---------------------------------------+
| block_user_agent (0-255 bytes) |
+---------------------------------------+
| final_cert_present (1 byte) | ← NEW

Choose a reason for hiding this comment

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

It might make sense to use this field to also indicate if the notar and skip reward certs are present. So we are not using additional bytes for them. Maybe we want to roll the reward certs into this SIMD?

Copy link
Contributor Author

@wen-coding wen-coding Nov 20, 2025

Choose a reason for hiding this comment

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

It is chosen this way because this is the natural translation of

struct {
final_cert: Option<FinalCertificate>,
}

from Rust in bincode/wincode serialization.

Copy link
Contributor

Choose a reason for hiding this comment

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

I like @akhi3030 's suggestion, though more strongly prefer avoiding custom serde.

I'm checking with the wincode authors to see whether this is something we can support. For now, though, would rather use different bytes to denote whether different certs are present.

+---------------------------------------+
| block_user_agent_len (1 byte) |
+---------------------------------------+
| block_user_agent (0-255 bytes) |

Choose a reason for hiding this comment

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

in previous SIMDs, the feedback was to keep this field in the end so that all fields have a fixed offset. This SIMD is introducing a new variable field. So at the least, we may want to swap things around so that all the fixed length fields come first and then all the variable length ones.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above, if we swap things around then natural bincode/wincode serialization doesn't work any more, we need to write customized serialization.

+---------------------------------------+
| notar_aggregate_signature (variable) |
+---------------------------------------+
| notar_aggregate_bitmap_len (variable) |
Copy link
Contributor

Choose a reason for hiding this comment

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

notar_aggregate_bitmap_len should be 2 bytes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wrote variable basically because notar_aggregate is optional here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants