Skip to content

Commit

Permalink
Merge branch 'develop' into lp_tests_final_fix_and_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
Tofel authored Jan 9, 2024
2 parents 9f09b95 + 61f42ce commit 428505f
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 4 deletions.
15 changes: 15 additions & 0 deletions core/scripts/chaincli/.env.debugging.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [Mandatory] http url of the archival node for your network
NODE_URL=<Https RPC Archival Node Addr>
# [Mandatory] address of the KeeperRegistry contract for your upkeep
KEEPER_REGISTRY_ADDRESS=<Registry Address>

# [Optional] it is strongly recommended (not mandatory) to use tenderly for more debugging info
#TENDERLY_KEY=<Tenderly Key>
#TENDERLY_ACCOUNT_NAME=<Tenderly Account Name>
#TENDERLY_PROJECT_NAME=<Tenderly Project Name>

# [Optional] add mercury info only if your upkeep uses mercury
#MERCURY_ID=<Mercury ID>
#MERCURY_KEY=<Mercury Key>
#MERCURY_LEGACY_URL=<Mercury Legacy URL>
#MERCURY_URL=<Mercury Server URL>
13 changes: 12 additions & 1 deletion core/scripts/chaincli/handler/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
evm21 "github.com/smartcontractkit/chainlink/v2/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21"

commonhex "github.com/smartcontractkit/chainlink-common/pkg/utils/hex"

"github.com/smartcontractkit/chainlink/core/scripts/chaincli/config"
"github.com/smartcontractkit/chainlink/core/scripts/common"
"github.com/smartcontractkit/chainlink/v2/core/gethwrappers/generated/automation_utils_2_1"
Expand Down Expand Up @@ -362,7 +363,17 @@ func (k *Keeper) Debug(ctx context.Context, args []string) {
if simulateResult.Success {
resolveEligible()
} else {
resolveIneligible("simulate perform upkeep unsuccessful")
// Convert performGas to *big.Int for comparison
performGasBigInt := new(big.Int).SetUint64(uint64(upkeepInfo.PerformGas))
// Compare PerformGas and GasUsed
result := performGasBigInt.Cmp(simulateResult.GasUsed)

if result < 0 {
// PerformGas is smaller than GasUsed
resolveIneligible(fmt.Sprintf("simulate perform upkeep unsuccessful, PerformGas (%d) is lower than GasUsed (%s)", upkeepInfo.PerformGas, simulateResult.GasUsed.String()))
} else {
resolveIneligible("simulate perform upkeep unsuccessful")
}
}
}

Expand Down
1 change: 0 additions & 1 deletion core/services/chainlink/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,6 @@ func NewApplication(opts ApplicationOpts) (Application, error) {
keyStore.Eth(),
opts.RelayerChainInteroperators,
mailMon,
eventBroadcaster,
)
delegates[job.Bootstrap] = ocrbootstrap.NewDelegateBootstrap(
db,
Expand Down
2 changes: 1 addition & 1 deletion core/services/job/spawner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ func TestSpawner_CreateJobDeleteJob(t *testing.T) {
ocr2DelegateConfig := ocr2.NewDelegateConfig(config.OCR2(), config.Mercury(), config.Threshold(), config.Insecure(), config.JobPipeline(), config.Database(), processConfig)

d := ocr2.NewDelegate(nil, orm, nil, nil, nil, nil, monitoringEndpoint, legacyChains, lggr, ocr2DelegateConfig,
keyStore.OCR2(), keyStore.DKGSign(), keyStore.DKGEncrypt(), ethKeyStore, testRelayGetter, mailMon, nil)
keyStore.OCR2(), keyStore.DKGSign(), keyStore.DKGEncrypt(), ethKeyStore, testRelayGetter, mailMon)
delegateOCR2 := &delegate{jobOCR2VRF.Type, []job.ServiceCtx{}, 0, nil, d}

spawner := job.NewSpawner(orm, config.Database(), noopChecker{}, map[job.Type]job.Delegate{
Expand Down
1 change: 0 additions & 1 deletion core/services/ocr2/delegate.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ func NewDelegate(
ethKs keystore.Eth,
relayers RelayGetter,
mailMon *mailbox.Monitor,
eventBroadcaster pg.EventBroadcaster,
) *Delegate {
return &Delegate{
db: db,
Expand Down

0 comments on commit 428505f

Please sign in to comment.