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

update consensus mechanism to PoS+ #26

Closed
Jaguar0625 opened this issue Feb 5, 2019 · 11 comments

Comments

@Jaguar0625
Copy link
Member

commented Feb 5, 2019

PoI does not scale well, so we need a simpler way to measure “importance”. It also ignores many smaller accounts and transactions.

One idea is to use fees paid as a proxy of activity. The importance boost via paying higher fees would be limited to a certain percentage of course.

Will probably also need to add back some balance vesting.

@Jaguar0625 Jaguar0625 added this to the dragon milestone Feb 8, 2019

@shizuilab

This comment has been minimized.

Copy link

commented Feb 14, 2019

As a scientist working in a lab, I think that evaluation of multiple parameters used in the PoI calculation need some amount of re-consideration before elimination. Using total amount of fees paid in one account's activities is a possible replacement, however, there will be pitfalls. For example, creating a large number of transactions in a closed group of fake-accounts can increase their importance very easily. They will take most of the transaction fees produced in the NEM network.

Current PoI calculation does not seem to be working properly. NCDawareRank values have little effect on importance calculation, and, this makes NEM PoI much similar to PoS. To make PoI act as expected, current PoS like settings of parameters should be changed.

  1. Reduction of the minimal amount of XEM (10,000) required to attend to harvesting as well as minimal transaction amount 1,000 will stimulate the motivation of NEMbers with small amount of XEMs in their wallets.

  2. Changing PoI parameters, especially w1 which determines contribution of NCDawareRank, to higher value will give more chance to the people creating transactions rather than staking them.

These two changes will have positive impacts on the NEM importance calculation, however, simultaneously will increase the loads of the NIS nodes.

I would recommend NEM Labs and/or NEM Foundation to promote collaboration with some university or research laboratories to simulate effects of these changes on network traffic.

Shizuilab

@gimer

This comment has been minimized.

Copy link
Member

commented Feb 19, 2019

parameters are one thing, but doesn't answer more fundamental question:

PoI does not scale well

@shizuilab

This comment has been minimized.

Copy link

commented Mar 28, 2019

I have too little information about the fundamental question. So, I can only guess what is happening. First, the current importance can be easily calculated by the following formulation.

importance=0.0000000001*vestedXEM + 0.000007

0.0000000001*vestedXEM part looks like PoS. The intercept 0.000007 comes from the NCDawareRanking and the outlink matrix, but, these two parts are not working well with current parameter settings. Then, they are simply adding small bonus to all the accounts having 10000 vested XEMs.

This simple bonus system (PoS+intercept) works, because, the importance can be earned most efficiently when an account has 10000 vested XEMs. But, this system will fail, when the majority of the XEMs will be divided into many accounts with 10000 vested XEMs. This seems to be the reason of 'PoI does not scale well', right?

@gimer

This comment has been minimized.

Copy link
Member

commented Mar 28, 2019

importance=0.0000000001*vestedXEM + 0.000007 - I don't know where did you took that from, but that is not importance... (and that has nothing to do with PoI)

Please take a look at Technical reference for details how poi works: https://nem.io/wp-content/themes/nem/files/NEM_techRef.pdf

The reason poi does not scale well is Outlink matrix. Even with 10k limit, in worst case you might end up with ~900k accounts... collecting transactions for such amount of accounts, creating the outlink matrix and calculating power iteration would take ages

