GithubHelp home page GithubHelp logo

qosgroup / qos Goto Github PK

View Code? Open in Web Editor NEW
24.0 14.0 20.0 5.31 MB

qos公链实现

License: Apache License 2.0

Makefile 0.04% Go 25.86% Dockerfile 0.04% Shell 0.01% HTML 0.12% JavaScript 73.92% QMake 0.02%

qos's Issues

验证人总数限制 和 每块验证人的数量 的关系

我们可以在改进后续版本的经济模型时考虑这样一个问题:

假设非验证人的全节点无法接受其他节点的代理,那么如果验证人总数有限制,且数量较少,造成绑定token门槛较高时,全节点往往无法通过自绑定token排序来达到成为验证人的要求。

但如果每块验证人较少,又可以提高出块的效率。

可否考虑这样一种机制,持有较少的token也可以成为验证人,但并非需要验证每一块,且验证块的机会相对公平。


当然也可以考虑让持有较少token的节点先成为验证人,在一定时间后再判断其是否达到绑定要求。

每次中继查询都打印如此多的日志,默认配置应该不是这个日志级别。

height:26115 "
I[11-19|01:53:42.394] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> ]" returns="[<core_types.ResultABCIQuery Value> ]"
I[11-19|01:53:42.394] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.66:59142
I[11-19|01:53:42.397] ABCIQuery module=rpc path=/store/qcp/key data=73657175656E63652F696E2F71737461727372616365 result="key:"sequence/in/qstarsrace" value:"\216\005" proof:"\314\003\n#\n\003acc\022\034\n\032\010\206\230\003\022\0248\276\301B\265\376\314\331\310v\203\034\217\315\372$d\204\302\342\n$\n\004base\022\034\n\032\010\206\230\003\022\024\2721!\300v\246\334\223T\0023\020\215>p[x\204\3553\n\021\n\007approve\022\006\n\004\010\206\230\003\n)\n\tvalidator\022\034\n\032\010\206\230\003\022\024w\264\002\003\326\254y\354\222\264\375\370c\010k~\217\233-\027\n#\n\003qcp\022\034\n\032\010\206\230\003\022\024G0j\275\216\217\233R1\202\017\326\263\242\317\210\367fx\326\022\003qcp\032\226\002\n\037\010\024\020\224\005\030\206\230\003
\024\031\251wE;r[\017\332\367\000\205j\3173\277\241\242\207H\n\037\010\020\020\344\001\030\206\230\003*\024\316\310\235P\307\032\224+\022\314\025\350GO\014\262\355\214\310\356\n\036\010\014\020H\030\206\230\003*\024\356v^\033\007\235Q0j\246\210\212\022,&\\R\350\231\225\n\036\010\n\020\036\030\206\230\003*\024t\013u\227;\250\303}\254\260\216\205:\270\2526i\013\302\n\036\010\006\020\014\030\206\230\003*\024\347\306l\035\202\267wh\002\372\361^\341\037\271\372\362z\273\225\n\036\010\004\020\010\030\206\230\003*\024\230\371G\325\321\3550\274[\316v{\260\t\224\205\021\010\232\232\n\036\010\002\020\004\030\206\230\003\"\024\365k\203\t\254J5\353\t\354\347\210\013\231u\0014\327\344 \0322\n\026sequence/in/qstarsrace\022\024#^\002\260,\005\"\000H\316\033\207\371\302\354%<\326\232\200\030\206\230\003" height:26115 "
I[11-19|01:53:42.397] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> ]" returns="[<*core_types.ResultABCIQuery Value> ]"
I[11-19|01:53:42.397] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.66:58718
I[11-19|01:53:42.399] ABCIQuery module=rpc path=/store/qcp/key data=73657175656E63652F6F75742F71737461727372616365 result="key:"sequence/out/qstarsrace" value:"\216\005" proof:"\315\003\n#\n\003acc\022\034\n\032\010\206\230\003\022\0248\276\301B\265\376\314\331\310v\203\034\217\315\372$d\204\302\342\n$\n\004base\022\034\n\032\010\206\230\003\022\024\2721!\300v\246\334\223T\0023\020\215>p[x\204\3553\n\021\n\007approve\022\006\n\004\010\206\230\003\n)\n\tvalidator\022\034\n\032\010\206\230\003\022\024w\264\002\003\326\254y\354\222\264\375\370c\010k
\217\233-\027\n#\n\003qcp\022\034\n\032\010\206\230\003\022\024G0j\275\216\217\233R1\202\017\326\263\242\317\210\367fx\326\022\003qcp\032\227\002\n\037\010\024\020\224\005\030\206\230\003*\024\031\251wE;r[\017\332\367\000\205j\3173\277\241\242\207H\n\037\010\020\020\344\001\030\206\230\003*\024\316\310\235P\307\032\224+\022\314\025\350GO\014\262\355\214\310\356\n\036\010\014\020H\030\206\230\003*\024\356v^\033\007\235Q0j\246\210\212\022,&\\R\350\231\225\n\036\010\n\020\036\030\206\230\003*\024t\013u\227;\250\303}\254\260\216\205:\270\2526i\013\302\n\036\010\006\020\014\030\206\230\003*\024\347\306l\035\202\267wh\002\372\361^\341\037\271\372\362z\273\225\n\036\010\004\020\010\030\206\230\003\"\0241u\211\352\357\215\370\\265\\307)\\215\\035\\347\\206\\234#!'b\\n\\036\\010\\002\\020\\004\\030\\206\\230\\003*\\024\\225P\\251\\177\\372\\236l(\\277\\005zRiV\\253J\\235\\\\\\310w\\0323\\n\\027sequence/out/qstarsrace\\022\\024#^\\002\\260,\\005\\\"\\000H\\316\\033\\207\\371\\302\\354%<\\326\\232\\200\\030\\206\\230\\003\" height:26115 " I[11-19|01:53:42.399] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> <int64 Value> <bool Value>]" returns="[<*core_types.ResultABCIQuery Value> <error Value>]" I[11-19|01:53:42.399] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.67:37880 I[11-19|01:53:42.400] ABCIQuery module=rpc path=/store/qcp/key data=74782F6F75742F717374617273726163652F333237 result="key:\"tx/out/qstarsrace/327\" value:\"\\374/\\361W\\n\\201\\001\\np\\001\\275\\002#\\n+B\\023\\n\\010qcp.from\\022\\007qosraceB\\024\\n\\006qcp.to\\022\\nqstarsrace\\020\\216\\005\\032:heigth:26470,hash:0F8787CB59C90E33893F53C042B8165D428AA590\\032\\nqstarsrace\\\"\\0010\\022\\007qosrace\\032\\nqstarsrace \\216\\0050\\206\\230\\003@\\001\" proof:\"\\254\\004\\n#\\n\\003acc\\022\\034\\n\\032\\010\\206\\230\\003\\022\\0248\\276\\301B\\265\\376\\314\\331\\310v\\203\\034\\217\\315\\372$d\\204\\302\\342\\n$\\n\\004base\\022\\034\\n\\032\\010\\206\\230\\003\\022\\024\\2721!\\300v\\246\\334\\223T\\0023\\020\\215>p[x\\204\\3553\\n\\021\\n\\007approve\\022\\006\\n\\004\\010\\206\\230\\003\\n)\\n\\tvalidator\\022\\034\\n\\032\\010\\206\\230\\003\\022\\024w\\264\\002\\003\\326\\254y\\354\\222\\264\\375\\370c\\010k~\\217\\233-\\027\\n#\\n\\003qcp\\022\\034\\n\\032\\010\\206\\230\\003\\022\\024G0j\\275\\216\\217\\233R1\\202\\017\\326\\263\\242\\317\\210\\367fx\\326\\022\\003qcp\\032\\366\\002\\n\\037\\010\\024\\020\\224\\005\\030\\206\\230\\003\\\"\\024\\301P\\376\\342\\234\\364\\005\\214\\203p7r\\242\\346D\\315\\025\\235\\ns\\n\\037\\010\\022\\020\\260\\003\\030\\206\\230\\003\\\"\\024\\202\\032\\245C\\250\\250p\\036VkX\\3421\\366\\014\\354\\177\\326g\\357\\n\\037\\010\\020\\020\\322\\001\\030\\206\\230\\003*\\024\\027\\273z}\\002nj=\\330\\361S\\033\\244\\255\\276\\356i\\000\\364\\331\\n\\036\\010\\016\\020f\\030\\206\\230\\003\\\"\\024\\t>\\321\\252cg@\\271\\374\\214{\\031N\\223\\222\\247*\\257\\3573\\n\\036\\010\\014\\0208\\030\\206\\230\\003*\\024J\\006\\310\\252\\201K\\307[\\247\\024v\\314\\356\\217\\363\\\\u3\\020n\\n\\036\\010\\n\\020 \\030\\206\\230\\003*\\024aI'\\224\\202\\242\\223\\326\\003Vl|\304;\020\240\343D-\n\036\010\010\020\022\030\206\230\003\"\024\3602S\031=\337\000\342\031\245q\270\331\304\226\257\267\357\237?\n\036\010\006\020\n\030\206\230\003\"\024Q;P\177\"\326\214\330\210\331t\367\353\020\200iY8\032\345\n\036\010\004\020\006\030\206\230\003\"\024\006\026-x1\030@%\253S\227+=\244\026t'aJ\n\036\010\002\020\004\030\206\230\003\"\024/05@P\356s-\r\006\367\216\236:\320t|\204Q\242\0321\n\025tx/out/qstarsrace/327\022\024\014\324B\330\205C]\204T\322\265\262?\0344\330\002\027\332\213\030\206\230\003" height:26115 "
I[11-19|01:53:42.400] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> ]" returns="[<*core_types.ResultABCIQuery Value> ]"
I[11-19|01:53:42.400] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.67:37880
I[11-19|01:53:42.403] ABCIQuery module=rpc path=/store/qcp/key data=73657175656E63652F6F75742F71737461727372616365 result="key:"sequence/out/qstarsrace" value:"\216\005" proof:"\315\003\n#\n\003acc\022\034\n\032\010\206\230\003\022\0248\276\301B\265\376\314\331\310v\203\034\217\315\372$d\204\302\342\n$\n\004base\022\034\n\032\010\206\230\003\022\024\2721!\300v\246\334\223T\0023\020\215>p[x\204\3553\n\021\n\007approve\022\006\n\004\010\206\230\003\n)\n\tvalidator\022\034\n\032\010\206\230\003\022\024w\264\002\003\326\254y\354\222\264\375\370c\010k
\217\233-\027\n#\n\003qcp\022\034\n\032\010\206\230\003\022\024G0j\275\216\217\233R1\202\017\326\263\242\317\210\367fx\326\022\003qcp\032\227\002\n\037\010\024\020\224\005\030\206\230\003*\024\031\251wE;r[\017\332\367\000\205j\3173\277\241\242\207H\n\037\010\020\020\344\001\030\206\230\003*\024\316\310\235P\307\032\224+\022\314\025\350GO\014\262\355\214\310\356\n\036\010\014\020H\030\206\230\003*\024\356v^\033\007\235Q0j\246\210\212\022,&\\R\350\231\225\n\036\010\n\020\036\030\206\230\003*\024t\013
u\227;\250\303}\254\260\216\205:\270\2526i\013\302\n\036\010\006\020\014\030\206\230\003*\024\347\306l\035\202\267wh\002\372\361^\341\037\271\372\362z\273\225\n\036\010\004\020\010\030\206\230\003\"\0241u\211\352\357\215\370`\265\307)\215\035\347\206\234#!'b\n\036\010\002\020\004\030\206\230\003*\024\225P\251\177\372\236l(\277\005zRiV\253J\235\\\310w\0323\n\027sequence/out/qstarsrace\022\024#^\002\260,\005\"\000H\316\033\207\371\302\354%<\326\232\200\030\206\230\003" height:26115 "
I[11-19|01:53:42.403] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> ]" returns="[<core_types.ResultABCIQuery Value> ]"
I[11-19|01:53:42.403] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.67:37880
I[11-19|01:53:42.404] ABCIQuery module=rpc path=/store/qcp/key data=73657175656E63652F696E2F71737461727372616365 result="key:"sequence/in/qstarsrace" value:"\216\005" proof:"\314\003\n#\n\003acc\022\034\n\032\010\206\230\003\022\0248\276\301B\265\376\314\331\310v\203\034\217\315\372$d\204\302\342\n$\n\004base\022\034\n\032\010\206\230\003\022\024\2721!\300v\246\334\223T\0023\020\215>p[x\204\3553\n\021\n\007approve\022\006\n\004\010\206\230\003\n)\n\tvalidator\022\034\n\032\010\206\230\003\022\024w\264\002\003\326\254y\354\222\264\375\370c\010k~\217\233-\027\n#\n\003qcp\022\034\n\032\010\206\230\003\022\024G0j\275\216\217\233R1\202\017\326\263\242\317\210\367fx\326\022\003qcp\032\226\002\n\037\010\024\020\224\005\030\206\230\003
\024\031\251wE;r[\017\332\367\000\205j\3173\277\241\242\207H\n\037\010\020\020\344\001\030\206\230\003*\024\316\310\235P\307\032\224+\022\314\025\350GO\014\262\355\214\310\356\n\036\010\014\020H\030\206\230\003*\024\356v^\033\007\235Q0j\246\210\212\022,&\\R\350\231\225\n\036\010\n\020\036\030\206\230\003*\024t\013~u\227;\250\303}\254\260\216\205:\270\2526i\013\302\n\036\010\006\020\014\030\206\230\003*\024\347\306l\035\202\267wh\002\372\361^\341\037\271\372\362z\273\225\n\036\010\004\020\010\030\206\230\003*\024\230\371G\325\321\3550\274[\316v{\260\t\224\205\021\010\232\232\n\036\010\002\020\004\030\206\230\003\"\024\365k\203\t\254J5\353\t\354\347\210\013\231u\0014\327\344 \0322\n\026sequence/in/qstarsrace\022\024#^\002\260,\005\"\000H\316\033\207\371\302\354%<\326\232\200\030\206\230\003" height:26115 "
I[11-19|01:53:42.404] HTTPJSONRPC module=rpc-server method=abci_query args="[/store/qcp/key <common.HexBytes Value> ]" returns="[<*core_types.ResultABCIQuery Value> ]"
I[11-19|01:53:42.404] Served RPC HTTP response module=rpc-server method=POST url=/ status=200 duration=0 remoteAddr=172.19.222.67:37710

qoscli query store validator

qoscli query store --path /store/validator/subspace --data validator
序列化出错
ERROR: Cannot encode unregistered concrete type []block.kvPairResult.

testnet初级阶段需要实现的经济模型

最小化的经济模型实现

  • 为validator初始化token,两种选择
  • 用水管实现(需要实现self delegation)
  • 初始化写死
  • createValidatorTx
  • Validator投票状态记录(窗口),分两个key:一个记录bits,一个count数
  • InactiveValidatorTx,放入pendingTimeSlice
  • activeValidatorTx
  • closeExpireInactiveValidator,即删除 ()
  • Validator排序逻辑,排序依据:votingpower + 窗口内投票count + active块高度(取反)
  • 增发逻辑:定量
  • 增发的token向validator分发(含voting power的计算)

qosd init流程

1.operator和validator key区分
2.不需要在keybase中初始化未使用的账户
3.初始化account地址可以通过参数传入

coins命令行参数一致

qosd add-genenis-account、qoscli tx transfer 、qoscli tx create approve 中有关coins格式保持一致

qosd init生成的配置参数格式不一致

"spo_config": {
  "total_amount": "10000000000",
  "total_block": "6307200"
},
"stake_config": {
  "max_validator_cnt": 10,
  "voting_status_len": 100,
  "voting_status_least": 50,
  "survival_secs": "600"
}

发币报错了

[qstars@testnet006 cmd]$ ./qosappcli -m=txissue -qscname=QSC -nonce=1 -qoschainid=qos -maxgas=100 -amount=20000
tx result: &{65537 {"codespace":1,"code":1,"abci_code":65537,"message":"chainId not match. expect: qosrace , actual: qos"} 58BD78C398B2EFCC5758E1995098BC58B636C9BB}

qoscli query approve

查询不存在的approve时返回
{"from":"address1ah9uz0","to":"address1ah9uz0","qos":"0","qscs":null}

数据限制

  1. qsc
  • - Extrate:float64
  • - QSCName:kepler中限制
  • - Description:len <= 1000
  1. qcp
  1. validator
  • - Name:len <= 300
  • - Description:len <= 1000

投票奖励的分配

方案1:按stake给所有active validator奖励
可能存在一种弊端,即validator可以一直不签块,却能通过reactivateTX一直获得收益<-是cosmos现在的做法

方案2:按validator上一块是否有签名分配奖励
弊端,有些validator可能只是网络问题没有签上,却受到了惩罚

@datalj @kauchy @TokenxyWZY

TxCreateQSC处理逻辑

1.tx.BankerCA可以为空
2.banker和Accounts可能会已经存在,不能直接NewAccount
3.需要检查Qcp ChainID是否已经存在

InactiveValidatorKeyByTime的计算

可否在BuildInactiveValidatorKeyByTime的时候就计算close的时间组成key,这样即使以后不同的原因造成inactive,也可以设置不同的survivalSecs,closeExpireInactiveValidator方法不再需要survivalSecs作为参数,直接按顺序close即可,不再需要遍历计算, @TokenxyWZY @kauchy

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.