Skip to content

Commit

Permalink
remove duplicate logging
Browse files Browse the repository at this point in the history
  • Loading branch information
shileiwill committed Dec 12, 2023
1 parent 0a40671 commit 192935a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
2 changes: 1 addition & 1 deletion core/scripts/chaincli/handler/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ func (k *Keeper) Debug(ctx context.Context, args []string) {
resolveIneligible("the mercury request data is invalid")
}
if err != nil {
resolveIneligible("failed to DoMercuryRequest")
failCheckConfig("failed to do mercury request ", err)
}

// do checkCallback
Expand Down
3 changes: 0 additions & 3 deletions core/scripts/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ go 1.21.3
replace github.com/smartcontractkit/chainlink/v2 => ../../

require (
github.com/avast/retry-go v3.0.0+incompatible
github.com/ava-labs/coreth v0.12.1
github.com/docker/docker v24.0.7+incompatible
github.com/docker/go-connections v0.4.0
github.com/ethereum/go-ethereum v1.12.0
Expand All @@ -19,7 +17,6 @@ require (
github.com/montanaflynn/stats v0.7.1
github.com/olekukonko/tablewriter v0.0.5
github.com/pelletier/go-toml/v2 v2.1.1
github.com/pkg/errors v0.9.1
github.com/shopspring/decimal v1.3.1
github.com/smartcontractkit/chainlink-automation v1.0.1
github.com/smartcontractkit/chainlink-vrf v0.0.0-20231120191722-fef03814f868
Expand Down
6 changes: 0 additions & 6 deletions core/scripts/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@ github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmV
github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA=
github.com/armon/go-metrics v0.4.1/go.mod h1:E6amYzXo6aW1tqzoZGT755KkbgrJsSdpwZ+3JqfkOG4=
github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8=
github.com/avast/retry-go v3.0.0+incompatible h1:4SOWQ7Qs+oroOTQOYnAHqelpCO0biHSxpiH9JdtuBj0=
github.com/avast/retry-go v3.0.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/ava-labs/avalanchego v1.10.1 h1:lBeamJ1iNq+p2oKg2nAs+A65m8vhSDjkiTDbwzQW7kY=
github.com/ava-labs/avalanchego v1.10.1/go.mod h1:ZvSXWlbkUKlbk3BsWx29a+8eVHe/WBsOxh55BSGoeRk=
github.com/ava-labs/coreth v0.12.1 h1:EWSkFGHGVUxmu1pnSK/2pdcxaAVHbGspHqO3Ag+i7sA=
github.com/ava-labs/coreth v0.12.1/go.mod h1:/5x54QlIKjlPebkdzTA5ic9wXdejbWOnQosztkv9jxo=
github.com/avast/retry-go/v4 v4.5.1 h1:AxIx0HGi4VZ3I02jr78j5lZ3M6x1E0Ivxa6b0pUUh7o=
github.com/avast/retry-go/v4 v4.5.1/go.mod h1:/sipNsvNB3RRuT5iNcb6h73nw3IBmXJ/H3XrCQYSOpc=
github.com/aws/aws-sdk-go v1.22.1/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func (s *streams) doLookup(ctx context.Context, wg *sync.WaitGroup, lookup *merc
func (s *streams) CheckCallback(ctx context.Context, values [][]byte, lookup *mercury.StreamsLookup, checkResults []ocr2keepers.CheckResult, i int) error {
payload, err := s.abi.Pack("checkCallback", lookup.UpkeepId, values, lookup.ExtraData)
if err != nil {
s.lggr.Errorf("at block %d upkeep %s checkCallback packing err: %s", lookup.Block, lookup.UpkeepId, err.Error())
checkResults[i].Retryable = false
checkResults[i].PipelineExecutionState = uint8(mercury.PackUnpackDecodeFailed)
return err
Expand All @@ -203,7 +202,6 @@ func (s *streams) CheckCallback(ctx context.Context, values [][]byte, lookup *me

// call checkCallback function at the block which OCR3 has agreed upon
if err = s.client.CallContext(ctx, &mercuryBytes, "eth_call", args, hexutil.EncodeUint64(lookup.Block)); err != nil {
s.lggr.Errorf("at block %d upkeep %s checkCallback err: %s", lookup.Block, lookup.UpkeepId, err.Error())
checkResults[i].Retryable = true
checkResults[i].PipelineExecutionState = uint8(mercury.RpcFlakyFailure)
return err
Expand All @@ -213,22 +211,21 @@ func (s *streams) CheckCallback(ctx context.Context, values [][]byte, lookup *me

unpackCallBackState, needed, performData, failureReason, _, err := s.packer.UnpackCheckCallbackResult(mercuryBytes)
if err != nil {
s.lggr.Errorf("at block %d upkeep %s requested time %s UnpackCheckCallbackResult err: %s", lookup.Block, lookup.UpkeepId, lookup.Time, err.Error())
checkResults[i].PipelineExecutionState = unpackCallBackState
return err
}

if failureReason == uint8(mercury.MercuryUpkeepFailureReasonMercuryCallbackReverted) {
checkResults[i].IneligibilityReason = uint8(mercury.MercuryUpkeepFailureReasonMercuryCallbackReverted)
s.lggr.Debugf("at block %d upkeep %s requested time %s mercury callback reverts", lookup.Block, lookup.UpkeepId, lookup.Time)
return fmt.Errorf("at block %d upkeep %s requested time %s mercury callback reverts", lookup.Block, lookup.UpkeepId, lookup.Time)
return nil

}

if !needed {
checkResults[i].IneligibilityReason = uint8(mercury.MercuryUpkeepFailureReasonUpkeepNotNeeded)
s.lggr.Debugf("at block %d upkeep %s requested time %s callback reports upkeep not needed", lookup.Block, lookup.UpkeepId, lookup.Time)
return fmt.Errorf("at block %d upkeep %s requested time %s callback reports upkeep not needed", lookup.Block, lookup.UpkeepId, lookup.Time)
return nil
}

checkResults[i].IneligibilityReason = uint8(mercury.MercuryUpkeepFailureReasonNone)
Expand All @@ -250,7 +247,6 @@ func (s *streams) DoMercuryRequest(ctx context.Context, lookup *mercury.StreamsL
}

if err != nil {
s.lggr.Errorf("at block %d upkeep %s requested time %s retryable %v retryInterval %s doMercuryRequest: %s", lookup.Block, lookup.UpkeepId, lookup.Time, retryable, retryInterval, err.Error())
checkResults[i].Retryable = retryable
checkResults[i].RetryInterval = retryInterval
checkResults[i].PipelineExecutionState = uint8(state)
Expand Down

0 comments on commit 192935a

Please sign in to comment.