From c142e4a79f55c9159356bda1e4f4403ec4eaf189 Mon Sep 17 00:00:00 2001 From: Terry Date: Tue, 6 Jun 2023 01:50:48 +0800 Subject: [PATCH 1/3] Keep running the whole tipset task without cancel --- chain/indexer/integrated/tipset/tipset.go | 1 - 1 file changed, 1 deletion(-) diff --git a/chain/indexer/integrated/tipset/tipset.go b/chain/indexer/integrated/tipset/tipset.go index 26782ad6d..875c447c4 100644 --- a/chain/indexer/integrated/tipset/tipset.go +++ b/chain/indexer/integrated/tipset/tipset.go @@ -145,7 +145,6 @@ func (ti *TipSetIndexer) TipSet(ctx context.Context, ts *types.TipSet) (chan *Re if res.Error != nil { llt.Errorw("task returned with error", "error", res.Error.Error()) errCh <- res.Error - return } // processor is complete if we receive a result executingTasks[res.Task] = true From 8ae4ac22b187df95573f747af1878d14dbb5d962 Mon Sep 17 00:00:00 2001 From: Terry Date: Tue, 6 Jun 2023 14:47:41 +0800 Subject: [PATCH 2/3] put the error to report ErrorsDetected --- tasks/fevm/blockheader/tasks.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tasks/fevm/blockheader/tasks.go b/tasks/fevm/blockheader/tasks.go index b7096de38..715ab2134 100644 --- a/tasks/fevm/blockheader/tasks.go +++ b/tasks/fevm/blockheader/tasks.go @@ -48,24 +48,27 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut cid, err := executed.Key().Cid() if err != nil { log.Errorf("Error at getting cid: [%v] err: %v", cid, err) - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } hash, err := ethtypes.EthHashFromCid(cid) if err != nil { log.Errorf("Error at finding hash: [%v] err: %v", hash, err) - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } ethBlock, err := p.node.EthGetBlockByHash(ctx, hash, false) if err != nil { log.Errorf("EthGetBlockByHash: [hash: %v] err: %v", hash.String(), err) - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } if ethBlock.Number == 0 { log.Warn("block number == 0") - return nil, report, err + return nil, report, nil } return &fevm.FEVMBlockHeader{ Height: int64(executed.Height()), From 0ad4923a0401d5836b1bd575e5d6c1ff6384ebdc Mon Sep 17 00:00:00 2001 From: Terry Date: Tue, 6 Jun 2023 15:03:01 +0800 Subject: [PATCH 3/3] Add error to errordetected --- tasks/fevm/contract/task.go | 9 ++++----- tasks/fevm/receipt/tasks.go | 9 ++++----- tasks/fevm/transaction/tasks.go | 9 ++++----- 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/tasks/fevm/contract/task.go b/tasks/fevm/contract/task.go index 25c41ae6a..3a70e7d0c 100644 --- a/tasks/fevm/contract/task.go +++ b/tasks/fevm/contract/task.go @@ -53,7 +53,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut actorChanges, err := p.node.ActorStateChanges(ctx, current, executed) if err != nil { - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } out := make(fevm.FEVMContractList, 0) @@ -109,10 +110,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut } if len(errs) > 0 { - err = fmt.Errorf("%v", errs) - } else { - err = nil + report.ErrorsDetected = fmt.Errorf("%v", errs) } - return model.PersistableList{out}, report, err + return model.PersistableList{out}, report, nil } diff --git a/tasks/fevm/receipt/tasks.go b/tasks/fevm/receipt/tasks.go index 9e16c874f..57da3e1a7 100644 --- a/tasks/fevm/receipt/tasks.go +++ b/tasks/fevm/receipt/tasks.go @@ -55,7 +55,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut messages, err := p.node.ChainGetMessagesInTipset(ctx, executed.Key()) if err != nil { log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", executed.String(), executed.Height(), err) - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } errs := []error{} out := make(fevm.FEVMReceiptList, 0) @@ -115,10 +116,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut } if len(errs) > 0 { - err = fmt.Errorf("%v", errs) - } else { - err = nil + report.ErrorsDetected = fmt.Errorf("%v", errs) } - return model.PersistableList{out}, report, err + return model.PersistableList{out}, report, nil } diff --git a/tasks/fevm/transaction/tasks.go b/tasks/fevm/transaction/tasks.go index 32690a4d6..666b9e734 100644 --- a/tasks/fevm/transaction/tasks.go +++ b/tasks/fevm/transaction/tasks.go @@ -53,7 +53,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut messages, err := p.node.ChainGetMessagesInTipset(ctx, executed.Key()) if err != nil { log.Errorf("Error at getting messages. ts: %v, height: %v, err: %v", executed.String(), executed.Height(), err) - return nil, report, err + report.ErrorsDetected = err + return nil, report, nil } errs := []error{} out := make(fevm.FEVMTransactionList, 0) @@ -127,10 +128,8 @@ func (p *Task) ProcessTipSets(ctx context.Context, current *types.TipSet, execut } if len(errs) > 0 { - err = fmt.Errorf("%v", errs) - } else { - err = nil + report.ErrorsDetected = fmt.Errorf("%v", errs) } - return model.PersistableList{out}, report, err + return model.PersistableList{out}, report, nil }