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-878 Gas Optimization V2 Plus #11982

Merged
merged 18 commits into from
Feb 14, 2024
Merged

Conversation

leeyikjiun
Copy link
Contributor

@leeyikjiun leeyikjiun commented Feb 9, 2024

Optimise gas for VRFCoordinatorV2_5.sol and SubscriptionAPI.sol

  • Replaced all post increment operators with pre increment
  • Assigned local variables when a struct's field or storage is used multiple times
  • Reduce SSTORE by checking if the value will change before writing
  • Use named returns to remove variable allocation
  • Remove variables that are used only once and inline them into the function call itself. The downside to this is that the line number will be messed up when debugging.
  • Re-used variables to reduce variable allocation when appropriate. This makes the code slightly less clear.

Gas changes per test compared with develop
Depending on test set up, it may appear that more gas is reduced than actual.

...
testWithdrawSufficientBalanceLinkSet() (gas: 0 (0.000%)) 
testRecoverFundsAmountToTransfer() (gas: 12 (0.004%)) 
testSetLinkAndLinkNativeFeed() (gas: -326 (-0.009%)) 
testRequestAndFulfillRandomWordsLINKWrapper() (gas: -152 (-0.039%)) 
testRecoverFundsNothingToTransfer() (gas: -222 (-0.044%)) 
testOnTokenTransferSuccess() (gas: -222 (-0.044%)) 
testRequestAndFulfillRandomWordsNativeWrapper() (gas: -152 (-0.048%)) 
testRequestAndFulfillRandomWords_NetworkGasPriceExceedsGasLane() (gas: -478 (-0.078%)) 
testRecoverNativeFundsNothingToTransfer() (gas: -222 (-0.109%)) 
testFundSubscriptionWithNative() (gas: -222 (-0.111%)) 
testRequestAndFulfillRandomWords_OnlyPremium_LinkPayment() (gas: -920 (-0.120%)) 
testRequestAndFulfillRandomWordsLINK() (gas: -920 (-0.120%)) 
testCreateSubscription() (gas: -222 (-0.123%)) 
testRequestAndFulfillRandomWords_OnlyPremium_NativePayment() (gas: -904 (-0.127%)) 
testRequestAndFulfillRandomWordsNative() (gas: -904 (-0.127%)) 
testAddConsumerReaddSameConsumer() (gas: -313 (-0.135%)) 
testAddConsumer() (gas: -326 (-0.144%)) 
testCreateSubscription() (gas: -222 (-0.148%)) 
testOwnerCancelSubscriptionNativeAndLinkFunds() (gas: -735 (-0.162%)) 
testSubscriptionOwnershipTransfer() (gas: -315 (-0.196%)) 
testAddConsumerTooManyConsumers() (gas: -10619 (-0.197%)) 
testCreateSubscriptionRecreate() (gas: -444 (-0.202%)) 
testMigrateWrapperLINKPayment() (gas: -1191 (-0.221%)) 
testMigrateWrapperNativePayment() (gas: -1191 (-0.245%)) 
testMigration() (gas: -1235 (-0.259%)) 
testOwnerCancelSubscriptionLinkFundsOnly() (gas: -1260 (-0.291%)) 
testDeregisterProvingKey() (gas: -260 (-0.300%)) 
testMigrateRevertsWhenInvalidCaller() (gas: -119 (-0.358%)) 
testMigrationNoLink() (gas: -1664 (-0.381%)) 
testMigrateRevertsWhenInvalidCoordinator() (gas: -97 (-0.486%)) 
testOwnerCancelSubscriptionNativeFundsOnly() (gas: -1163 (-0.662%)) 
testGetActiveSubscriptionIds() (gas: -28048 (-0.812%)) 
testCancelSubWithNoLink() (gas: -1390 (-0.867%)) 
testMigrateRevertsWhenReentrant() (gas: -3859 (-1.078%)) 
testMigrateRevertsWhenPendingFulfillment() (gas: -2880 (-1.211%)) 
testDeregister() (gas: -2082 (-2.054%)) 
testOwnerCancelSubscriptionNoFunds() (gas: -3288 (-2.608%)) 
Overall gas change: -68555 (-0.214%)

Gas changes per function compared with develop

@@ -299,37 +186,37 @@ Test result: ok. 8 passed; 0 failed; 0 skipp
 | src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol:ExposedVRFCoordinatorV2_5 contract |                 |       |        |        |         |
 |-----------------------------------------------------------------------------------------------|-----------------|-------|--------|--------|---------|
 | Deployment Cost                                                                               | Deployment Size |       |        |        |         |
