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
43f35118
Commit
43f35118
authored
May 13, 2020
by
whisker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
performance test done
parent
b4d05579
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
33 deletions
+29
-33
perf_test.sh
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
+27
-31
testcase.sh
plugin/dapp/x2Ethereum/cmd/build/testcase.sh
+1
-1
utils.go
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/utils.go
+1
-1
No files found.
plugin/dapp/x2Ethereum/cmd/build/perf_test.sh
View file @
43f35118
...
...
@@ -13,25 +13,19 @@ ethSender0PrivateKey="3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e50
privateKeys[0]
=
"8656d2bc732a8a816a461ba5e2d8aac7c7f85c26a813df30d5327210465eb230"
privateKeys[1]
=
"3fa21584ae2e4fd74db9b58e2386f5481607dfa4d7ba0617aaa7858e5025dc1e"
privateKeys[2]
=
"a5f3063552f4483cfc20ac4f40f45b798791379862219de9e915c64722c1d400"
privateKeys[3]
=
"bbf5e65539e9af0eb0cfac30bad475111054b09c11d668fc0731d54ea777471e"
privateKeys[4]
=
"c9fa31d7984edf81b8ef3b40c761f1847f6fcd5711ab2462da97dc458f1f896b"
privateKeys[5]
=
"1385016736f7379884763f4a39811d1391fa156a7ca017be6afffa52bb327695"
privateKeys[6]
=
"4ae589fe3837dcfc90d1c85b8423dc30841525cbebc41dfb537868b0f8376bbf"
privateKeys[7]
=
"62ca4122aac0e6f35bed02fc15c7ddbdaa07f2f2a1821c8b8210b891051e3ee9"
privateKeys[8]
=
"355b876d7cbcb930d5dfab767f66336ce327e082cbaa1877210c1bae89b1df71"
privateKeys[9]
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
privateKeys[2]
=
"1385016736f7379884763f4a39811d1391fa156a7ca017be6afffa52bb327695"
privateKeys[3]
=
"4ae589fe3837dcfc90d1c85b8423dc30841525cbebc41dfb537868b0f8376bbf"
privateKeys[4]
=
"62ca4122aac0e6f35bed02fc15c7ddbdaa07f2f2a1821c8b8210b891051e3ee9"
privateKeys[5]
=
"355b876d7cbcb930d5dfab767f66336ce327e082cbaa1877210c1bae89b1df71"
privateKeys[6]
=
"9dc6df3a8ab139a54d8a984f54958ae0661f880229bf3bdbb886b87d58b56a08"
ethAddress[0]
=
"0x8AFDADFC88a1087c9A1D6c0F5Dd04634b87F303a"
ethAddress[1]
=
"0x92C8b16aFD6d423652559C6E266cBE1c29Bfd84f"
ethAddress[2]
=
"0x0df9a824699Bc5878232C9e612fE1A5346a5A368"
ethAddress[3]
=
"0xcB074CB21cdDDF3ce9c3C0a7AC4497d633C9D9f1"
ethAddress[4]
=
"0xd9dAb021e74EcF475788ed7b61356056B2095830"
ethAddress[5]
=
"0xdb15E7327aDc83F2878624bBD6307f5Af1B477b4"
ethAddress[6]
=
"0x9cBA1fF8D0b0c9Bc95d5762533F8CddBE795f687"
ethAddress[7]
=
"0x1919203bA8b325278d28Fb8fFeac49F2CD881A4e"
ethAddress[8]
=
"0xA4Ea64a583F6e51C3799335b28a8F0529570A635"
ethAddress[9]
=
"0x0C05bA5c230fDaA503b53702aF1962e08D0C60BF"
ethAddress[2]
=
"0xdb15E7327aDc83F2878624bBD6307f5Af1B477b4"
ethAddress[3]
=
"0x9cBA1fF8D0b0c9Bc95d5762533F8CddBE795f687"
ethAddress[4]
=
"0x1919203bA8b325278d28Fb8fFeac49F2CD881A4e"
ethAddress[5]
=
"0xA4Ea64a583F6e51C3799335b28a8F0529570A635"
ethAddress[6]
=
"0x0C05bA5c230fDaA503b53702aF1962e08D0C60BF"
maturityDegree
=
10
...
...
@@ -44,7 +38,7 @@ loop_send_lock_eth() {
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(
curl
-ksd
'{"jsonrpc":"2.0","method":"eth_getBalance","params":["'
${
ethAddress
[i]
}
'", "latest"],"id":1}'
http://localhost:7545 | jq
-r
".result"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
0.
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
1
-k
"
${
privateKeys
[i]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"lock-async tx hash:"
${
ethTxHash
}
let
i++
done
...
...
@@ -65,7 +59,7 @@ loop_send_lock_eth() {
nowChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
eth | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
diff
=
$((
nowChain33Balance
-
preChain33Balance
))
check_number
"
${
diff
}
"
1
check_number
"
${
diff
}
"
7
}
loop_send_burn_eth
()
{
...
...
@@ -77,7 +71,7 @@ loop_send_burn_eth() {
i
=
0
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
preEthBalance[
$i
]=
$(
curl
-ksd
'{"jsonrpc":"2.0","method":"eth_getBalance","params":["'
${
ethAddress
[i]
}
'", "latest"],"id":1}'
http://localhost:7545 | jq
-r
".result"
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
0.
1
-r
${
ethAddress
[i]
}
-t
eth
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
ethTxHash
=
$(${
Chain33_CLI
}
send x2ethereum burn
-a
1
-r
${
ethAddress
[i]
}
-t
eth
-k
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
)
echo
${
i
}
"burn chain33 tx hash:"
${
ethTxHash
}
let
i++
done
...
...
@@ -89,15 +83,15 @@ loop_send_burn_eth() {
nowEthBalance
=
$(
curl
-ksd
'{"jsonrpc":"2.0","method":"eth_getBalance","params":["'
${
ethAddress
[i]
}
'", "latest"],"id":1}'
http://localhost:7545 | jq
-r
".result"
)
res
=
$((
nowEthBalance
-
preEthBalance[i]
))
echo
${
i
}
"preBalance"
${
preEthBalance
[i]
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
if
[[
$res
-gt
100000000000000000
]]
;
then
echo
-e
"
${
RED
}
error number, expect greater than 100000000000000000, get
${
res
}${
NOC
}
"
if
[[
$res
-gt
100000000000000000
0
]]
;
then
echo
-e
"
${
RED
}
error number, expect greater than 100000000000000000
0
, get
${
res
}${
NOC
}
"
exit
1
fi
let
i++
done
nowChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
eth | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
diff
=
$((
preChain33Balance
-
nowChain33Balance
))
check_number
"
${
diff
}
"
1
check_number
"
${
diff
}
"
7
}
...
...
@@ -127,8 +121,9 @@ loop_send_lock_bty() {
let
i++
done
nowChain33Balance
=
$(${
Chain33_CLI
}
account balance
-a
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-e
x2ethereum | jq
-r
".balance"
|
sed
's/\"//g'
)
diff
=
$((
preChain33Balance
-
nowChain33Balance
))
check_number
"
${
diff
}
"
10
check_number
"
${
nowChain33Balance
}
"
"188.0000"
check_number
"
${
preChain33Balance
}
"
"195.0000"
}
...
...
@@ -159,8 +154,9 @@ loop_send_burn_bty() {
let
i++
done
nowChain33Balance
=
$(${
Chain33_CLI
}
account balance
-a
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-e
x2ethereum | jq
-r
".balance"
|
sed
's/\"//g'
)
diff
=
$((
nowChain33Balance
-
preChain33Balance
))
check_number
"
${
diff
}
"
10
check_number
"
${
preChain33Balance
}
"
"188.0000"
check_number
"
${
nowChain33Balance
}
"
"195.0000"
}
...
...
@@ -173,11 +169,11 @@ loop_send_lock_erc20() {
i
=
0
preEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[
8
]
}
"
-t
"
${
tokenAddr
}
"
)
approveTxHash
=
$(${
CLIA
}
relayer ethereum approve
-m
10
-k
"
${
privateKeys
[
5
]
}
"
-t
"
${
tokenAddr
}
"
)
echo
${
i
}
"lock-async erc20 approve tx hash:"
${
approveTxHash
}
while
[[
i
-lt
${#
privateKeys
[@]
}
]]
;
do
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
1
-k
"
${
privateKeys
[
8
]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddr
}
"
)
ethTxHash
=
$(${
CLIA
}
relayer ethereum lock-async
-m
1
-k
"
${
privateKeys
[
5
]
}
"
-r
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
"
${
tokenAddr
}
"
)
echo
${
i
}
"lock-async erc20 tx hash:"
${
ethTxHash
}
let
i++
done
...
...
@@ -187,11 +183,11 @@ loop_send_lock_erc20() {
nowEthBalance
=
$(${
CLIA
}
relayer ethereum balance
-o
"
${
Ethsender
}
"
-t
"
${
tokenAddr
}
"
| jq
-r
".balance"
)
res
=
$((
preEthBalance
-
nowEthBalance
))
echo
${
i
}
"preBalance"
${
preEthBalance
}
"nowBalance"
${
nowEthBalance
}
"diff"
${
res
}
check_number
"
${
diff
}
"
10
check_number
"
${
diff
}
"
7
nowChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
diff
=
$((
nowChain33Balance
-
preChain33Balance
))
check_number
"
${
diff
}
"
10
check_number
"
${
diff
}
"
7
}
...
...
@@ -223,7 +219,7 @@ loop_send_burn_erc20() {
nowChain33Balance
=
$(${
Chain33_CLI
}
x2ethereum balance
-s
12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv
-t
testc | jq
".res"
| jq
".[]"
| jq
".balance"
|
sed
's/\"//g'
)
diff
=
$((
preChain33Balance
-
nowChain33Balance
))
check_number
"
${
diff
}
"
10
check_number
"
${
diff
}
"
7
}
perf_test_main
()
{
...
...
plugin/dapp/x2Ethereum/cmd/build/testcase.sh
View file @
43f35118
...
...
@@ -12,6 +12,6 @@ function x2Ethereum() {
set
+e
set
-x
AllRelayerMainTest 1
perf_test_main 1
perf_test_main 1
0
fi
}
plugin/dapp/x2Ethereum/ebrelayer/ethtxs/utils.go
View file @
43f35118
...
...
@@ -93,7 +93,7 @@ func getNonce(sender common.Address, backend bind.ContractBackend) (*big.Int, er
defer
nonceMutex
.
rw
.
Unlock
()
nonceMutex
.
nonce
+=
1
addr2Nonce
[
sender
]
=
nonceMutex
txslog
.
Debug
(
"getNonce"
,
"address"
,
sender
.
String
(),
"nonce"
,
nonceMutex
.
nonce
)
txslog
.
Debug
(
"getNonce
from cache
"
,
"address"
,
sender
.
String
(),
"nonce"
,
nonceMutex
.
nonce
)
return
big
.
NewInt
(
nonceMutex
.
nonce
),
nil
}
...
...
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