Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make legacy URL optional for v03, make block number required for conditional upkeeps using data streams #13263

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tall-eagles-run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

tune debugging script #bugfix
4 changes: 2 additions & 2 deletions core/scripts/chaincli/DEBUGGING.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ Execute the following command based on your upkeep type:
- For custom logic:

```bash
go run main.go keeper debug UPKEEP_ID [OPTIONAL BLOCK_NUMBER]
go run main.go keeper debug UPKEEP_ID [BLOCK_NUMBER]
```
If you don't specify a block number, the debugging script uses the latest block.
If you don't specify a block number, the debugging script uses the latest block for checkUpkeep and simulatePerformUpkeep. For conditional upkeeps using streams lookup, a BLOCK_NUMBER is required.

- For log trigger upkeep:

Expand Down
8 changes: 7 additions & 1 deletion core/scripts/chaincli/handler/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ func (k *Keeper) Debug(ctx context.Context, args []string) {
message("upkeep reverted with StreamsLookup")
message(fmt.Sprintf("StreamsLookup data: {FeedParamKey: %s, Feeds: %v, TimeParamKey: %s, Time: %d, ExtraData: %s}", streamsLookupErr.FeedParamKey, streamsLookupErr.Feeds, streamsLookupErr.TimeParamKey, streamsLookupErr.Time.Uint64(), hexutil.Encode(streamsLookupErr.ExtraData)))

if blockNum == 0 {
failCheckConfig("Data streams requires a valid block number for conditional upkeeps, append a block number to your command", nil)
}
streamsLookup := &mercury.StreamsLookup{
StreamsLookupError: &mercury.StreamsLookupError{
FeedParamKey: streamsLookupErr.FeedParamKey,
Expand All @@ -293,14 +296,17 @@ func (k *Keeper) Debug(ctx context.Context, args []string) {
if !allowed {
resolveIneligible("upkeep reverted with StreamsLookup but is not allowed to access streams")
}
if k.cfg.DataStreamsLegacyURL == "" {
failCheckConfig("Data streams v02 requires Legacy URL, check your DATA_STREAMS settings in .env", nil)
}
} else if streamsLookup.IsMercuryV03() {
// handle v0.3
message("using data streams lookup v0.3")
} else {
resolveIneligible("upkeep reverted with StreamsLookup but the configuration is invalid")
}

if k.cfg.DataStreamsLegacyURL == "" || k.cfg.DataStreamsURL == "" || k.cfg.DataStreamsID == "" || k.cfg.DataStreamsKey == "" {
if k.cfg.DataStreamsURL == "" || k.cfg.DataStreamsID == "" || k.cfg.DataStreamsKey == "" {
failCheckConfig("Data streams configs not set properly for this network, check your DATA_STREAMS settings in .env", nil)
}

Expand Down
Loading