Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
2124418b
Commit
2124418b
authored
May 24, 2019
by
mdj33
Committed by
vipwzw
May 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nonCommitTxcount
parent
dae619a8
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
9 additions
and
6 deletions
+9
-6
para.go
plugin/consensus/para/para.go
+1
-1
paracommitmsg.go
plugin/consensus/para/paracommitmsg.go
+3
-3
chain33.para.toml
plugin/dapp/paracross/cmd/build/chain33.para.toml
+1
-0
exec_local.go
plugin/dapp/paracross/executor/exec_local.go
+3
-2
paracross.proto
plugin/dapp/paracross/proto/paracross.proto
+1
-0
No files found.
plugin/consensus/para/para.go
View file @
2124418b
...
...
@@ -34,7 +34,7 @@ const (
addAct
int64
=
1
//add para block action
delAct
int64
=
2
//reference blockstore.go, del para block action
minBlockNum
=
6
//min block number startHeight before lastHeight in mainchain
minBlockNum
=
100
//min block number startHeight before lastHeight in mainchain
)
var
(
...
...
plugin/consensus/para/paracommitmsg.go
View file @
2124418b
...
...
@@ -19,7 +19,7 @@ import (
var
(
consensusInterval
=
16
//about 1 new block interval
minerInterval
=
2
minerInterval
=
5
)
type
commitMsgClient
struct
{
...
...
@@ -432,14 +432,14 @@ func (client *commitMsgClient) getNodeStatus(start, end int64) ([]*pt.ParacrossN
var
needSentTxs
uint32
for
i
:=
0
;
i
<
int
(
count
);
i
++
{
ret
=
append
(
ret
,
nodeList
[
req
.
Start
+
int64
(
i
)])
needSentTxs
+=
nodeList
[
req
.
Start
+
int64
(
i
)]
.
TxCounts
needSentTxs
+=
nodeList
[
req
.
Start
+
int64
(
i
)]
.
NonCommit
TxCounts
}
//1.如果是只有commit tx的空块,推迟发送,直到等到一个完全没有commit tx的空块或者其他tx的块
//2,如果20个块都是 commit tx的空块,20个块打包一次发送,尽量减少commit tx造成的空块
//3,如果形如xxoxx的块排列,x代表commit空块,o代表实际的块,即只要不全部是commit块,也要全部打包一起发出去
//如果=0 意味着全部是paracross commit tx,延迟发送
if
needSentTxs
==
0
&&
count
<
types
.
TxGroupMaxCount
{
plog
.
Info
(
"para commitmsg getNodeStatus all self consensus commit tx,send delay"
,
"start"
,
start
,
"end"
,
end
)
plog
.
Debug
(
"para commitmsg getNodeStatus all self consensus commit tx,send delay"
,
"start"
,
start
,
"end"
,
end
)
return
nil
,
nil
}
...
...
plugin/dapp/paracross/cmd/build/chain33.para.toml
View file @
2124418b
...
...
@@ -154,6 +154,7 @@ tokenApprs = [
]
[exec.sub.paracross]
#平行链自共识停止n个块后,超级账户可以直接参与投票
paraConsensusStopBlocks
=
100
[pprof]
...
...
plugin/dapp/paracross/executor/exec_local.go
View file @
2124418b
...
...
@@ -185,10 +185,11 @@ func setMinerTxResultFork(status *pt.ParacrossNodeStatus, txs []*types.Transacti
}
}
status
.
TxCounts
=
uint32
(
len
(
curTxHashs
))
//有tx且全部是user.p.x.paracross的commit tx时候设为0
status
.
TxCounts
=
1
status
.
NonCommit
TxCounts
=
1
if
len
(
curTxHashs
)
!=
0
&&
len
(
curTxHashs
)
==
len
(
isCommitTx
)
{
status
.
TxCounts
=
0
status
.
NonCommit
TxCounts
=
0
}
crossTxHashs
:=
FilterParaCrossTxHashes
(
types
.
GetTitle
(),
txs
)
...
...
plugin/dapp/paracross/proto/paracross.proto
View file @
2124418b
...
...
@@ -151,6 +151,7 @@ message ParacrossNodeStatus {
repeated
bytes
txHashs
=
11
;
bytes
crossTxResult
=
12
;
repeated
bytes
crossTxHashs
=
13
;
uint32
nonCommitTxCounts
=
14
;
}
message
ParacrossCommitAction
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment