Move msm metadata encoding to common#420
Conversation
Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
The orchestration layer needs to be able to instantiate StateMachineMetadata, so it makes more sense to move the block encoding to common/ along with the rest of the encoding implementation, instead of having it in msm/ Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
| func BlockRecord(bh BlockHeader, blockData []byte) []byte { | ||
| mdBytes := bh.Bytes() | ||
|
|
||
| buff := make([]byte, len(mdBytes)+len(blockData)+2) |
There was a problem hiding this comment.
I'm just moving code, not implementing this
samliok
left a comment
There was a problem hiding this comment.
i get moving some of the stuff, but for the MSM specific structs shouldn't we keep them in the MSM package?
| validators: 3, | ||
| approvals: []approvalAndTimestamp{ | ||
| {ValidatorSetApproval{NodeID: makeNodeID(99), PChainHeight: 1}, 1}, | ||
| {common.ValidatorSetApproval{NodeID: makeNodeID(99), PChainHeight: 1}, 1}, |
There was a problem hiding this comment.
ValidatorSetApprovals are only used in the msm code? if we move everything to the common repo aren't we back to where we started?
There was a problem hiding this comment.
Right now it's only used in the msm code, but eventually we'll need a way to send it over the wire, which means we might need to move it to be closer to msg.go
| } | ||
| } | ||
|
|
||
| func IdentifyBlockType(nextBlockMD StateMachineMetadata, prevBlockMD StateMachineMetadata, prevSeq uint64) BlockType { |
There was a problem hiding this comment.
same with the StateMachineMetadata doesn't it make sense to keep this in the msm?
There was a problem hiding this comment.
I thought that it might not be ideal that we have encodings of stuff spread out across the entire repo.
Having said that, I think I'll close this PR and see if it's possible to continue implementing the orchestration layer without moving the msm encoding to common.
No description provided.