From 04cb64b849988c1cf71fd66a3142f01e8ba7cb23 Mon Sep 17 00:00:00 2001 From: Wei-Ning Huang Date: Mon, 11 Mar 2019 15:47:29 +0800 Subject: core: vm: remove delegation mechanism (#245) The current delegation mechanism are prone to unstaking attack. i.e. a malicious attacker could unstake a small amount from a lot of node it staked before and make them unqualified, which leads to potential failure of the network. Since DEXON does not use consensus like DPoS, node is required to have at least MinStake in order to become a node. Voting mechanism is not required in our system since qualified node does not depends on the number of votes. Instead of managing the delegation mechanism in governance contract, we should let the owner manage the delegation and reward distribution mechanism on their own. --- core/genesis.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'core/genesis.go') diff --git a/core/genesis.go b/core/genesis.go index f6935830c..7f2cafbf5 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -302,9 +302,10 @@ func (g *Genesis) ToBlock(db ethdb.Database) *types.Block { for _, addr := range keys { account := g.Alloc[addr] if account.Staked.Cmp(big.NewInt(0)) > 0 { - govStateHelper.Stake(addr, account.PublicKey, account.Staked, + govStateHelper.Register(addr, account.PublicKey, account.NodeInfo.Name, account.NodeInfo.Email, - account.NodeInfo.Location, account.NodeInfo.Url) + account.NodeInfo.Location, account.NodeInfo.Url, + account.Staked) } } -- cgit