Skip to content
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

Merged
merged 4 commits into from
Feb 20, 2020
Merged

Conversation

paulperegud
Copy link
Contributor

No description provided.

Copy link
Contributor

@pdobacz pdobacz left a 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.
Copy link
Contributor

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 and nextChildBlock
  • 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

pnowosie
pnowosie previously approved these changes Jan 27, 2020
Copy link
Contributor

@pnowosie pnowosie left a comment

Choose a reason for hiding this comment

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

Nothing to add 👐

pdobacz
pdobacz previously approved these changes Feb 11, 2020
Copy link
Contributor

@pdobacz pdobacz left a 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?

kevsul
kevsul previously approved these changes Feb 11, 2020
plasma_framework/docs/integration-docs/integration-doc.md Outdated Show resolved Hide resolved
@kevsul
Copy link
Contributor

kevsul commented Feb 11, 2020

Sorry , I had missed this originally.
LGTM, some minor rewording for clarification

@paulperegud
Copy link
Contributor Author

Committed Kevin's suggestion. Please re-review. Need two confirmations to merge.

kevsul
kevsul previously approved these changes Feb 17, 2020
pdobacz
pdobacz previously approved these changes Feb 18, 2020
@@ -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)`.
Copy link
Contributor

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 ...

@paulperegud paulperegud merged commit 23c8658 into master Feb 20, 2020
@boolafish boolafish deleted the paulperegud-patch-1 branch April 16, 2020 06:05
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.

4 participants