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

VRF zero confirmation delay #11947

Merged
merged 12 commits into from
Feb 15, 2024

Conversation

jinhoonbang
Copy link
Contributor

@jinhoonbang jinhoonbang commented Feb 6, 2024

  • Enable 0 confirmation delays in VRF. On-chains that have instant finalization, VRF can respond without waiting for block confirmation delays.
  • With the above change, simulation fails because blockhash for the current tip of blockchains are empty (i.e. blockhash(block.number) == 0). So, this PR allows simulation tasks (task.ethcall and task.estimategas to accept an optional block parameter, which can be either "latest" or "pending"). VRF will use "pending" blocks for simulations

Copy link
Contributor

github-actions bot commented Feb 6, 2024

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

Copy link
Contributor

github-actions bot commented Feb 6, 2024

Go solidity wrappers are out-of-date, regenerate them via the make wrappers-all command

@jinhoonbang jinhoonbang force-pushed the VRF-877-nexon-test-with-0-min-confirmation-blocks branch from fe0779a to f053dba Compare February 9, 2024 04:11
@jinhoonbang jinhoonbang changed the title nexon-dev-vrfv2-load-test VRF zero confirmation delay Feb 9, 2024
@jinhoonbang jinhoonbang marked this pull request as ready for review February 9, 2024 07:31
@jinhoonbang jinhoonbang requested review from a team as code owners February 9, 2024 07:31
contractAddr := common.HexToAddress("0xDeaDbeefdEAdbeefdEadbEEFdeadbeEFdEaDbeeF")
//[]byte("baz quux")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

??

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops. removed

@iljapavlovs
Copy link
Collaborator

Could we also add block="latest|pending" to super scripts?

…ion delay (only v2 plus) and add simulation block option to superscript
@jinhoonbang
Copy link
Contributor Author

Could we also add block="latest|pending" to super scripts?

added. The default is set to "pending" now.

core/scripts/common/vrf/jobs/jobs.go Outdated Show resolved Hide resolved
core/scripts/common/vrf/jobs/jobs.go Outdated Show resolved Hide resolved
core/scripts/common/vrf/jobs/jobs.go Outdated Show resolved Hide resolved
core/scripts/common/vrf/jobs/jobs.go Outdated Show resolved Hide resolved
Copy link
Contributor

@leeyikjiun leeyikjiun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

nits:

  1. Some of the newly added block="%s"] are not aligned.
  2. There's so many s != "pending" && s != "latest" now that we could consider adding a IsPendingOrLatest helper function.

@iljapavlovs iljapavlovs self-requested a review February 15, 2024 17:05
@jinhoonbang
Copy link
Contributor Author

LGTM!

nits:

  1. Some of the newly added block="%s"] are not aligned.
  2. There's so many s != "pending" && s != "latest" now that we could consider adding a IsPendingOrLatest helper function.

makes sense! i'll address this in a separate PR

