snow

package
v0.0.0-...-99e8b4e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

README

Wavelet

Wavelet: https://medium.com/perlin-network/wavelet-beta-df9c738747e2 And the whitepaper: https://wavelet.perlin.net/whitepaper.pdf Based on the original snowball algorithm: https://ipfs.io/ipfs/QmUy4jh5mGNZvLkjies1RWM4YuvJh5o2FYopNPVYwrRVGV The novel aspect is the finalization through peer querying

Coordicity

IOTA got a new iteration: https://blog.iota.org/coordicide-e039fd43a871 described in the whitepaper here: https://files.iota.org/papers/Coordicide_WP.pdf Consensus combines "Fast probabilistic consensus" described by IOTA cofounder and "Cellular consensus"

NKN

Has been using cellular consensu from the beginning, with nice visualizations over here: https://medium.com/nknetwork/the-origin-of-nkn-scalable-moca-consensus-based-on-cellular-automata-20d9985130c0

IDEA:

Given a certain proof, any member can initiate a cellular consensus across the whole network. Only one can be started at a time.

  • But it is still probabilistic consensus, why is that any better then a chain? Or put another way, doesn't it just proof that whatever nr of samples are performed that they all are on this track. Sampling is always a subset
  • What about eclipse attacks, specifically on kademlia, what if a node gets isolated? It can be tricked into thinking there has been consensus on a certain block?
  • What happens to the dag when snowball is running, is there a rule that makes them all build on the critical transaction? or stop the world?
  • what if a majority of the network is behind when snowball is running? It is synchronous so everyone needs to be a the same spot?
The Parts
  • Gossip: to exchange blocks with N transactions to form a...
  • Graph: where each vertex is a block, referencing M parents. Its structure should allow for...
  • Tip-Selection: such that new blocks can be proposed and broadcasted using the gossip protocol. This gives us...
  • Probabilistic consensus: some economic certainty on the transaction order. Once in a while this requires....
  • Finalization: where every one synchronously/interactively decides that a part of the graph is final.

The graph is kept in memory, if it is possible to use a finalization mechanism to snapshot the state

Finalization

Finalization of a round (or generation) means that it is impossible for any late arriving block (however perfect) to change the order of the data in that round. This means that adding blocks should give it more value whenever new blocks arrive.

synchronous finalization: You had to be there to believe it, we agreed. asynchronous finalization: if you look at the structure i think you would agree. But what if not everyone has information encoded into the chain to prove this.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NilC = CID{}

NilC is the empty choice (no decision)

Functions

This section is empty.

Types

type CID

type CID [32]byte

CID represents the identity of a choice

type MemNetQuerier

type MemNetQuerier struct {
	// contains filtered or unexported fields
}

MemNetQuerier implement querying from in-memory snow instances

func NewMemNetQuerier

func NewMemNetQuerier(seed int64) (q *MemNetQuerier)

NewMemNetQuerier initiations the querier

func (*MemNetQuerier) Add

func (q *MemNetQuerier) Add(s *Snow)

Add a snow instance

func (*MemNetQuerier) Query

func (q *MemNetQuerier) Query(c CID, k int) (p Pref)

Query the memory network

type Pref

type Pref map[CID]int

Pref describes the prefence over a set of values

func (Pref) Count

func (p Pref) Count(id CID) (c int)

Count returns how high the preference is for a given choice

func (Pref) Size

func (p Pref) Size() (s int)

Size returns the nr of keys times the count for each key

type Querier

type Querier interface {
	Query(c CID, k int) Pref
}

Querier allows asking neighbours for a sample of at least K preferences

type QuerierFunc

type QuerierFunc func(c CID, k int) Pref

QuerierFunc implements the querier with just a function

func (QuerierFunc) Query

func (qf QuerierFunc) Query(c CID, k int) Pref

Query neighbours for at least a k size preference

type Snow

type Snow struct {
	// contains filtered or unexported fields
}

Snow allows a network to reach consensus on a set of values using cellular Automata logic.

func NewSnow

func NewSnow(q Querier, k, kα, β int) (s *Snow)

NewSnow initializes a new snow decision algorithm. k, α, β are configuration constants.

func (*Snow) Decide

func (s *Snow) Decide() (c CID)

Decide runs a new iteration of the snowball algorithm. It impements snowball as defined in figure 3 of the original avalanche paper.

func (*Snow) Decided

func (s *Snow) Decided() CID

Decided returns the accepted choice

func (*Snow) Query

func (s *Snow) Query(c CID) CID

Query responds to a peer with this nodes current preference

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL