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

Implement Basic Tipset #8

Closed
ansermino opened this issue Nov 16, 2019 · 2 comments · Fixed by #56
Closed

Implement Basic Tipset #8

ansermino opened this issue Nov 16, 2019 · 2 comments · Fixed by #56
Assignees

Comments

@ansermino
Copy link
Member

ansermino commented Nov 16, 2019

This is simply a set of blocks. The blocks must be stored in order of their corresponding ticket. There seems to be a notion of keys in the Go-flecoin implementation, and a separate CID set in Lotus.

Go-filecoin: https://github.com/filecoin-project/go-filecoin/blob/8345455565fb429ebc2eb7c1e3af03c5f7a92b22/internal/pkg/block/tipset.go

Lotus: https://github.com/filecoin-project/lotus/blob/4f9947a27b974512477342ce092381c40a5e8ac9/chain/types/tipset.go

@dutterbutter
Copy link
Contributor

dutterbutter commented Nov 18, 2019

pub fn NewTipSet {
// The blocks must be distinct (different CIDs), have the same height, and same parent set

// Also sorts tickets from smallest to largest; sorted array so index 0 is the smallest ticket in tipset

// returns TipSet type
}

Will also need to implement fn for identifying and attaching unique tipSetKey

@amerameen amerameen added this to the Sprint 1 milestone Nov 18, 2019
@amerameen amerameen modified the milestones: Sprint 1, Sprint 2 Nov 25, 2019
@dutterbutter
Copy link
Contributor

dutterbutter commented Nov 26, 2019

Included:

tipset methods

  • new() // builds a new TipSet from a collection of blocks
  • at() // returns the i'th block in the tipset
  • equals() // tests whether the tipset contains the same blocks as another

block methods

  • cid() // returns the content id of this block
  • decode_block() // decodes raw cbor bytes into a Block
  • signature_data() // returns the block's bytes without the blocksig for signature creating and verification

tipsetkey methods

  • new() // initialises a new tip_set_key
  • new_from_unique() // initialises a set with CIDs that are expected to be unique
  • equals() // checks whether the set contains exactly the same CIDs as another

ticket methods:

  • sort_keys() // returns the canonical byte ordering of the ticket

vmx pushed a commit to dignifiedquire/forest that referenced this issue Mar 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants