Skip to content

Conversation

@whyrusleeping
Copy link
Member

No description provided.

```go
type BlockSyncRequest struct {
Start Cid
Start []Cid
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add a comment that this means the tipset, otherwise not really clear

```

The response contains the chain of requested blocks, in reverse iteration order, the zero'th block should be the block referenced by `request.Start`, and the following N blocks should be its N parents, and so on. This is done to streamline validation.
The response contains the requested chain in reverse iteration order. Each item in the `Chain` array is contains the blocks for that tipset if the `Blocks` option bit in the request was set, and if the `Messages` bit was set, the messages across all blocks in that tipset. The `MsgIncludes` array contains one array of integers for each block in the `Blocks` array. Each of the arrays in `MsgIncludes` contains a list of indexes of messages from the `Messages` array that are in each `Block` in the blocks array.
Copy link
Contributor

Choose a reason for hiding this comment

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

"is contains" is really hard to parse

Copy link
Contributor

Choose a reason for hiding this comment

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

might be good to have a tiny example to make sure it is clear how this indexing works

Blocks: [b0, b1]
Messages: [m0, m1, m2]
MsgIncludes: [[0, 1], [1, 2, 0]]

matches to

Block 0: [m0, m1]
Block 1: [m1, m2, m0]

@whyrusleeping whyrusleeping merged commit 8116630 into master May 11, 2019
@whyrusleeping whyrusleeping deleted the feat/msg-sync branch May 11, 2019 18:22
@whyrusleeping
Copy link
Member Author

feedback addressed and merged!

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.

3 participants