-| 5503498                                                                                       | 27881           |       |        |        |         |
+| 5375512                                                                                       | 27242           |       |        |        |         |
 | Function Name                                                                                 | min             | avg   | median | max    | # calls |
 | LINK                                                                                          | 428             | 594   | 428    | 2428   | 12      |
 | LINK_NATIVE_FEED                                                                              | 449             | 1449  | 1449   | 2449   | 2       |
-| acceptSubscriptionOwnerTransfer                                                               | 3241            | 3241  | 3241   | 3241   | 1       |
-| addConsumer                                                                                   | 765             | 49450 | 47544  | 73444  | 120     |
-| cancelSubscription                                                                            | 9462            | 12432 | 11462  | 17345  | 4       |
+| acceptSubscriptionOwnerTransfer                                                               | 3220            | 3220  | 3220   | 3220   | 1       |
+| addConsumer                                                                                   | 765             | 49349 | 47440  | 73340  | 120     |
+| cancelSubscription                                                                            | 7296            | 9931  | 8296   | 15836  | 4       |
 | computeRequestIdExternal                                                                      | 983             | 983   | 983    | 983    | 7       |
-| createSubscription                                                                            | 77254           | 99916 | 88854  | 123054 | 83      |
-| deregisterMigratableCoordinator                                                               | 4472            | 8423  | 6807   | 15607  | 4       |
-| deregisterProvingKey                                                                          | 3480            | 4180  | 4180   | 4880   | 2       |
-| fulfillRandomWords                                                                            | 26378           | 96809 | 101265 | 127632 | 5       |
+| createSubscription                                                                            | 77032           | 99694 | 88632  | 122832 | 83      |
+| deregisterMigratableCoordinator                                                               | 3945            | 7900  | 6285   | 15085  | 4       |
+| deregisterProvingKey                                                                          | 3480            | 4018  | 4018   | 4556   | 2       |
+| fulfillRandomWords                                                                            | 26378           | 96665 | 101093 | 127444 | 5       |
 | fundSubscriptionWithNative                                                                    | 3801            | 32128 | 43601  | 51601  | 15      |
-| getActiveSubscriptionIds                                                                      | 6223            | 10584 | 8414   | 30137  | 9       |
+| getActiveSubscriptionIds                                                                      | 6172            | 10485 | 8339   | 29822  | 9       |
 | getActiveSubscriptionIdsLength                                                                | 472             | 653   | 472    | 2472   | 11      |
 | getRandomnessFromProofExternal                                                                | 26443           | 32122 | 32122  | 37802  | 4       |
-| getSubscription                                                                               | 576             | 1712  | 1617   | 5962   | 94      |
+| getSubscription                                                                               | 570             | 1591  | 1490   | 5835   | 94      |
 | getSubscriptionConfig                                                                         | 1376            | 1497  | 1376   | 1721   | 17      |
 | getSubscriptionStruct                                                                         | 853             | 853   | 853    | 853    | 6       |
 | getWithdrawableNativeTestingOnlyXXX                                                           | 460             | 460   | 460    | 460    | 2       |
 | getWithdrawableTokensTestingOnlyXXX                                                           | 420             | 420   | 420    | 420    | 2       |
-| isTargetRegisteredExternal                                                                    | 661             | 1026  | 1007   | 1572   | 27      |
-| migrate                                                                                       | 1453            | 87234 | 16973  | 207165 | 11      |
+| isTargetRegisteredExternal                                                                    | 669             | 1019  | 1015   | 1475   | 27      |
+| migrate                                                                                       | 1455            | 86089 | 14349  | 205856 | 11      |
 | onTokenTransfer                                                                               | 2949            | 33343 | 45982  | 53982  | 16      |
-| ownerCancelSubscription                                                                       | 13888           | 25703 | 25203  | 38519  | 4       |
-| recoverFunds                                                                                  | 2017            | 4566  | 4410   | 7427   | 4       |
+| ownerCancelSubscription                                                                       | 9999            | 23911 | 23911  | 37823  | 4       |
+| recoverFunds                                                                                  | 2017            | 4569  | 4410   | 7439   | 4       |
 | recoverNativeFunds                                                                            | 2775            | 6250  | 2838   | 13139  | 3       |
-| registerMigratableCoordinator                                                                 | 2278            | 41716 | 46078  | 46078  | 19      |
+| registerMigratableCoordinator                                                                 | 2286            | 41713 | 46086  | 46086  | 19      |
 | registerProvingKey                                                                            | 1461            | 66420 | 69323  | 71323  | 22      |
