-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add P-Chain ctx into inner block and verify within snow pkg #1897
Conversation
b4ec9ce fixes a bug where the block implements Needed to add the covariant version of |
ref on ProposerVM: https://github.com/ava-labs/avalanchego/tree/master/vms/proposervm#snowman-congestion-control-for-snowman-vms We need the ProposerVM block context to verify chunk signatures for DSMR and for ICM signature verification. |
chain/stateless_block.go
Outdated
@@ -20,6 +21,8 @@ type StatelessBlock struct { | |||
Tmstmp int64 `json:"timestamp"` | |||
Hght uint64 `json:"height"` | |||
|
|||
BlockContext *block.Context `json:"pChainHeight"` |
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.
Should we change the struct tag from json:"pChainHeight"
to json:"blockContext"
?
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.
same thought here. The inner BlockContext object would already have a json field name PChainHeight
.
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.
Ya good callout
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.
It only contains P-Chain height, but this would be better
This PR adds the P-Chain context into the inner block.
This embeds it directly into the inner block, so that it's always available to the inner block. By adding this into the inner block interface, we can verify it against the consensus context in the snow package, so that the inner VM/chain does not need to.