Skip to content

Commit

Permalink
fix tx already sent by inturn relayer but fail to udpate DB tx status
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgao001 committed Sep 22, 2023
1 parent 1ecbfae commit 3447217
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assembler/bsc_assembler.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (a *BSCAssembler) process(channelId types.ChannelId) error {
// broadcast on Node2 will fail due to inconsistency of nonce and channel sequence.
// Even the inturn relayer can resume crosschain delivery at next block(Because realyer would retry batch2 at block H+1). But it would
// waste plenty of gas. In that case, pasue the relayer 1 block. calibrate inturn relayer nonce and sequence
if errors.IsOf(err, sdkErrors.ErrWrongSequence, oracletypes.ErrInvalidReceiveSequence) {
if errors.IsOf(err, sdkErrors.ErrWrongSequence, sdkErrors.ErrTxInMempoolCache, oracletypes.ErrInvalidReceiveSequence) {
newNonce, nonceErr := a.greenfieldExecutor.GetNonceOnNextBlock()
if nonceErr != nil {
return nonceErr
Expand Down
4 changes: 4 additions & 0 deletions executor/greenfield_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,10 @@ func (e *GreenfieldExecutor) ClaimPackages(client *GreenfieldClient, payloadBts
return "", sdkErrors.ErrWrongSequence
}

if txRes.Codespace == sdkErrors.RootCodespace && txRes.Code == sdkErrors.ErrTxInMempoolCache.ABCICode() {
return "", sdkErrors.ErrTxInMempoolCache
}

if txRes.Code != 0 {
return "", fmt.Errorf("claim error, code=%d, log=%s", txRes.Code, txRes.RawLog)
}
Expand Down

0 comments on commit 3447217

Please sign in to comment.