-| requestRandomWords                                                                            | 615             | 30287 | 32797  | 37597  | 9       |
-| requestSubscriptionOwnerTransfer                                                              | 23024           | 23024 | 23024  | 23024  | 1       |
+| requestRandomWords                                                                            | 615             | 30152 | 32645  | 37445  | 9       |
+| requestSubscriptionOwnerTransfer                                                              | 22952           | 22952 | 22952  | 22952  | 1       |
 | s_config                                                                                      | 782             | 782   | 782    | 782    | 5       |
 | s_currentSubNonce                                                                             | 425             | 1425  | 1425   | 2425   | 22      |
 | s_provingKeyHashes                                                                            | 675             | 675   | 675    | 675    | 7       |

fulfillRandomWords gas reduced by around 140 to 190.
requestRandomWords gas reduced by around 130 to 150.

There are opportunities to reduce gas usage in removeConsumer as well but didn't do so as there appears to be insufficient test coverage.


EDIT: Before removing proving keys length check

...
testWithdrawSufficientBalanceLinkSet() (gas: 0 (0.000%)) 
testRecoverFundsAmountToTransfer() (gas: 12 (0.004%)) 
testSetLinkAndLinkNativeFeed() (gas: -326 (-0.009%)) 
testRequestAndFulfillRandomWordsLINKWrapper() (gas: -152 (-0.039%)) 
testRecoverFundsNothingToTransfer() (gas: -222 (-0.044%)) 
testOnTokenTransferSuccess() (gas: -222 (-0.044%)) 
testRequestAndFulfillRandomWordsNativeWrapper() (gas: -152 (-0.048%)) 
testRequestAndFulfillRandomWords_NetworkGasPriceExceedsGasLane() (gas: -478 (-0.078%)) 
testRecoverNativeFundsNothingToTransfer() (gas: -222 (-0.109%)) 
testFundSubscriptionWithNative() (gas: -222 (-0.111%)) 
testRequestAndFulfillRandomWords_OnlyPremium_LinkPayment() (gas: -920 (-0.120%)) 
testRequestAndFulfillRandomWordsLINK() (gas: -920 (-0.120%)) 
testCreateSubscription() (gas: -222 (-0.123%)) 
testRequestAndFulfillRandomWords_OnlyPremium_NativePayment() (gas: -904 (-0.127%)) 
testRequestAndFulfillRandomWordsNative() (gas: -904 (-0.127%)) 
testAddConsumerReaddSameConsumer() (gas: -313 (-0.135%)) 
testAddConsumer() (gas: -326 (-0.144%)) 
testCreateSubscription() (gas: -222 (-0.148%)) 
testOwnerCancelSubscriptionNativeAndLinkFunds() (gas: -735 (-0.162%)) 
testSubscriptionOwnershipTransfer() (gas: -315 (-0.196%)) 
testAddConsumerTooManyConsumers() (gas: -10619 (-0.197%)) 
testCreateSubscriptionRecreate() (gas: -444 (-0.202%)) 
testMigration() (gas: -1221 (-0.256%)) 
testOwnerCancelSubscriptionLinkFundsOnly() (gas: -1260 (-0.291%)) 
testDeregisterProvingKey() (gas: -260 (-0.300%)) 
testMigrateWrapperLINKPayment() (gas: -1665 (-0.308%)) 
testMigrateWrapperNativePayment() (gas: -1665 (-0.342%)) 
testMigrateRevertsWhenInvalidCaller() (gas: -119 (-0.358%)) 
testMigrationNoLink() (gas: -1650 (-0.378%)) 
testMigrateRevertsWhenInvalidCoordinator() (gas: -97 (-0.486%)) 
testOwnerCancelSubscriptionNativeFundsOnly() (gas: -1163 (-0.662%)) 
testGetActiveSubscriptionIds() (gas: -28048 (-0.812%)) 
testCancelSubWithNoLink() (gas: -1390 (-0.867%)) 
testMigrateRevertsWhenReentrant() (gas: -3845 (-1.075%)) 
testMigrateRevertsWhenPendingFulfillment() (gas: -2863 (-1.203%)) 
testDeregister() (gas: -2082 (-2.054%)) 
testOwnerCancelSubscriptionNoFunds() (gas: -3288 (-2.608%)) 
Overall gas change: -69444 (-0.217%)

Gas changes per function compared with develop

