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

Update core data types #17

Merged
merged 5 commits into from
Apr 18, 2020
Merged

Update core data types #17

merged 5 commits into from
Apr 18, 2020

Conversation

liamsi
Copy link
Member

@liamsi liamsi commented Apr 17, 2020

closes: #16

Description

This PR aims to align the current core data types, Block and Header, with what we have in the spec with the constraint that we agreed not to tackle immediate execution immediately (no pun intended). Further, I've limited this to all changes that do not change any other parts besides that (e.g. I did not move evidence over to Block.Data as this will make this less contained and more difficult to review). Also I didn't change any hashing hashing logic s.t. none of the current tests break. Both these constraints will be addressed in separate smaller PRs.

liamsi added 2 commits April 17, 2020 21:41
- define `DataAvailabilityHeader` and add to `Block`
- comment about `DataHash` (not true yet)
- define `Message` type
- add `IntermediateStateRoots` and `Messages` to Data
- update comments and add a bunch of TODOs

Signed-off-by: Ismail Khoffi <[email protected]>
types/block.go Outdated
//
// TODO: replace with a dedicated type `IntermediateStateRoot`
// as soon as we settle on the format / sparse Merkle tree etc
IntermediateStateRoots []tmbytes.HexBytes
Copy link
Member Author

Choose a reason for hiding this comment

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

If you wonder about tmbytes.HexBytes: just think of it as []byte (it's just for encoding really).

@liamsi
Copy link
Member Author

liamsi commented Apr 17, 2020

Note that CI currently doesn't run (tests and everything defined under .circleci). I ran all tests locally. Will add using github actions instead of circleci soon. In the meantime I'd recommend enabling circleci for this org!

@liamsi liamsi requested a review from adlerjohn April 17, 2020 21:37
@liamsi
Copy link
Member Author

liamsi commented Apr 17, 2020

closing and reopening to trigger circleci

@liamsi liamsi closed this Apr 17, 2020
@liamsi liamsi reopened this Apr 17, 2020
types/block.go Outdated Show resolved Hide resolved
types/block.go Outdated Show resolved Hide resolved
types/block.go Outdated
Comment on lines 44 to 47
// RowRoot_j = root((M_{j,1} || M_{j,2} || ... || M_{j,2k} ))
RowsRoots [][]byte
// ColumnRoot_j = root((M_{1,j} || M_{2,j} || ... || M_{2k,j} ))
ColumnRoots [][]byte
Copy link
Member

Choose a reason for hiding this comment

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

If there's not a type for hash digests then we should add one. Is there is then []byte can be replaced with it.

Copy link
Member Author

Choose a reason for hiding this comment

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

There is none. At least a type alias would be good! Will add in a followup PR!

@liamsi liamsi requested review from adlerjohn and musalbas April 17, 2020 22:52
@liamsi liamsi merged commit d6095c8 into master Apr 18, 2020
@liamsi liamsi deleted the ismail/align_block_with_spec branch April 18, 2020 07:42
@liamsi liamsi added this to the lazyledger-core 1.0.0-alpha milestone Apr 22, 2020
evan-forbes pushed a commit that referenced this pull request Sep 17, 2021
* unrelated change: update go.mod file

Signed-off-by: Ismail Khoffi <[email protected]>

* Add all non-breaking changes to core types (Block, Header)

- define `DataAvailabilityHeader` and add to `Block`
- comment about `DataHash` (not true yet)
- define `Message` type
- add `IntermediateStateRoots` and `Messages` to Data
- update comments and add a bunch of TODOs

Signed-off-by: Ismail Khoffi <[email protected]>

* Update types/block.go

Co-Authored-By: John Adler <[email protected]>

* consistent json annotation

Signed-off-by: Ismail Khoffi <[email protected]>

Co-authored-by: John Adler <[email protected]>
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.

Data availability fields in block header
2 participants