docs: task, PoS, task documentation and task structure changes

This commit is contained in:
bahadylbekov 2020-10-31 07:38:51 +03:00
parent 239e54b0dd
commit 54e69e0528
7 changed files with 53 additions and 7 deletions

View File

@ -23,7 +23,7 @@
Dione oracle network is solving the interoperability problem between multiple blockchain networks. Blockchains themself could be describled as deterministic state machine replicated on full-nodes that retains consensus safety. And having the network that handles state changes validation across multiple protocols is crucial for [Secured Finance](https://github.com/Secured-Finance) first-layer transactions execution. Using Dione network Secured Finance could provide completely decentralized service for it's users.
Simple explanation for Dione is a blockchain that tracks the state of another blockchains. Dione network itself has fast-finality because of the pBFT (Practical Byzantine Fault Tolerance) consensus and has a role to establish finality for the blockchain it connects (Ethereum, Bitcoin networks has probabilistic-finality).
Simple explanation for Dione is a distributed network that tracks the state of another blockchains by computing cross-chain tasks. Dione network itself has fast-finality because of the pBFT (Practical Byzantine Fault Tolerance) consensus and has a role to establish finality for the blockchain it connects (Ethereum, Bitcoin networks has probabilistic-finality).
The networking layer of Dione node is based on [libp2p](https://github.com/libp2p/go-libp2p), a flexible cross-platform network framework for peer-to-peer applications. Projects like [ETH2 (Ethereum 2.0)](https://github.com/ethereum/eth2.0-specs), [Filecoin](https://github.com/filecoin-project) and Polkadot's [Substrate](https://github.com/paritytech/substrate) is based on libp2p making it's the standard for future decentralized infrastructures.
@ -53,7 +53,7 @@ DIONE token is a ERC20 token on Ethereum blockchain used as a staking token to r
Staking mechanism would encourage node operators to behave correctly as well as malicious nodes would lose their stakes. In order to run Dione node the operator has to stake at least 10,000 DIONE tokens.
Total supply of DIONE tokens is 2,000,000. By that the maximum amount of nodes participating in Dione is limited to 200 at the initial start of Dione network. 30% of DIONE tokens would be allocated to Secured Finance team.
Initial supply of DIONE tokens is 2,000,000. By that the maximum amount of nodes participating in Dione is limited to 200 at the initial start of Dione network. 30% of DIONE tokens would be allocated to Secured Finance team. On every block Dione miners would get 50 DIONE tokens as the mining reward.
Governance mechanism would take place on [snapshot.page](https://snapshot.page/#/). The main application of governance descision is around required amount of DIONE tokens to stake in order to run Dione node. Additional governance descision could be proposed by DIONE token holders among the way.

View File

@ -45,7 +45,7 @@ type RandomBeacon interface {
func ValidateTaskValues(bSchedule Schedule, t *types.DioneTask, parentEpoch types.TaskEpoch, prevEntry types.BeaconEntry) error {
{
parentBeacon := bSchedule.BeaconForEpoch(parentEpoch)
currBeacon := bSchedule.BeaconForEpoch(t.Height)
currBeacon := bSchedule.BeaconForEpoch(t.Epoch)
if parentBeacon != currBeacon {
if len(t.BeaconEntries) != 2 {
return fmt.Errorf("expected two beacon entries at beacon fork, got %d", len(t.BeaconEntries))
@ -60,8 +60,8 @@ func ValidateTaskValues(bSchedule Schedule, t *types.DioneTask, parentEpoch type
}
// TODO: fork logic
b := bSchedule.BeaconForEpoch(t.Height)
maxRound := b.MaxBeaconRoundForEpoch(t.Height)
b := bSchedule.BeaconForEpoch(t.Epoch)
maxRound := b.MaxBeaconRoundForEpoch(t.Epoch)
if maxRound == prevEntry.Round {
if len(t.BeaconEntries) != 0 {
return fmt.Errorf("expected not to have any beacon entries in this task, got %d", len(t.BeaconEntries))

View File

@ -3,6 +3,7 @@ package consensus
import (
"bytes"
"context"
"sync"
"github.com/Secured-Finance/dione/types"
"github.com/ethereum/go-ethereum/common"
@ -15,6 +16,7 @@ import (
type Miner struct {
address address.Address
api MinerAPI
mutex sync.Mutex
}
type MinerAPI interface {
@ -82,7 +84,7 @@ func (m *Miner) MineTask(ctx context.Context, base *MiningBase, mb *MinerBase) (
ElectionProof: winner,
BeaconEntries: mb.BeaconEntries,
// TODO: signature
Height: round,
Epoch: round,
}, nil
}

13
docs/proof-of-stake.md Normal file
View File

@ -0,0 +1,13 @@
# Dione Proof-of-Stake mechanism
Dione oracle network is the distributed network of nodes. And as any distributed network Dione has a risk that the majority of nodes would act maliciously. In order to reduce this risk and incentivize node operators to behave correctly Dione has Proof-of-Stake mechanism, malicious nodes in the network would lose their stakes. In order to run Dione node the operator has to stake at least 10,000 DIONE tokens. The minimum amount of DIONE tokens might be changed by governance decision.
# DIONE token
DIONE token is a ERC20 token on Ethereum blockchain used as a staking token to run the Dione node and for decentralized governance.
Initial supply of DIONE tokens is 2,000,000. By that the maximum amount of nodes participating in Dione is limited to 200 at the initial start of Dione network. 30% of DIONE tokens would be allocated to Secured Finance team. On every block Dione miners would get 50 DIONE tokens as the mining reward.
# DIONE token governance
Governance mechanism would take place on [snapshot.page](https://snapshot.page/#/). The main application of governance decision is around minimum amount of DIONE tokens to stake in order to run Dione node. Additional governance decision could be proposed by DIONE token holders among the way.

13
docs/randomness.md Normal file
View File

@ -0,0 +1,13 @@
# Randomness in Dione network
“One thing that traditional computer systems arent good at is coin flipping,” says Steve Ward, Professor of Computer Science and Engineering at MITs Computer Science and Artificial Intelligence Laboratory.
Computers act deterministically and most of the time calculates a preudo-random numbers.
In Dione network randomness used to calculate the winner of the consensus round on particular epoch. Using pseudo-random values for such operation could break the consensus behaviour and malicious node could predict the next round winners by flipping the numbers over and over.
Since we can't trust preudo-random numbers generated by the node itself we have to find a way to get as random value as possible.
Dione network uses Drand (dee-rand) - distributed randomness beacon.
You could find more information about Drand using this [link](https://drand.love)

17
docs/task.md Normal file
View File

@ -0,0 +1,17 @@
# Dione network tasks
Task is a computational unit in Dione oracle network. Miners computes the tasks by getting requests from Dione smart contracts on Ethereum chain and making cross-chain operations.
Every task has it's own epoch, miner address who computed the task information corresponding the Dione mining operations, payload that represents the state from another blockchain network, it's own signature etc. (Task types and origin types would be added shortly)
```
type DioneTask struct {
Miner address.Address
Ticket *Ticket
ElectionProof *ElectionProof
BeaconEntries []BeaconEntry
Signature *crypto.Signature
Epoch TaskEpoch
Payload []byte
}
```

View File

@ -25,7 +25,8 @@ type DioneTask struct {
ElectionProof *ElectionProof
BeaconEntries []BeaconEntry
Signature *crypto.Signature
Height TaskEpoch
Epoch TaskEpoch
Payload []byte
}
var tasksPerEpoch = NewInt(config.TasksPerEpoch)