| src/v0.8/vrf/dev/testhelpers/ExposedVRFCoordinatorV2_5.sol:ExposedVRFCoordinatorV2_5 contract |                 |       |        |        |         |
 |-----------------------------------------------------------------------------------------------|-----------------|-------|--------|--------|---------|
 | Deployment Cost                                                                               | Deployment Size |       |        |        |         |
-| 5503498                                                                                       | 27881           |       |        |        |         |
+| 5378712                                                                                       | 27258           |       |        |        |         |
 | Function Name                                                                                 | min             | avg   | median | max    | # calls |
 | LINK                                                                                          | 428             | 594   | 428    | 2428   | 12      |
 | LINK_NATIVE_FEED                                                                              | 449             | 1449  | 1449   | 2449   | 2       |
-| acceptSubscriptionOwnerTransfer                                                               | 3241            | 3241  | 3241   | 3241   | 1       |
-| addConsumer                                                                                   | 765             | 49450 | 47544  | 73444  | 120     |
-| cancelSubscription                                                                            | 9462            | 12432 | 11462  | 17345  | 4       |
+| acceptSubscriptionOwnerTransfer                                                               | 3220            | 3220  | 3220   | 3220   | 1       |
+| addConsumer                                                                                   | 765             | 49349 | 47440  | 73340  | 120     |
+| cancelSubscription                                                                            | 7296            | 9931  | 8296   | 15836  | 4       |
 | computeRequestIdExternal                                                                      | 983             | 983   | 983    | 983    | 7       |
-| createSubscription                                                                            | 77254           | 99916 | 88854  | 123054 | 83      |
-| deregisterMigratableCoordinator                                                               | 4472            | 8423  | 6807   | 15607  | 4       |
-| deregisterProvingKey                                                                          | 3480            | 4180  | 4180   | 4880   | 2       |
-| fulfillRandomWords                                                                            | 26378           | 96809 | 101265 | 127632 | 5       |
+| createSubscription                                                                            | 77032           | 99694 | 88632  | 122832 | 83      |
+| deregisterMigratableCoordinator                                                               | 3945            | 7900  | 6285   | 15085  | 4       |
+| deregisterProvingKey                                                                          | 3480            | 4018  | 4018   | 4556   | 2       |
+| fulfillRandomWords                                                                            | 26378           | 96665 | 101093 | 127444 | 5       |
 | fundSubscriptionWithNative                                                                    | 3801            | 32128 | 43601  | 51601  | 15      |
-| getActiveSubscriptionIds                                                                      | 6223            | 10584 | 8414   | 30137  | 9       |
+| getActiveSubscriptionIds                                                                      | 6172            | 10485 | 8339   | 29822  | 9       |
 | getActiveSubscriptionIdsLength                                                                | 472             | 653   | 472    | 2472   | 11      |
 | getRandomnessFromProofExternal                                                                | 26443           | 32122 | 32122  | 37802  | 4       |
-| getSubscription                                                                               | 576             | 1712  | 1617   | 5962   | 94      |
+| getSubscription                                                                               | 570             | 1591  | 1490   | 5835   | 94      |
 | getSubscriptionConfig                                                                         | 1376            | 1497  | 1376   | 1721   | 17      |
 | getSubscriptionStruct                                                                         | 853             | 853   | 853    | 853    | 6       |
 | getWithdrawableNativeTestingOnlyXXX                                                           | 460             | 460   | 460    | 460    | 2       |
 | getWithdrawableTokensTestingOnlyXXX                                                           | 420             | 420   | 420    | 420    | 2       |
-| isTargetRegisteredExternal                                                                    | 661             | 1026  | 1007   | 1572   | 27      |
-| migrate                                                                                       | 1453            | 87234 | 16973  | 207165 | 11      |
+| isTargetRegisteredExternal                                                                    | 669             | 1019  | 1015   | 1475   | 27      |
+| migrate                                                                                       | 1455            | 86009 | 14366  | 205873 | 11      |
 | onTokenTransfer                                                                               | 2949            | 33343 | 45982  | 53982  | 16      |
-| ownerCancelSubscription                                                                       | 13888           | 25703 | 25203  | 38519  | 4       |
-| recoverFunds                                                                                  | 2017            | 4566  | 4410   | 7427   | 4       |
+| ownerCancelSubscription                                                                       | 9999            | 23911 | 23911  | 37823  | 4       |
+| recoverFunds                                                                                  | 2017            | 4569  | 4410   | 7439   | 4       |
 | recoverNativeFunds                                                                            | 2775            | 6250  | 2838   | 13139  | 3       |