(not to mention case you're mentioning with 1k requirement, that would result in worst case 9M accounts)

@shizuilab

This comment has been minimized.

Copy link

commented Mar 28, 2019

Thank you for your reply and link. I read the every part of NEM technical reference to understand what the NEM network is. It took almost 3 months for me including setting up NIS nodes (both main and test nets), and, all the parts of NEM tech ref. were translated into Japanese with my comments in nemlog. I read some of the listed references to understand better the mechanisms of proof of importance. By doing this, I could understand what Outlink Matrix is, but, I did not know how it is calculated.

With your kind comment, now I can understand the meaning of 'poi does not scale well'. Calculation of outlink matrix is the problem. So, the question is how we can handle it with simpler way.

My approach was like this. 'Importance = 0.0000000001*vestedXEM + 0.000007' is an approximation formula obtained from data of nem blockchain explorer (http://explorer.nemchina.com/#/accountlist). I took pairs of balance and importance of all the eligible accounts listed there and plotted them. Interestingly, most of the accounts plotted on or close to a linear line, and, that was the formulation described above. So, it is not importance, but, how it looks like with current settings of parameters and number of eligible accounts. I think this formulation can be a replacement.

I put a link to the nemlog in which I made two charts of balance vs importance, here.
(I hope the Japanese-English translation will help.)

It also scales well. Even if the number of accounts becomes larger like 9M, you can simply reduce the amount of bonus (0.000007 with 16k accounts, now) to make the sum of the importances to 1.0. Of course, you can put additional conditions, such as at least one transaction in the last 1 hour to get the bonus.

@shizuilab

This comment has been minimized.

@gimer

This comment has been minimized.

Copy link
Member

commented Apr 1, 2019

ok, so if I understand correctly the proposal is to basically tie importance to vestedXem - that is good one, cause we have also considered this ;-)

that however still might be problematic, but will get back to this at some other time

@shizuilab

This comment has been minimized.

Copy link

commented Apr 2, 2019

Thank you gimer-san. Yes, the basic concept is
image
, where importance can be simply calculated from vested amount of XEM.

But, some trick can be added to this. You can give 70000 bonus only to the active accounts (at least one transaction in near history). This can easily give them a motivation to keep making transactions, especially when they have small amount of vestedXEMs.

I am truly appreciate you for considering my proposal. Thank you very much.

@cryptonit

This comment has been minimized.

Copy link

commented May 10, 2019

why not update to a model where running a active harvesting node need 3 million XEM as it is now in the temporary supernode program. this way longterm u secured a stable node backbone. i dont think a zero inflation coin like XEM need to generate any kind of interest for non active node operators. this would solve all scaling issuses of potential to many accounts and reduce it to a few hundrets (still way more decentralized than many other POS blockchains)

@Jaguar0625

This comment has been minimized.

Copy link
Member Author

commented Jun 12, 2019

Proposal

Calculate three sub scores for all high balance accounts:

  1. Stake Score (S'): Percentage of effective balance of all high value accounts at time P.
  2. Transaction Score (T'): Percentage of total transaction fees among all high value accounts in period P-1 to P.
  3. Node Score (N'): Percentage of total beneficiaries among all blocks in P-1 to P.

Combination of Activity Score and Node Score have a multiplier effect when Stake Score is low but be insignificant when Stake Score is high. In order to match NIS1 observations, the influence should drop sharply between effective balances of 10K to 100K and phase out almost entirely at 200K.

General Algorithm
Given the following constants:

  1. a [0.05] - Network wide contribution of activity score
  2. p [10000] - Constants to tune phasing out of activity score
  3. t [0.8] - Transaction score multiplier
  4. n [0.2] - Node score multiplier

Importance can be calculated for each account as:

(1 - a) * (S') + a * || p / (S') * (t * (T') + n * (N')) ||
=> 0.95 * (S') + 0.05 * || 10000 / (S') * (0.8 * (T') + 0.2 * (N')) ||

gimer pushed a commit that referenced this issue Jun 28, 2019
catapultbot
Elephant 1 (Loxodonta africana) - 28-June-2019
### Added
 - PoS+ consensus mechanism, see #26 for details

### Changed
 - Breaking, all transaction versions are now 1
 - Rename `property` transaction/plugin to `restriction account`

### Fixed
 - Deadlock in broker process, due to small number of threads in thread pool

### Removed
 - Mongo mapping functions from model to dbmodel
gimer pushed a commit that referenced this issue Jun 28, 2019
catapultbot
Elephant 1 (Loxodonta africana) - 28-June-2019
### Added
 - PoS+ consensus mechanism, see #26 for details

### Changed
 - Breaking, all transaction versions are now 1
 - Rename `property` transaction/plugin to `restriction account`

### Fixed
 - Deadlock in broker process, due to small number of threads in thread pool

### Removed
 - Mongo mapping functions from model to dbmodel
@Jaguar0625

This comment has been minimized.

Copy link
Member Author

commented Jun 28, 2019

initial implementation is prepared (1d3ef7f) but will be tweaked in future.

@Jaguar0625 Jaguar0625 closed this Jun 28, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.