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

Add native payment to RandomWordsFulfilled event #12085

Merged
merged 3 commits into from
Feb 19, 2024

Conversation

leeyikjiun
Copy link
Contributor

Add nativePayment to RandomWordsFulfilled event so that the payment information is self contained within the event itself, instead of deriving from the request event.

Gas changes:

testRequestAndFulfillRandomWords_OnlyPremium_LinkPayment() (gas: 482 (0.063%)) 
testRequestAndFulfillRandomWordsLINK() (gas: 482 (0.063%)) 
testRequestAndFulfillRandomWords_OnlyPremium_NativePayment() (gas: 482 (0.068%)) 
testRequestAndFulfillRandomWordsNative() (gas: 482 (0.068%)) 
Overall gas change: 1928 (0.006%)

Note that the above numbers include gas cost from recoding logs and abi decode in the test as well.

| fulfillRandomWords                                                                            | 26378           | [-96665-]{+96915+} | [-101093-]{+101406+} | [-127444-]{+127757+} | 5       |

Increases gas cost by around 313.

Copy link
Contributor

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

@kidambisrinivas
Copy link
Collaborator

Do all the integration tests pass?
Do we have to modify any interface/struct here: https://github.com/smartcontractkit/chainlink/blob/develop/core/services/vrf/v2/coordinator_v2x_interface.go

vreff
vreff previously approved these changes Feb 19, 2024
@kidambisrinivas kidambisrinivas added this pull request to the merge queue Feb 19, 2024
Merged via the queue into develop with commit 6039298 Feb 19, 2024
107 checks passed
@kidambisrinivas kidambisrinivas deleted the chore/add-native-payment-logs branch February 19, 2024 21:10
jinhoonbang pushed a commit that referenced this pull request Feb 20, 2024
* Add native payment to RandomWordsFulfilled event

* Minor change

---------

Co-authored-by: Sri Kidambi <[email protected]>
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 <[email protected]>

---------

Co-authored-by: Sri Kidambi <[email protected]>
Co-authored-by: Lee Yik Jiun <[email protected]>
Co-authored-by: Lee Yik Jiun <[email protected]>
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* Add native payment to RandomWordsFulfilled event

* Minor change

---------

Co-authored-by: Sri Kidambi <[email protected]>
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* Add native payment to RandomWordsFulfilled event

* Minor change

---------

Co-authored-by: Sri Kidambi <[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.

4 participants