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
08d6555a
Commit
08d6555a
authored
Dec 14, 2021
by
hezhengjun
Committed by
33cn
Dec 15, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filter old push
parent
4b977fc8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
proc.go
...ss2eth/ebrelayer/relayer/chain33/transceiver/sync/proc.go
+9
-10
No files found.
plugin/dapp/cross2eth/ebrelayer/relayer/chain33/transceiver/sync/proc.go
View file @
08d6555a
...
@@ -106,17 +106,11 @@ func (syncTx *EVMTxLogs) SaveAndSyncTxs2Relayer() {
...
@@ -106,17 +106,11 @@ func (syncTx *EVMTxLogs) SaveAndSyncTxs2Relayer() {
// 处理输入流程
// 处理输入流程
func
(
syncTx
*
EVMTxLogs
)
dealEVMTxLogs
(
evmTxLogsInBlks
*
types
.
EVMTxLogsInBlks
)
{
func
(
syncTx
*
EVMTxLogs
)
dealEVMTxLogs
(
evmTxLogsInBlks
*
types
.
EVMTxLogsInBlks
)
{
count
,
start
,
evmTxLogsParsed
,
err
:=
parseEvmTxLogsInBlks
(
evmTxLogsInBlks
)
count
,
start
,
evmTxLogsParsed
,
err
:=
parseEvmTxLogsInBlks
(
evmTxLogsInBlks
,
syncTx
.
seqNum
)
if
err
!=
nil
{
if
err
!=
nil
{
resultCh
<-
err
resultCh
<-
err
}
}
//正常情况下,本次开始的的seq不能小于上次结束的seq
if
start
<
syncTx
.
seqNum
{
log
.
Error
(
"dealEVMTxLogs err: the tx and receipt pushed is old"
,
"start"
,
start
,
"current_seq"
,
syncTx
.
seqNum
)
resultCh
<-
errors
.
New
(
"The tx and receipt pushed is old"
)
return
}
var
height
int64
var
height
int64
for
i
:=
0
;
i
<
count
;
i
++
{
for
i
:=
0
;
i
<
count
;
i
++
{
txsPerBlock
:=
evmTxLogsParsed
[
i
]
txsPerBlock
:=
evmTxLogsParsed
[
i
]
...
@@ -134,10 +128,9 @@ func (syncTx *EVMTxLogs) dealEVMTxLogs(evmTxLogsInBlks *types.EVMTxLogsInBlks) {
...
@@ -134,10 +128,9 @@ func (syncTx *EVMTxLogs) dealEVMTxLogs(evmTxLogsInBlks *types.EVMTxLogsInBlks) {
syncTx
.
setBlockHeight
(
height
)
syncTx
.
setBlockHeight
(
height
)
}
}
}
}
//syncTx.syncReceiptChan <- height
//发送回复,确认接收成功
//发送回复,确认接收成功
resultCh
<-
nil
resultCh
<-
nil
log
.
Debug
(
"dealEVMTxLogs"
,
"seqStart"
,
start
,
"count"
,
count
,
"maxBlockHeight"
,
height
)
log
.
Debug
(
"dealEVMTxLogs"
,
"seqStart"
,
start
,
"count"
,
count
,
"maxBlockHeight"
,
height
,
"syncTx.seqNum"
,
syncTx
.
seqNum
)
}
}
func
(
syncTx
*
EVMTxLogs
)
loadBlockLastSequence
()
(
int64
,
error
)
{
func
(
syncTx
*
EVMTxLogs
)
loadBlockLastSequence
()
(
int64
,
error
)
{
...
@@ -213,7 +206,7 @@ func (syncTx *EVMTxLogs) delTxReceipts(height int64) {
...
@@ -213,7 +206,7 @@ func (syncTx *EVMTxLogs) delTxReceipts(height int64) {
}
}
// 检查输入是否有问题, 并解析输入
// 检查输入是否有问题, 并解析输入
func
parseEvmTxLogsInBlks
(
evmTxLogs
*
types
.
EVMTxLogsInBlks
)
(
count
int
,
start
int64
,
txsWithReceipt
[]
*
types
.
EVMTxLogPerBlk
,
err
error
)
{
func
parseEvmTxLogsInBlks
(
evmTxLogs
*
types
.
EVMTxLogsInBlks
,
seqNumLast
int64
)
(
count
int
,
start
int64
,
txsWithReceipt
[]
*
types
.
EVMTxLogPerBlk
,
err
error
)
{
count
=
len
(
evmTxLogs
.
Logs4EVMPerBlk
)
count
=
len
(
evmTxLogs
.
Logs4EVMPerBlk
)
txsWithReceipt
=
make
([]
*
types
.
EVMTxLogPerBlk
,
0
)
txsWithReceipt
=
make
([]
*
types
.
EVMTxLogPerBlk
,
0
)
start
=
math
.
MaxInt64
start
=
math
.
MaxInt64
...
@@ -223,6 +216,12 @@ func parseEvmTxLogsInBlks(evmTxLogs *types.EVMTxLogsInBlks) (count int, start in
...
@@ -223,6 +216,12 @@ func parseEvmTxLogsInBlks(evmTxLogs *types.EVMTxLogsInBlks) (count int, start in
"height"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
Height
,
"seqOp"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
AddDelType
)
"height"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
Height
,
"seqOp"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
AddDelType
)
continue
continue
}
}
//过滤掉老的信息, 正常情况下,本次开始的的seq不能小于上次结束的seq
if
seqNumLast
>=
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
{
log
.
Error
(
"parseEvmTxLogsInBlks err: the tx and receipt pushed is old"
,
"seqNumLast"
,
seqNumLast
,
"evmTxLogs.Logs4EVMPerBlk[i].SeqNum"
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
,
"i"
,
i
)
continue
}
txsWithReceipt
=
append
(
txsWithReceipt
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
])
txsWithReceipt
=
append
(
txsWithReceipt
,
evmTxLogs
.
Logs4EVMPerBlk
[
i
])
if
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
<
start
{
if
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
<
start
{
start
=
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
start
=
evmTxLogs
.
Logs4EVMPerBlk
[
i
]
.
SeqNum
...
...
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