-
Notifications
You must be signed in to change notification settings - Fork 66
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 information about block retrieval #570
Conversation
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.
left a comment, but deferring my review to someone with more hands-on experience with this particular doc. @kevsul perhaps?
@@ -52,7 +52,8 @@ event BlockSubmitted( | |||
|
|||
> ***Note**: For more information about parameter types, return types, valid values, and so on, see the [Plasma Contract API documentation](../contracts/BlockController.md#submitblock).* | |||
|
|||
|
|||
# Block retrieval | |||
To learn what blocks need to be retrieved during sync, compute block numbers by iterating every `childBlockInterval` from `0 + childBlockInterval` up to `nextChildBlock - childBlockInterval`, inclusive. Next, learn their commited hash values by reading `blocks` mapping. |
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.
a couple of points:
- how to get
childBlockInterval
andnextChildBlock
commited hash
-> submitted root of the block Merkle tree (consistent with# Block submission
)reading...mapping
-> I think this deserves listing out as a contract call, similar to this for example
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.
Nothing to add 👐
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.
didn't notice the new commit and got no re-review request. LGTM now @kevsul can you confirm if this is in-line with the rest of the plasma-contracts
repo docs and this file in particular?
Sorry , I had missed this originally. |
Committed Kevin's suggestion. Please re-review. Need two confirmations to merge. |
697c280
to
6d2f02d
Compare
6d2f02d
to
1dc8710
Compare
@@ -52,7 +52,8 @@ event BlockSubmitted( | |||
|
|||
> ***Note**: For more information about parameter types, return types, valid values, and so on, see the [Plasma Contract API documentation](../contracts/BlockController.md#submitblock).* | |||
|
|||
|
|||
# Block retrieval | |||
To learn what blocks need to be retrieved during sync, read `PlasmaFramework.nextChildBlock()` and `PlasmaFramework.childBlockInterval()`. Compute the block numbers by iterating every `childBlockInterval` from `0 + childBlockInterval` up to `nextChildBlock - childBlockInterval`, inclusive. Next, read the Merkle tree root of each block by calling `PlasmaFramework.blocks(blknum)`. |
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.
...Compute the block numbers by iterating
isn't very clear for me. I guess we need to put some math at it.
Block numbers are elements of arithmetic progression with a common difference of childBlockInterval
, starting from ...
No description provided.