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
8fdb6cbf
Commit
8fdb6cbf
authored
Nov 23, 2018
by
gitlab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
286dcbfa
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
22 additions
and
20 deletions
+22
-20
consensus_state.go
plugin/consensus/tendermint/consensus_state.go
+1
-1
node.go
plugin/consensus/tendermint/node.go
+6
-6
secret_connection.go
plugin/consensus/tendermint/secret_connection.go
+4
-4
tendermint.go
plugin/consensus/tendermint/tendermint.go
+1
-1
nonePerf.go
plugin/consensus/tendermint/tools/nonePerf.go
+1
-0
block.go
plugin/consensus/tendermint/types/block.go
+1
-1
evidence.go
plugin/consensus/tendermint/types/evidence.go
+5
-5
util.go
plugin/consensus/tendermint/types/util.go
+2
-1
vote_set.go
plugin/consensus/tendermint/types/vote_set.go
+1
-1
No files found.
plugin/consensus/tendermint/consensus_state.go
View file @
8fdb6cbf
...
...
@@ -216,7 +216,7 @@ func (cs *ConsensusState) Start() {
// Stop timer and receive routine
func
(
cs
*
ConsensusState
)
Stop
()
{
cs
.
timeoutTicker
.
Stop
()
cs
.
Quit
<-
struct
{}{}
cs
.
Quit
<-
struct
{}{}
}
//------------------------------------------------------------
...
...
plugin/consensus/tendermint/node.go
View file @
8fdb6cbf
...
...
@@ -22,12 +22,12 @@ import (
)
const
(
numBufferedConnections
=
10
maxNumPeers
=
50
tryListenSeconds
=
5
handshakeTimeout
=
20
// * time.Second,
maxSendQueueSize
=
1024
defaultSendTimeout
=
60
*
time
.
Second
numBufferedConnections
=
10
maxNumPeers
=
50
tryListenSeconds
=
5
handshakeTimeout
=
20
// * time.Second,
maxSendQueueSize
=
1024
defaultSendTimeout
=
60
*
time
.
Second
//MaxMsgPacketPayloadSize define
MaxMsgPacketPayloadSize
=
10
*
1024
*
1024
defaultDialTimeout
=
3
*
time
.
Second
...
...
plugin/consensus/tendermint/secret_connection.go
View file @
8fdb6cbf
...
...
@@ -182,13 +182,13 @@ func (sc *SecretConnection) Read(data []byte) (n int, err error) {
}
// Close Implements net.Conn
func
(
sc
*
SecretConnection
)
Close
()
error
{
return
sc
.
conn
.
Close
()
}
func
(
sc
*
SecretConnection
)
Close
()
error
{
return
sc
.
conn
.
Close
()
}
// LocalAddr ...
func
(
sc
*
SecretConnection
)
LocalAddr
()
net
.
Addr
{
return
sc
.
conn
.
(
net
.
Conn
)
.
LocalAddr
()
}
func
(
sc
*
SecretConnection
)
LocalAddr
()
net
.
Addr
{
return
sc
.
conn
.
(
net
.
Conn
)
.
LocalAddr
()
}
// RemoteAddr ...
func
(
sc
*
SecretConnection
)
RemoteAddr
()
net
.
Addr
{
return
sc
.
conn
.
(
net
.
Conn
)
.
RemoteAddr
()
}
func
(
sc
*
SecretConnection
)
RemoteAddr
()
net
.
Addr
{
return
sc
.
conn
.
(
net
.
Conn
)
.
RemoteAddr
()
}
// SetDeadline ...
func
(
sc
*
SecretConnection
)
SetDeadline
(
t
time
.
Time
)
error
{
return
sc
.
conn
.
(
net
.
Conn
)
.
SetDeadline
(
t
)
}
...
...
@@ -352,7 +352,7 @@ func incr2Nonce(nonce *[24]byte) {
// increment nonce big-endian by 1 with wraparound.
func
incrNonce
(
nonce
*
[
24
]
byte
)
{
for
i
:=
23
;
0
<=
i
;
i
--
{
nonce
[
i
]
++
nonce
[
i
]
++
if
nonce
[
i
]
!=
0
{
return
}
...
...
plugin/consensus/tendermint/tendermint.go
View file @
8fdb6cbf
...
...
@@ -38,7 +38,7 @@ var (
timeoutCommit
int32
=
1000
skipTimeoutCommit
=
false
createEmptyBlocks
=
false
createEmptyBlocksInterval
int32
// second
createEmptyBlocksInterval
int32
// second
validatorNodes
=
[]
string
{
"127.0.0.1:46656"
}
peerGossipSleepDuration
int32
=
100
peerQueryMaj23SleepDuration
int32
=
2000
...
...
plugin/consensus/tendermint/tools/nonePerf.go
View file @
8fdb6cbf
...
...
@@ -29,6 +29,7 @@ const fee = 1e6
const
letterBytes
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var
r
*
rand
.
Rand
// TxHeightOffset needed
var
TxHeightOffset
int64
...
...
plugin/consensus/tendermint/types/block.go
View file @
8fdb6cbf
...
...
@@ -21,7 +21,7 @@ import (
)
var
(
blocklog
=
log15
.
New
(
"module"
,
"tendermint-block"
)
blocklog
=
log15
.
New
(
"module"
,
"tendermint-block"
)
// ConsensusCrypto define
ConsensusCrypto
crypto
.
Crypto
)
...
...
plugin/consensus/tendermint/types/evidence.go
View file @
8fdb6cbf
...
...
@@ -43,7 +43,7 @@ const (
// EvidenceType map define
var
(
EvidenceType2Type
map
[
string
]
reflect
.
Type
EvidenceType2Obj
map
[
string
]
Evidence
EvidenceType2Obj
map
[
string
]
Evidence
)
// Evidence represents any provable malicious activity by a validator
...
...
@@ -270,13 +270,13 @@ func NewMockGoodEvidence(height int64, index int, address []byte) MockGoodEviden
}
// Height ...
func
(
e
MockGoodEvidence
)
Height
()
int64
{
return
e
.
MGHeight
}
func
(
e
MockGoodEvidence
)
Height
()
int64
{
return
e
.
MGHeight
}
// Address ...
func
(
e
MockGoodEvidence
)
Address
()
[]
byte
{
return
e
.
MGAddress
}
// Index ...
func
(
e
MockGoodEvidence
)
Index
()
int
{
return
e
.
MGIndex
}
func
(
e
MockGoodEvidence
)
Index
()
int
{
return
e
.
MGIndex
}
// Hash ...
func
(
e
MockGoodEvidence
)
Hash
()
[]
byte
{
...
...
@@ -373,7 +373,7 @@ type MockEvidencePool struct {
func
(
m
MockEvidencePool
)
PendingEvidence
()
[]
Evidence
{
return
nil
}
// AddEvidence ...
func
(
m
MockEvidencePool
)
AddEvidence
(
Evidence
)
error
{
return
nil
}
func
(
m
MockEvidencePool
)
AddEvidence
(
Evidence
)
error
{
return
nil
}
// Update ...
func
(
m
MockEvidencePool
)
Update
(
*
TendermintBlock
)
{}
func
(
m
MockEvidencePool
)
Update
(
*
TendermintBlock
)
{}
plugin/consensus/tendermint/types/util.go
View file @
8fdb6cbf
...
...
@@ -31,7 +31,7 @@ var (
randgen
*
rand
.
Rand
randMux
sync
.
Mutex
// Fmt ...
Fmt
=
fmt
.
Sprintf
Fmt
=
fmt
.
Sprintf
)
// Init ...
...
...
@@ -143,6 +143,7 @@ func MinInt(a, b int) int {
}
return
b
}
// MaxInt ...
func
MaxInt
(
a
,
b
int
)
int
{
if
a
>
b
{
...
...
plugin/consensus/tendermint/types/vote_set.go
View file @
8fdb6cbf
...
...
@@ -320,7 +320,7 @@ func (voteSet *VoteSet) SetPeerMaj23(peerID string, blockID *tmtypes.BlockID) {
if
votesByBlock
.
peerMaj23
{
return
// Nothing to do
}
votesByBlock
.
peerMaj23
=
true
// No need to copy votes, already there.
votesByBlock
.
peerMaj23
=
true
// No need to copy votes, already there.
}
else
{
votesByBlock
=
newBlockVotes
(
true
,
voteSet
.
valSet
.
Size
())
voteSet
.
votesByBlock
[
blockKey
]
=
votesByBlock
...
...
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