-| registerMigratableCoordinator                                                                 | 2278            | 41716 | 46078  | 46078  | 19      |
+| registerMigratableCoordinator                                                                 | 2286            | 41713 | 46086  | 46086  | 19      |
 | registerProvingKey                                                                            | 1461            | 66420 | 69323  | 71323  | 22      |
-| requestRandomWords                                                                            | 615             | 30287 | 32797  | 37597  | 9       |
-| requestSubscriptionOwnerTransfer                                                              | 23024           | 23024 | 23024  | 23024  | 1       |
+| requestRandomWords                                                                            | 615             | 30152 | 32645  | 37445  | 9       |
+| requestSubscriptionOwnerTransfer                                                              | 22952           | 22952 | 22952  | 22952  | 1       |
 | s_config                                                                                      | 782             | 782   | 782    | 782    | 5       |
 | s_currentSubNonce                                                                             | 425             | 1425  | 1425   | 2425   | 22      |
 | s_provingKeyHashes                                                                            | 675             | 675   | 675    | 675    | 7       |

fulfillRandomWords gas reduced by around 140 to 190.
requestRandomWords gas reduced by around 130 to 150.

Copy link
Contributor

github-actions bot commented Feb 9, 2024

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

return false;
}
uint256 provingKeyHashesLength = s_provingKeyHashes.length;
if (provingKeyHashesLength == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we can assume contract always has proving keys so i think we can remove this check?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this check and the gas increased. I'm not sure if it's because of the way our tests are set up. Maybe it's testing for cases where there are no proving keys.

Copy link
Contributor

Choose a reason for hiding this comment

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

This method is called from "CancelSubscription" and cancel subscription tests do not set up proving keys. So yeah, I think it's because most test cases that we have don't set up proving keys unless it's testing request/fulfillment flow

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can we assume that the hot path will always have at least 1 consumer and at least 1 proving key? If that's the case I will remove both checks here. Note that this function is called by removeConsumer. cancelSubscription, and migrate.

The proving key length check is to prevent address consumer = consumers[i] in line 593 from being called if the inner loop wouldn't even be executed and the consumers length check is to prevent accessing s_provingKeyHashes storage in line 588 when the outer loop wouldn't be executed.

Copy link
Contributor

Choose a reason for hiding this comment

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

we can assume there is always at least one proving key hash. When removeConsumer, cancelSubscription, migrate are called, consumers is more likely to be present but not always, so I think removing both checks make sense.

Can we assume that the hot path will always have at least 1 consumer and at least 1 proving key?

Hot path (request/fulfillment) won't be calling this method right? so optimization here is scoped to the functions you mentioned: removeConsumer, cancelSubscription, and migrate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea, I meant the hot path of removeConsumer, cancelSubscription, and migrate, and NOT the hot path of VRF as a whole.

Copy link
Contributor

@jinhoonbang jinhoonbang left a comment

Choose a reason for hiding this comment

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

Noice! LGTM just 1 minor comment.

For CI tests to succeed, we'll need to regenerate the gethwrappers

@@ -324,13 +326,14 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr
function getActiveSubscriptionIds(
uint256 startIndex,
uint256 maxCount
) external view override returns (uint256[] memory) {
) external view override returns (uint256[] memory ids) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious: So if you don't use named return variables, there's an additional cost (like an additional temp var copy operation)? What happens in the background if you don't use this approach?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am guessing that there will be an additional temp var copy operation. Not sure, will have to dive into the opcodes generated.

@@ -379,13 +384,13 @@ abstract contract SubscriptionAPI is ConfirmedOwner, IERC677Receiver, IVRFSubscr
* @inheritdoc IVRFSubscriptionV2Plus
*/
function acceptSubscriptionOwnerTransfer(uint256 subId) external override nonReentrant {
if (s_subscriptionConfigs[subId].owner == address(0)) {
address oldOwner = s_subscriptionConfigs[subId].owner;
if (oldOwner == address(0)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's say we define a constant value called address ZERO_ADDRESS = address(0) somewhere in some shared file (of course, that increases the contract size a bit). In that case, we replace each occurrence of address(0) with the constant's name. Now, this value is re-used within all function calls that require it and no temp var is created just for the sake of the condition check. From the Solidity perspective, would that approach be better or worse and why? Again, I'm just curious and trying to learn a thing or two about contract optimization techniques.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like there will be no difference as the compiler would replace each constant values with the actual values wherever it is used. Gas cost for ISZERO and EQ are both 3.

These questions are good. Keep them coming. I wouldn't say I'm an expert in contract optimisation. I'm just tweaking things around and see which actually saves gas. But I do love to optimise things.

@cl-sonarqube-production
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@leeyikjiun leeyikjiun added this pull request to the merge queue Feb 14, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 14, 2024
@leeyikjiun leeyikjiun added this pull request to the merge queue Feb 14, 2024
Merged via the queue into develop with commit efdb8af Feb 14, 2024
105 checks passed
@leeyikjiun leeyikjiun deleted the VRF-878-Gas-Optimization-V2-Plus branch February 14, 2024 09:53
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 pushed a commit that referenced this pull request Feb 20, 2024
* Optimize deregisterProvingKey

* Optimize fulfillRandomWords

* Optimize deregisterMigratableCoordinator

* Optimize _isTargetRegistered

* Optimize pendingRequestExists

* Optimize _deleteSubscription

* Optimize getActiveSubscriptionIds

* Optimize requestRandomWords

* Replace post-increment with pre-increment

* Optimize _getFeedData

* Optimize ownerCancelSubscription

* Optimize getSubscription

* Optimize createSubscription

* Optimize requestSubscriptionOwnerTransfer

* Optimize acceptSubscriptionOwnerTransfer

* Optimize addConsumer

* Update geth wrappers

* Remove proving keys length check in pendingRequestExists
jinhoonbang added a commit that referenced this pull request Feb 20, 2024
* VRF V2.5 gas optimisations (#11932)

* VRF V2.5 gas optimisations

* Minor changes

* Removed changes in SubscriptionAPI.sol due to no actual gain in hot paths

* Minor changes

* VRF-878 Gas Optimization V2 Plus (#11982)

* Optimize deregisterProvingKey

* Optimize fulfillRandomWords

* Optimize deregisterMigratableCoordinator

* Optimize _isTargetRegistered

* Optimize pendingRequestExists

* Optimize _deleteSubscription

* Optimize getActiveSubscriptionIds

* Optimize requestRandomWords

* Replace post-increment with pre-increment

* Optimize _getFeedData

* Optimize ownerCancelSubscription

* Optimize getSubscription

* Optimize createSubscription

* Optimize requestSubscriptionOwnerTransfer

* Optimize acceptSubscriptionOwnerTransfer

* Optimize addConsumer

* Update geth wrappers

* Remove proving keys length check in pendingRequestExists

* Add native payment to RandomWordsFulfilled event (#12085)

* Add native payment to RandomWordsFulfilled event

* Minor change

---------

Co-authored-by: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com>

---------

Co-authored-by: Sri Kidambi <1702865+kidambisrinivas@users.noreply.github.com>
Co-authored-by: Lee Yik Jiun <lee.yikjiun@gmail.com>
Co-authored-by: Lee Yik Jiun <yikjiun.lee@smartcontract.com>
kidambisrinivas pushed a commit that referenced this pull request Mar 18, 2024
* Optimize deregisterProvingKey

* Optimize fulfillRandomWords

* Optimize deregisterMigratableCoordinator

* Optimize _isTargetRegistered

* Optimize pendingRequestExists

* Optimize _deleteSubscription

* Optimize getActiveSubscriptionIds

* Optimize requestRandomWords

* Replace post-increment with pre-increment

* Optimize _getFeedData

* Optimize ownerCancelSubscription

* Optimize getSubscription

* Optimize createSubscription

* Optimize requestSubscriptionOwnerTransfer

* Optimize acceptSubscriptionOwnerTransfer

* Optimize addConsumer

* Update geth wrappers

* Remove proving keys length check in pendingRequestExists
kidambisrinivas pushed a commit that referenced this pull request Mar 18, 2024
* Optimize deregisterProvingKey

* Optimize fulfillRandomWords

* Optimize deregisterMigratableCoordinator

* Optimize _isTargetRegistered

* Optimize pendingRequestExists

* Optimize _deleteSubscription

* Optimize getActiveSubscriptionIds

* Optimize requestRandomWords

* Replace post-increment with pre-increment

* Optimize _getFeedData

* Optimize ownerCancelSubscription

* Optimize getSubscription

* Optimize createSubscription

* Optimize requestSubscriptionOwnerTransfer

* Optimize acceptSubscriptionOwnerTransfer

* Optimize addConsumer

* Update geth wrappers

* Remove proving keys length check in pendingRequestExists
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