@jinhoonbang jinhoonbang added this pull request to the merge queue Feb 15, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 15, 2024
@jinhoonbang jinhoonbang added this pull request to the merge queue Feb 15, 2024
Merged via the queue into develop with commit b3f8719 Feb 15, 2024
93 checks passed
@jinhoonbang jinhoonbang deleted the VRF-877-nexon-test-with-0-min-confirmation-blocks branch February 15, 2024 18:50
momentmaker added a commit that referenced this pull request Feb 15, 2024
* develop: (74 commits)
  VRF zero confirmation delay  (#11947)
  add toml configs to paths that can cause e2e tests to run in ci (#12001)
  bump golang.org/x/... (#12042)
  [chore] Replace clock with specialized lib (#12031)
  Update style guide (#12041)
  plugins/cmd/chainlink-mercury: (re)move to chainlink-data-streams repo (#11994)
  bump go-plugin (#12033)
  Adds timeout on fuzz script execution (#12024)
  Add bytes type to abi_type (#12029)
  AUTO-8804: create chain specific modules for l1 gas calculations (#11896)
  VRF-878 Gas Optimization V2 Plus (#11982)
  Improving deletes performance by limiting number of records to scan (#12007)
  core/web: improve health CLI readabilty (#12021)
  Handle a 0 exit code from the remote runner instead of always failing (#12015)
  Add a simple Codec test (#12006)
  Allow for custom config poller onchain codec (LLO support) (#11957)
  Update Sonar properties (#11986)
  golangci-lint: revive: add early-return; fix issues (#12017)
  Implement NewPluginProvider (EVM) (#11995)
  Fix lock file version and minor NPM bumps (#11980)
  ...
jinhoonbang added a commit that referenced this pull request Feb 15, 2024
* allow 0 confirmation delays in VRF; use pending block for simulation in VRF

* fix script build error

* fix failing automation test

* fix more tests

* integraiton test wip

* add integration tests for pending simulation block and zero confirmation delay (only v2 plus) and add simulation block option to superscript

* Update core/chains/evm/client/simulated_backend_client.go

Co-authored-by: Chris Cushman <[email protected]>

* use pendingContractCall instead of low-level call contract

* fix eth_call_test.go

* handle nil gas and gasPrice in backend test client for estimateGas

---------

Co-authored-by: Ilja Pavlovs <[email protected]>
Co-authored-by: Chris Cushman <[email protected]>
jinhoonbang added a commit that referenced this pull request Feb 16, 2024
* allow 0 confirmation delays in VRF; use pending block for simulation in VRF

* fix script build error

* fix failing automation test

* fix more tests

* integraiton test wip

* add integration tests for pending simulation block and zero confirmation delay (only v2 plus) and add simulation block option to superscript

* Update core/chains/evm/client/simulated_backend_client.go

Co-authored-by: Chris Cushman <[email protected]>

* use pendingContractCall instead of low-level call contract

* fix eth_call_test.go

* handle nil gas and gasPrice in backend test client for estimateGas

---------

Co-authored-by: Ilja Pavlovs <[email protected]>
Co-authored-by: Chris Cushman <[email protected]>
jinhoonbang added a commit that referenced this pull request Feb 16, 2024
* allow 0 confirmation delays in VRF; use pending block for simulation in VRF

* fix script build error

* fix failing automation test

* fix more tests

* integraiton test wip

* add integration tests for pending simulation block and zero confirmation delay (only v2 plus) and add simulation block option to superscript

* Update core/chains/evm/client/simulated_backend_client.go

Co-authored-by: Chris Cushman <[email protected]>

* use pendingContractCall instead of low-level call contract

* fix eth_call_test.go

* handle nil gas and gasPrice in backend test client for estimateGas

---------

Co-authored-by: Ilja Pavlovs <[email protected]>
Co-authored-by: Chris Cushman <[email protected]>
kidambisrinivas pushed a commit that referenced this pull request Mar 18, 2024
* allow 0 confirmation delays in VRF; use pending block for simulation in VRF

* fix script build error

* fix failing automation test

* fix more tests

* integraiton test wip

* add integration tests for pending simulation block and zero confirmation delay (only v2 plus) and add simulation block option to superscript

* Update core/chains/evm/client/simulated_backend_client.go

Co-authored-by: Chris Cushman <[email protected]>

* use pendingContractCall instead of low-level call contract

* fix eth_call_test.go

* handle nil gas and gasPrice in backend test client for estimateGas

---------

Co-authored-by: Ilja Pavlovs <[email protected]>
Co-authored-by: Chris Cushman <[email protected]>
kidambisrinivas pushed a commit that referenced this pull request Mar 18, 2024
* allow 0 confirmation delays in VRF; use pending block for simulation in VRF

* fix script build error

* fix failing automation test

* fix more tests

* integraiton test wip

* add integration tests for pending simulation block and zero confirmation delay (only v2 plus) and add simulation block option to superscript

* Update core/chains/evm/client/simulated_backend_client.go

Co-authored-by: Chris Cushman <[email protected]>

* use pendingContractCall instead of low-level call contract

* fix eth_call_test.go

* handle nil gas and gasPrice in backend test client for estimateGas

---------

Co-authored-by: Ilja Pavlovs <[email protected]>
Co-authored-by: Chris Cushman <[email protected]>
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.

6 participants