diff --git a/.travis.yml b/.travis.yml index 208a7e508..ed86c8c0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -151,54 +151,54 @@ matrix: - sudo -H apt-get install expect - sudo -H apt-get install lftp - chmod +x bdd/upload2Ftp.sh - - os: linux - dist: xenial - go: 1.12.5 - env: multiple_nodes_bdd - script: + #- os: linux + # dist: xenial + # go: 1.12.5 + # env: multiple_nodes_bdd + # script: #- go build ./cmd/gptn - - make gptn - - cp bdd/light/testcases/!(preset.sh) bdd/node - - cp build/bin/gptn bdd/node - - cd bdd/node - - chmod -R +x * - - sudo -H chmod +w /etc/hosts - - sudo -H sed -i 's/127.0.0.1 localhost/127.0.0.1/g' /etc/hosts - - sudo -H sed -i '$a0.0.0.0 localhost' /etc/hosts - - ./launchMultipleNodes.sh - - netstat -ap | grep gptn - - cat /etc/hosts - - vi ptn-genesis.json - - cd ${BASE_DIR}/bdd - - mkdir -p ${BDD_LOG_PATH} - - if [ $IS_RUN_MULTIPLE == 'true' ]; then - python -m robot.run -d ${BDD_LOG_PATH}/${MULTIPLE_DIR} -i normal ./testcase/zMulti-node; - fi - after_script: - - killall gptn - - sleep 2 - - cd ${BASE_DIR} - - zip -j ./bdd/logs/zMulti-node.zip ./bdd/logs/* - - | - if [ $IS_UPLOAD == 'true' ]; then - # uplaod all log - ./bdd/upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH}; - # echo ftp address - echo "The path of all bdd log in vsftpd is 'ftp://47.74.209.46" - echo "If you want to open it in explorer, you should close VPN first." - echo "If you want to open in windows explorer, you should open Internet Explorer and open Settings->Adanced-Enable FTP Folder view" - fi - install: - - sudo -H pip install --upgrade pip - - sudo -H pip install robotframework==2.8.5 - - sudo -H pip install requests - - sudo -H pip install robotframework-requests - - sudo -H pip install demjson - - sudo -H pip install pexpect - - sudo -H apt-get install jq - - sudo -H apt-get install tcl tk expect - - sudo -H apt-get install lftp - - chmod +x bdd/upload2Ftp.sh + # - make gptn + # - cp bdd/light/testcases/!(preset.sh) bdd/node + # - cp build/bin/gptn bdd/node + # - cd bdd/node + # - chmod -R +x * + # - sudo -H chmod +w /etc/hosts + # - sudo -H sed -i 's/127.0.0.1 localhost/127.0.0.1/g' /etc/hosts + # - sudo -H sed -i '$a0.0.0.0 localhost' /etc/hosts + # - ./launchMultipleNodes.sh + # - netstat -ap | grep gptn + # - cat /etc/hosts + # + # - cd ${BASE_DIR}/bdd + # - mkdir -p ${BDD_LOG_PATH} + # - if [ $IS_RUN_MULTIPLE == 'true' ]; then + # python -m robot.run -d ${BDD_LOG_PATH}/${MULTIPLE_DIR} -i normal ./testcase/zMulti-node; + # fi + # after_script: + # - killall gptn + # - sleep 2 + # - cd ${BASE_DIR} + # - zip -j ./bdd/logs/zMulti-node.zip ./bdd/logs/* + # - | + # if [ $IS_UPLOAD == 'true' ]; then + # # uplaod all log + # ./bdd/upload2Ftp.sh ${FTP_PWD} ${TRAVIS_BRANCH}; + # # echo ftp address + # echo "The path of all bdd log in vsftpd is 'ftp://47.74.209.46" + # echo "If you want to open it in explorer, you should close VPN first." + # echo "If you want to open in windows explorer, you should open Internet Explorer and open Settings->Adanced-Enable FTP Folder view" + # fi + # install: + # - sudo -H pip install --upgrade pip + # - sudo -H pip install robotframework==2.8.5 + # - sudo -H pip install requests + # - sudo -H pip install robotframework-requests + # - sudo -H pip install demjson + # - sudo -H pip install pexpect + # - sudo -H apt-get install jq + # - sudo -H apt-get install tcl tk expect + # - sudo -H apt-get install lftp + # - chmod +x bdd/upload2Ftp.sh - os: linux dist: xenial go: 1.12.5 diff --git a/bdd/contract/testcases/createaccount.sh b/bdd/contract/testcases/createaccount.sh index d414d9e27..b2efb6d78 100644 --- a/bdd/contract/testcases/createaccount.sh +++ b/bdd/contract/testcases/createaccount.sh @@ -3,8 +3,8 @@ set timeout 30 spawn ../node/gptn account new expect "Passphrase:" -send "1\r" +send "1\n" expect "Repeat passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/contract/testcases/transfertoken.sh b/bdd/contract/testcases/transfertoken.sh index 615744e70..b6c0d9eed 100644 --- a/bdd/contract/testcases/transfertoken.sh +++ b/bdd/contract/testcases/transfertoken.sh @@ -5,5 +5,5 @@ set tokenHolder [lindex $argv 0] set another [lindex $argv 1] spawn ../../node/gptn --exec "personal.transferPtn($tokenHolder,$another,5990)" attach ../../node/palletone/gptn.ipc expect "Passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/dct/createaccount.sh b/bdd/dct/createaccount.sh index d414d9e27..b2efb6d78 100755 --- a/bdd/dct/createaccount.sh +++ b/bdd/dct/createaccount.sh @@ -3,8 +3,8 @@ set timeout 30 spawn ../node/gptn account new expect "Passphrase:" -send "1\r" +send "1\n" expect "Repeat passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/dct/deposit_test_cases/DepositContractTest.robot b/bdd/dct/deposit_test_cases/DepositContractTest.robot index 19e9f77f3..78cc9d791 100755 --- a/bdd/dct/deposit_test_cases/DepositContractTest.robot +++ b/bdd/dct/deposit_test_cases/DepositContractTest.robot @@ -111,7 +111,7 @@ Business_02 Business_03 [Documentation] jury 交付 1000000 0000 0000 及以上才可以加入候选列表 - ${resul} juryPayToDepositContract ${juryAddr_01} 100000000000000 + ${resul} juryPayToDepositContract ${juryAddr_01} 1000000000 log ${resul} ${result} getCandidateBalanceWithAddr ${juryAddr_01} #获取该地址保证金账户详情 log ${result} #余额为100000000000000 @@ -135,7 +135,7 @@ Business_03 Business_04 [Documentation] 没收jury节点 - ${resul} juryPayToDepositContract ${juryAddr_02} 100000000000000 + ${resul} juryPayToDepositContract ${juryAddr_02} 1000000000 log ${resul} ${result} getCandidateBalanceWithAddr ${juryAddr_02} #获取该地址保证金账户详情 log ${result} @@ -159,7 +159,7 @@ Business_04 Business_05 [Documentation] dev 交付 10000 0000 0000 及以上才可以加入候选列表 - ${resul} developerPayToDepositContract ${developerAddr_01} 1000000000000 + ${resul} developerPayToDepositContract ${developerAddr_01} 100000000 log ${resul} ${result} getCandidateBalanceWithAddr ${developerAddr_01} #获取该地址保证金账户详情 log ${result} @@ -183,7 +183,7 @@ Business_05 Business_06 [Documentation] 没收dev节点 - ${resul} developerPayToDepositContract ${developerAddr_02} 1000000000000 + ${resul} developerPayToDepositContract ${developerAddr_02} 100000000 log ${resul} ${result} getCandidateBalanceWithAddr ${developerAddr_02} #获取该地址保证金账户详情 log ${result} diff --git a/bdd/dct/deposit_test_cases/publicParams.txt b/bdd/dct/deposit_test_cases/publicParams.txt index df938bdc4..85935e5d9 100755 --- a/bdd/dct/deposit_test_cases/publicParams.txt +++ b/bdd/dct/deposit_test_cases/publicParams.txt @@ -33,4 +33,4 @@ ${Url} http://127.0.0.1:8545 ${depositContractAddress} PCGTta3M4t3yXu8uRgkKvaWd2d8DR32W9vM ${amount} 0 ${fee} 10 -${medDepositAmount} 500000000000000 +${medDepositAmount} 5000000000 diff --git a/bdd/dct/transfertoken.sh b/bdd/dct/transfertoken.sh index 581dbefb6..3a6127250 100755 --- a/bdd/dct/transfertoken.sh +++ b/bdd/dct/transfertoken.sh @@ -5,5 +5,5 @@ set tokenHolder [lindex $argv 0] set another [lindex $argv 1] spawn ../node/gptn --exec "personal.transferPtn($tokenHolder,$another,5990000)" attach ../node/palletone/gptn.ipc expect "Passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/light/testcases/createaccount.sh b/bdd/light/testcases/createaccount.sh index d65114250..3bd2d6547 100755 --- a/bdd/light/testcases/createaccount.sh +++ b/bdd/light/testcases/createaccount.sh @@ -3,8 +3,8 @@ set timeout 30 spawn ./gptn account new expect "Passphrase:" -send "1\r" +send "1\n" expect "Repeat passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/light/testcases/init.sh b/bdd/light/testcases/init.sh index 4cfbdeb92..d8dcdc25c 100755 --- a/bdd/light/testcases/init.sh +++ b/bdd/light/testcases/init.sh @@ -3,7 +3,7 @@ set timeout 30 spawn ./gptn init expect "Passphrase:" -send "1\r" +send "1\n" interact diff --git a/bdd/node/launchMultipleNodes.sh b/bdd/node/launchMultipleNodes.sh index 0782ab070..c9d41f880 100644 --- a/bdd/node/launchMultipleNodes.sh +++ b/bdd/node/launchMultipleNodes.sh @@ -6,7 +6,7 @@ set timeout 30 ./preset.sh #spawn ./start.sh #expect "Please input the numbers of nodes you want:" -#send "3\r" +#send "3\n" #interact #expect eof #EOF diff --git a/bdd/upload2Ftp.sh b/bdd/upload2Ftp.sh index 4837fdf5c..a03f1a09a 100644 --- a/bdd/upload2Ftp.sh +++ b/bdd/upload2Ftp.sh @@ -5,9 +5,9 @@ set ftppwd [lindex $argv 0] set folder [lindex $argv 1] spawn lftp travis:$ftppwd@47.74.209.46 expect "lftp" -send "cd ${folder}\r" +send "cd ${folder}\n" expect "cd" -send "mirror -R /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs\r" +send "mirror -R /home/travis/gopath/src/github.com/palletone/go-palletone/bdd/logs\n" expect "transferred" -send "exit\r" +send "exit\n" interact \ No newline at end of file diff --git a/cmd/deployment/createaccount.sh b/cmd/deployment/createaccount.sh index d65114250..3bd2d6547 100755 --- a/cmd/deployment/createaccount.sh +++ b/cmd/deployment/createaccount.sh @@ -3,8 +3,8 @@ set timeout 30 spawn ./gptn account new expect "Passphrase:" -send "1\r" +send "1\n" expect "Repeat passphrase:" -send "1\r" +send "1\n" interact diff --git a/cmd/deployment/init.sh b/cmd/deployment/init.sh index 4cfbdeb92..d8dcdc25c 100755 --- a/cmd/deployment/init.sh +++ b/cmd/deployment/init.sh @@ -3,7 +3,7 @@ set timeout 30 spawn ./gptn init expect "Passphrase:" -send "1\r" +send "1\n" interact diff --git a/cmd/deployment/modifyjson.sh b/cmd/deployment/modifyjson.sh index 209caff3d..17f45907c 100755 --- a/cmd/deployment/modifyjson.sh +++ b/cmd/deployment/modifyjson.sh @@ -14,14 +14,16 @@ if [ $index -eq 0 ] ; then createaccount=`./createaccount.sh` account=`echo $createaccount | sed -n '$p'| awk '{print $NF}'` account=${account:0:35} - account=`echo ${account// /}` + account=`echo ${account// +/}` add=`echo $add | jq ".tokenHolder = \"$account\""` createaccount=`./createaccount.sh` account=`echo $createaccount | sed -n '$p'| awk '{print $NF}'` account=${account:0:35} - account=`echo ${account// /}` + account=`echo ${account// +/}` add=`echo $add | jq ".initialParameters.foundation_address = \"$account\""` diff --git a/cmd/gptn/genesis_json.go b/cmd/gptn/genesis_json.go index db491f8f1..3f267ce1a 100755 --- a/cmd/gptn/genesis_json.go +++ b/cmd/gptn/genesis_json.go @@ -230,7 +230,7 @@ func modifyConfig(ctx *cli.Context, mediators []*mp.MediatorConf) error { cfg.MediatorPlugin.EnableStaleProduction = true cfg.MediatorPlugin.EnableConsecutiveProduction = false cfg.MediatorPlugin.RequiredParticipation = 0 - cfg.MediatorPlugin.EnableGroupSigning = true + cfg.MediatorPlugin.EnableGroupSigning = false cfg.MediatorPlugin.Mediators = mediators // change log diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 08daf06fa..d3d464b7d 100755 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -594,7 +594,7 @@ func setBootstrapNodes(ctx *cli.Context, cfg *p2p.Config) { } case ctx.GlobalBool(TestnetFlag.Name): urls = configure.TestnetBootnodes - case cfg.BootstrapNodes != nil: + case len(cfg.BootstrapNodes) > 0: return // already set, don't apply defaults. } @@ -751,7 +751,7 @@ func MakePasswordList(ctx *cli.Context) []string { lines := strings.Split(string(text), "\n") // Sanitise DOS line endings. for i := range lines { - lines[i] = strings.TrimRight(lines[i], "\r") + lines[i] = strings.TrimRight(lines[i], "\n") } return lines } diff --git a/configure/bootnodes.go b/configure/bootnodes.go index b107c3dbd..ee733f853 100755 --- a/configure/bootnodes.go +++ b/configure/bootnodes.go @@ -18,14 +18,19 @@ package configure // MainnetBootnodes are the pnode URLs of the P2P bootstrap nodes running on // the main PalletOne network. -var MainnetBootnodes = []string{} +var MainnetBootnodes = []string{ + "pnode://98627f6b5fa0f549ff644e66fc2b9801ea039614784ea65d1e9e942fed573004a65d0b2e85d4a949c28844efe6f357d97c1198e1194eb436fb0a8bbfafb8e6d2@123.126.106.88:30303", + "pnode://eaef728cb3bb7d96f5efb377b2a21d134061eb4ae0276a9573055f998b7fde4fece4aac1d93c5d9bb57d8ddf054f922720dd6188f30c8f85cc68ee9e37465958@123.126.106.88:30305", + "pnode://d9d50a943c836e1576589e948c5f0b92429173e617906bcecbe16b528f3bd924f831d86b1abdb646c9ecfed466760f18423f35ef26a5ef73ac102418da6dc3c9@123.126.106.88:30306", + "pnode://beacea1636d1ee955247199d09cdc39db38db115616e22dd6c50939b44d40a876cbda4f7cedf86a2398ff67f8d67c63fbc88be1e86277377c75250ae023aa15b@123.126.106.89:30307", + "pnode://5e93e974f036fa917d66277dafb020c2c705321c82fefde81b186a934a42867324f966a83f51884a0b1e8694bd241405fbdac3131f644de3d1d4b8f88a52886a@123.126.106.89:30308", +} // TestnetBootnodes are the pnode URLs of the P2P bootstrap nodes running on the // Ropsten test network. var TestnetBootnodes = []string{ - "pnode://eb6523c0220620a63c1b2d1375d8c04a35e88d8ef05344331bad187c1fdc37a0c65eeff91963cd576b160753f58680109cc181514ebfb0831d42ca39cac2ee15@60.205.177.166:30303", - "pnode://aaa3a9f08a2ac9e566b5ab1c9e34655c5214b55a205c7ae0526ce59d5e841c6cafdbd23a98a8ee2181b113a0855ae007a02a559365fb0f21e0a72c9237940794@123.126.106.83:30305", - "pnode://d18ea6e8cb09984b19fbf9c47636aaa952f8aef3fabdef75756d946990091510fd3b4fbff5db5860e3b395e5bc6159454a3f5b9b87a27f6efa8a081a037a4d6c@123.126.106.84:30306", - "pnode://28f45690b29282b3ed19373f20099c6e00e275183c795d2082820cafd54d91e4009610effc7249feeaaf826ad21c3a5fa983567d190f9d3b4305338cc5a847b6@123.126.106.85:30307", - "pnode://ef2b94a2305bbbe7a9445647cf73b6aeae96e5b75f16eb78f2605f2b85f6099842cec6a01e7f995caf813b61072b99090d37141ec31fc338054bb6500925ace5@123.126.106.85:30308", -} + "pnode://d6250d040c3569e2f15f1dcd07f3dc0c56bc92736ecab2a57fe16a3d800fd8bbc2e52de8dacba59a0248c5982a4ebc2ed35bd63ad506d80705be681a51ee8d7d@123.126.106.82:30303", + "pnode://de7babb5d2b14bb780a1a5fc0f3c17e03d70ddfa847cd704f2347772997cd0ae7cf016e0d899748e0291d301805a263d2e96a15361ce3f26d47893ad167adbf0@123.126.106.83:30305", + "pnode://0096833853449ce46a1720638d044531a4f6de7cd3c22c90a96266384c9fa3cf550b14d552fbcb28e7635e0de4737ca5d985ff4954750eddbe1501ead5c461c5@123.126.106.84:30306", + "pnode://79054cfedfdbf2bedef3c9ee865a1a9843a65eaf0939be496f5b9560e42fbbfc09ea71197601834a2e68d61eb88792a2e9c143ad6c59c343b7eb1c36e461e62d@123.126.106.85:30307", + "pnode://3d7b3db523418565cc119bb4a4813753ad5a714441193e5c89ade195f4666691df66f4dbf43595efa9b343f8ad7946d057a47fb10ad5b05d7b00e30aa9068712@60.205.177.166:30308"} diff --git a/consensus/jury/common.go b/consensus/jury/common.go index 8b4b23354..f3a69b338 100644 --- a/consensus/jury/common.go +++ b/consensus/jury/common.go @@ -345,7 +345,7 @@ func runContractCmd(rwM rwset.TxManager, dag iDag, contract *contracts.Contract, return nil, errors.New(fmt.Sprintf("[%s]runContractCmd APP_CONTRACT_INVOKE txid(%s) rans err:%s", shortId(reqId.String()), req.txid, err)) } result := invokeResult.(*modules.ContractInvokeResult) - payload := modules.NewContractInvokePayload(result.ContractId, result.Args, 0 /*result.ExecutionTime*/, result.ReadSet, result.WriteSet, result.Payload, modules.ContractError{}) + payload := modules.NewContractInvokePayload(result.ContractId, result.Args, 0 /*result.ExecutionTime*/ , result.ReadSet, result.WriteSet, result.Payload, modules.ContractError{}) if payload != nil { msgs = append(msgs, modules.NewMessage(modules.APP_CONTRACT_INVOKE, payload)) } @@ -498,7 +498,7 @@ func checkAndAddTxSigMsgData(local *modules.Transaction, recv *modules.Transacti for _, sig := range sigs { if true == bytes.Equal(sig.PubKey, recvSigMsg.Payload.(*modules.SignaturePayload).Signatures[0].PubKey) && true == bytes.Equal(sig.Signature, recvSigMsg.Payload.(*modules.SignaturePayload).Signatures[0].Signature) { - log.Infof("[%s]checkAndAddTxSigMsgData tx already recv, reqId[%s]", shortId(reqId.String()), reqId.String()) + log.Infof("[%s]checkAndAddTxSigMsgData tx already receive, tx[%s]", shortId(reqId.String()), recv.Hash().String()) return false, nil } } @@ -734,4 +734,3 @@ func getValidAddress(addrs []common.Address) ([]common.Address) { } return result } - diff --git a/consensus/jury/contractEvent.go b/consensus/jury/contractEvent.go index d29f95e4c..d641def9e 100755 --- a/consensus/jury/contractEvent.go +++ b/consensus/jury/contractEvent.go @@ -148,10 +148,17 @@ func (p *Processor) contractExecEvent(tx *modules.Transaction, ele []modules.Ele } func (p *Processor) contractSigEvent(tx *modules.Transaction, ele []modules.ElectionInf) (broadcast bool, err error) { + p.locker.Lock() + defer p.locker.Unlock() reqId := tx.RequestHash() + if _, ok := p.mtx[reqId];ok { + if checkTxReceived(p.mtx[reqId].rcvTx, tx) { + return false, nil + } + } + log.Debugf("[%s]contractSigEvent, receive sig tx[%s]", shortId(reqId.String()), tx.Hash().String()) if _, ok := p.mtx[reqId]; !ok { - //log.Debug("contractSigEvent", "local not find reqId,create it", reqId) - p.locker.Lock() + log.Debugf("[%s]contractSigEvent, local not find reqId,create it", shortId(reqId.String())) p.mtx[reqId] = &contractTx{ reqTx: tx.GetRequestTx(), eleInf: ele, @@ -160,19 +167,13 @@ func (p *Processor) contractSigEvent(tx *modules.Transaction, ele []modules.Elec adaInf: make(map[uint32]*AdapterInf), } p.mtx[reqId].rcvTx = append(p.mtx[reqId].rcvTx, tx) - p.locker.Unlock() - //go p.runContractReq(reqId, ele) //del return true, nil } ctx := p.mtx[reqId] - - if checkTxReceived(ctx.rcvTx, tx) { - return false, nil - } ctx.rcvTx = append(ctx.rcvTx, tx) - //如果是jury,将接收到tx与本地执行后的tx进行对比,相同则添加签名到sigTx,如果满足三个签名且签名值最小则广播tx,否则函数返回 + //如果是jury,将接收到tx与本地执行后的tx进行对比,相同则添加签名到sigTx,如果满足签名数量且签名值最小则广播tx,否则函数返回 if ok, err := checkAndAddTxSigMsgData(ctx.sigTx, tx); err == nil && ok { if getTxSigNum(ctx.sigTx) >= p.contractSigNum { if localIsMinSignature(ctx.sigTx) { //todo diff --git a/consensus/jury/election.go b/consensus/jury/election.go index 190f37971..d63792bd6 100755 --- a/consensus/jury/election.go +++ b/consensus/jury/election.go @@ -448,6 +448,10 @@ func (p *Processor) processElectionSigResultEvent(evt *ElectionSigResultEvent) e if mel == nil || mel.nType != 1 { return nil } + if len(mel.sigs) >= p.dag.ChainThreshold() { + log.Debugf("[%s]processElectionSigResultEvent, sig number is enough", shortId(reqId.String())) + return nil + } //检查签名是否重复,收集签名,数量满足则广播请求交易 for _, sig := range mel.sigs { if bytes.Equal(sig.PubKey, evt.Sig.PubKey) { diff --git a/consensus/jury/service.go b/consensus/jury/service.go index fdd27ae11..b7a3faa14 100755 --- a/consensus/jury/service.go +++ b/consensus/jury/service.go @@ -275,6 +275,8 @@ func (p *Processor) localHaveActiveJury() bool { //} func (p *Processor) runContractReq(reqId common.Hash, elf []modules.ElectionInf) error { + log.Debugf("[%s]runContractReq enter", shortId(reqId.String())) + defer log.Debugf("[%s]runContractReq exit", shortId(reqId.String())) p.locker.Lock() ctx := p.mtx[reqId] if ctx == nil { @@ -313,6 +315,7 @@ func (p *Processor) runContractReq(reqId common.Hash, elf []modules.ElectionInf) return fmt.Errorf("runContractReq, GenContractSigTransctions error, reqId[%s], err:%s", reqId, err.Error()) } ctx.sigTx = sigTx + log.Debugf("[%s]runContractReq, gen local signature tx[%s]", shortId(reqId.String()), sigTx.Hash().String()) //如果rcvTx存在,则比较执行结果,并将结果附加到sigTx上,并删除rcvTx if len(ctx.rcvTx) > 0 { for _, rtx := range ctx.rcvTx { @@ -320,12 +323,12 @@ func (p *Processor) runContractReq(reqId common.Hash, elf []modules.ElectionInf) if err != nil { log.Debugf("[%s]runContractReq, checkAndAddTxSigMsgData error:%s", shortId(reqId.String()), err.Error()) } else if ok { - log.Debugf("[%s]runContractReq, checkAndAddTxSigMsgData ok", shortId(reqId.String())) + log.Debugf("[%s]runContractReq, checkAndAddTxSigMsgData ok, tx[%s]", shortId(reqId.String()), rtx.Hash().String()) } else { log.Debugf("[%s]runContractReq, checkAndAddTxSigMsgData fail", shortId(reqId.String())) } } - ctx.rcvTx = nil + //ctx.rcvTx = nil } sigNum := getTxSigNum(ctx.sigTx) diff --git a/consensus/mediatorplugin/service.go b/consensus/mediatorplugin/service.go index 598b36772..7a768126b 100755 --- a/consensus/mediatorplugin/service.go +++ b/consensus/mediatorplugin/service.go @@ -119,6 +119,7 @@ type MediatorPlugin struct { precedingDKGs map[common.Address]*dkg.DistKeyGenerator // dkg 完成 vss 协议相关 + // todo 待加锁,防止写冲突 respBuf map[common.Address]map[common.Address]chan *dkg.Response // 广播和处理 vss 协议 deal @@ -251,7 +252,7 @@ func (mp *MediatorPlugin) unlockLocalMediators() { for add, medAcc := range mp.mediators { err := ks.Unlock(accounts.Account{Address: add}, medAcc.Password) if err != nil { - log.Errorf("fail to unlock the mediator(%v), error: %v", add.Str(), err.Error()) + log.Debugf("fail to unlock the mediator(%v), error: %v", add.Str(), err.Error()) delete(mp.mediators, add) } } @@ -322,12 +323,12 @@ func NewMediatorPlugin(ptn PalletOne, dag iDag, cfg *Config) (*MediatorPlugin, e if ptn == nil || dag == nil || cfg == nil { err := "pointer parameters of NewMediatorPlugin are nil!" - log.Error(err) + log.Errorf(err) panic(err) } mss := cfg.Mediators - msm := make(map[common.Address]*MediatorAccount, 0) + msm := make(map[common.Address]*MediatorAccount, len(mss)) for _, medConf := range mss { medAcc := medConf.configToAccount() diff --git a/examples/e2e_cli/PalletClusterBuildingManual.md b/examples/e2e_cli/PalletClusterBuildingManual.md index f85d46ccf..c7ba503a8 100755 --- a/examples/e2e_cli/PalletClusterBuildingManual.md +++ b/examples/e2e_cli/PalletClusterBuildingManual.md @@ -141,9 +141,9 @@ The basic configuration commands in CentOS are as follows: #spawn "gptn's dir" account new spawn /opt/gopath/src/github.com/palletone/go-palletone/build/bin/gptn account new expect "Passphrase:" - send "1\r" + send "1\n" expect "Repeat passphrase:" - send "1\r" + send "1\n" interact # ##Modify the gptn executable location in getInit.sh in the scripts directory to the absolute path below mediator0 @@ -152,7 +152,7 @@ The basic configuration commands in CentOS are as follows: #输入gptn在Mediator0的绝对路径 spawn /opt/gopath/src/github.com/palletone/go-palletone/examples/e2e_cli/channel-artifacts/mediator0/gptn init expect "Passphrase:" - send "1\r" + send "1\n" interact # #### (1.4.3) Generating configuration path information for N nodes diff --git a/examples/e2e_cli/scripts/getAccount.sh b/examples/e2e_cli/scripts/getAccount.sh index 00239ce60..ea3291592 100755 --- a/examples/e2e_cli/scripts/getAccount.sh +++ b/examples/e2e_cli/scripts/getAccount.sh @@ -7,7 +7,7 @@ set timeout 30 #spawn "gptn's dir" account new spawn ./gptn account new expect "Passphrase:" -send "1\r" +send "1\n" expect "Repeat passphrase:" -send "1\r" +send "1\n" interact diff --git a/examples/e2e_cli/scripts/getInit.sh b/examples/e2e_cli/scripts/getInit.sh index 9daf77631..45e32bc76 100755 --- a/examples/e2e_cli/scripts/getInit.sh +++ b/examples/e2e_cli/scripts/getInit.sh @@ -5,5 +5,5 @@ set timeout 30 #(2)执行init spawn ./gptn init expect "Passphrase:" -send "1\r" +send "1\n" interact