Giter Site home page Giter Site logo

postech-dao / simperby Goto Github PK

View Code? Open in Web Editor NEW
67.0 67.0 38.0 1.91 MB

The ultimate BFT blockchain engine for decentralized organizations with powerful trustless interoperability.

License: MIT License

Rust 99.76% Shell 0.24%
blockchain consensus distributed-systems git network protocol rust

simperby's People

Contributors

0xnarumi avatar 2-now avatar byeongjee avatar chemonoworld avatar ever0de avatar f2koi avatar ghkdxofla avatar ham3798 avatar hataehyeok avatar hyeonlewis avatar hyungseok-choi avatar jeonghunp avatar jeongseup avatar jshan94 avatar junha1 avatar just-do-halee avatar kjhman21 avatar milchstra3e avatar nibble2 avatar noname0310 avatar omahs avatar p1n3tree avatar rurumimic avatar sejongk avatar sigridjineth avatar sonminwoo avatar tomtaehoonkim avatar yeomjh00 avatar yoonhokim0527 avatar yuhatown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

simperby's Issues

Design chat system

The ideal medium of the human communication for the DAO (which's using simperby)
will be p2p gossip, not Discord or something.
In order to realize it, simperby should support a chatting system leveraging the existing p2p network.
Also, chat logs for a height will be an important historical record that deserves to be saved in the block of the very height..

Implement in-process version of P2P network

  • No file system, No TCP
  • Use in-process communication channel such as tokio::sync::mpsc
  • Ignore storage directory
  • Use socket addr as an routing identifier of mpsc. A trivial implementation would have a global HashMap<SockAddr, Send>

Add WASM compile CI for `simperby-common`

Those two crates will be imported by the contract side, so there must be no dependencies that breaks WASM compatibility.
Having a CI pipeline that checks such integrity would help.

Research tendermint-rs

Link

As Tendermint is the most likely consensus to adopt, we have to research about the existing implementation of it.
We could either directly use it, or just take it as a reference for our original implementation.

The followings are what we have to research:

  1. There are few unique conditions for our system (described in the tracking issue), so one should thoroughly survey whether tendermint-rs is capable of them.
  2. We should find out how tendermint-rs abstracted (or embed) the network layer, and should be aware of how it differs from our abstraction of networking.
  3. A summary of the final interface they provide is required as well.
  4. What can and cannot be customized.

Make DMS more isolated in a single height

  1. tag the height on the dms key
  2. message (unit of public key sign) contains target height
  3. take height-consistent data in the DMS state (e.g., eligible network users)

Rename vote to non-nil-vote

Due to the special property of Vetomint, it's common to refer both nil votes and non nil votes.
Here we decided the naming rule that is applied universally throughout our project.

  1. Nil vote (NilPrevote, NilPrecommit): the vote for skipping the round.
  2. Non nil vote (NonNilPrevote, NonNilPrecommit): the vote for the proposal
  3. Vote (Prevote, Precommit): either nil vote or non nil vote.

Integrate all commit hashes in block header

/// The hash of aggregation of all the commits for this block.
pub commit_hash: Hash256,
/// The Merkle root of transactions.
pub tx_merkle_root: Hash256,
/// The Merkle root of the chat log.
pub chat_merkle_root: Hash256,
/// The Merkle root of the non-essential state.
pub repository_merkle_root: Hash256,

to

/// The merkle root of all the commits for this block.
pub commit_merkle_root: Hash256,
/// The Merkle root of the state.
pub repository_merkle_root: Hash256,
  1. All commits (tx, agenda, agenda proof, extra-agenda tx, chat) will be wrapped in a single merkle tree. As discussed, I think it's not necessary and even confusing to have separate roots
  2. repository_merkle_root now contains the reserved state as well, though it will not be calculated in the MVP anyway.

Tracking issue for the consensus research

Simperby's consensus MUST be implemented as a simple, safe, and live BFT algorithm.

Conditions

Here are some conditions and relaxations (compared to ordinary blockchain consensuses)

  1. No need for slashing conditions. (No strong accountability needed)
  2. Instant (one-block) finalization.
  3. On-demand block production. (No empty blocks)
  4. Consensus-level yes-or-no choice (This becomes trivial for an asynchronous consensus, as voting for 'reject' equals to the case in the asynchrony, where a node pretends that he's missing the block proposal (which, in fact, he dislikes) because of the network asynchrony.)
  5. Fair chances of block-proposing right are NOT required. (stable leader is OK, and actually desired)
  6. BFT threshold 1/3 is allowed to become smaller.
  7. Synchrony assumptions is also OK to take.
  8. There MUST be a support for the light client verification. (i.e., it must be based on cryptography, not some live observation protocol)

Tracked issues

Relax timestamp condition for CSV

Change the comparison condition to be inclusive.

This will be helpful in testing or if it's not easy to determine the increasing timestamp sequence,
while not compromising any security.

Add 'check_broadcast_status(token)` for network interface

The node operator would check how well his message is broadcasted, and decide whether to turn off his node.
The return value could be

  1. Number of successfully relayed nodes
  2. Some kind of a 'score' that considers how well the relayed nodes will actually relay well, according to their past activities.

I think the option 1 will be sufficient for now.

Design `ConsensusStatus`

simperby_node::ConsensusStatus

It must contain useful information for the user.
Note that ConsensusStatus is strictly for a single height.
It must be print in a nice and human-readable way.

Add `Member::expelled`

/// If true, all voting powers are ignored.
/// Note that once granted, Simperby keeps all members forever in the reserved state.
/// If you want to remove a member, you must set this to true instead of removing the member.
///
/// TODO: consider this in various verification functions.
pub expelled: bool,

Tracking issue for the consensus candidate `interactive-tendermint`

This is a variation of the Tendermint protocol, with few small tweaks.

  1. There is no round timeout. This breaks liveness, but it doesn't really matter because we don't produce block regularly anyway (we even assume that almost every participating nodes stay offline for most of the time)
  2. Pre-vote and Nil-vote are interactive. That is, validators (human) will be requested whether to pre-vote or nil-vote for the given received block proposal. Since there is no timeout, nil-vote is not automatically performed and can be used as a 'veto' as well. Pre-commit will be automatically performed if the user has decided to pre-vote.
  3. The leader round robin order is specified in the blockchain state, and this order won't be shuffled for each block. This is for the stable leader, which makes the consensus process efficient for our case. Note that the order can be explicitly changed by a transaction anyway.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.