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

Insert time interval based heartbeats in BHS store #10682

Merged
merged 27 commits into from
Sep 21, 2023

Conversation

kidambisrinivas
Copy link
Collaborator

@kidambisrinivas kidambisrinivas commented Sep 18, 2023

Motivation

  • VRF Incident SlowVRFv2Fulfillment: [POLYGON-MAINNET] [VRFv2] A randomness request with keyhash "0x.." has not been fulfilled for 28403 blocks. StalledVRFv2Fulfillment: [POLYGON-MAINNET] [VRFv2] A randomness request for "0x.." (0xgw..) has stalled, there has not been a fullfilment for 28403 blocks [Incident #649766]

Solution

  • A redundant method by which we insert blockhashes into the BHS store at a regular basis irrespective of whether there are VRF requests going on or not, in case the log poller-based BHS has problems and can no longer read logs / the chain and we need to run a backwards mode.
  • It seems that it might be best to have a wall-clock timer rather than a block-timer for this

Testing

$ cd chainlink
$ go test -count=1 ./core/services/blockhashstore/...
ok      github.com/smartcontractkit/chainlink/v2/core/services/blockhashstore   1.878s

$ go test -count=1 ./core/services/job/...
?       github.com/smartcontractkit/chainlink/v2/core/services/job/mocks        [no test files]
ok      github.com/smartcontractkit/chainlink/v2/core/services/job      3.379s

$ go test -count=1 ./core/web/presenters/...
ok      github.com/smartcontractkit/chainlink/v2/core/web/presenters    0.515s

$ go test -count=1 ./core/web/resolver/...
ok      github.com/smartcontractkit/chainlink/v2/core/web/resolver      1.129s

$ go test -count=1 -v -run="^TestStartHeartbeats$" ./core/services/vrf/v2/...
...
--- PASS: TestStartHeartbeats (6.37s)
    --- PASS: TestStartHeartbeats/bhs_feeder_startheartbeats_happy_path (6.14s)
PASS
ok      github.com/smartcontractkit/chainlink/v2/core/services/vrf/v2   7.248s

@github-actions
Copy link
Contributor

I see that you haven't updated any README files. Would it make sense to do so?

@jinhoonbang
Copy link
Contributor

I think we might need to update job ORM, migrations and web view layer. Here's an example commit that adds a new field (fromAddresses) to a BHS job spec - aeb2c16

@makramkd
Copy link
Contributor

Note that you also need to add the appropriate database migration for the new field. See https://github.com/smartcontractkit/chainlink/pull/8487/files as an example for the BHS job.

@kidambisrinivas
Copy link
Collaborator Author

kidambisrinivas commented Sep 20, 2023

Note that you also need to add the appropriate database migration for the new field

Done

@jinhoonbang
Copy link
Contributor

I think we need to changes to job/orm.go as well.

@kidambisrinivas kidambisrinivas force-pushed the VRF-596-BHS-Insert-Heartbeats branch from 2e4388c to 6c4dcb1 Compare September 21, 2023 00:00
@kidambisrinivas kidambisrinivas force-pushed the VRF-596-BHS-Insert-Heartbeats branch from 6c4dcb1 to 06b02d2 Compare September 21, 2023 00:30
@cl-sonarqube-production
Copy link

SonarQube Quality Gate

Quality Gate failed

Failed condition 0.0% 0.0% Coverage on New Code (is less than 80%)

See analysis details on SonarQube

@kidambisrinivas kidambisrinivas added this pull request to the merge queue Sep 21, 2023
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Sep 21, 2023
@kidambisrinivas kidambisrinivas added this pull request to the merge queue Sep 21, 2023
Merged via the queue into develop with commit 5b80ba6 Sep 21, 2023
@kidambisrinivas kidambisrinivas deleted the VRF-596-BHS-Insert-Heartbeats branch September 21, 2023 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants