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

fulfillRandomWords msg.data length validation #12325

Merged
merged 5 commits into from
Mar 11, 2024

Conversation

kidambisrinivas
Copy link
Collaborator

@kidambisrinivas kidambisrinivas commented Mar 6, 2024

  • upper bound to the length of the msg.data that can be passed to the fulfillRandomWords function.

Testing

$ forge test -vvv --match-path test/v0.8/foundry/vrf/VRFV2Plus.t.sol
[⠒] Compiling...
[⠢] Compiling 7 files with 0.8.6
[⠰] Solc 0.8.6 finished in 5.23s
Compiler run successful with warnings:
Warning (2519): This declaration shadows an existing declaration.
   --> test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol:568:7:
    |
568 |       address consumer = makeAddr(Strings.toString(i));
    |       ^^^^^^^^^^^^^^^^
Note: The shadowed declaration is here:
   --> test/v0.8/foundry/vrf/VRFV2PlusSubscriptionAPI.t.sol:575:5:
    |
575 |     address consumer = makeAddr("consumer");
    |     ^^^^^^^^^^^^^^^^
Running 11 tests for test/v0.8/foundry/vrf/VRFV2Plus.t.sol:VRFV2Plus
[PASS] testCancelSubWithNoLink() (gas: 159020)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testCreateSubscription() (gas: 180963)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testDeregisterProvingKey() (gas: 86472)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testGetActiveSubscriptionIds() (gas: 3427509)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRegisterProvingKey() (gas: 101426)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRequestAndFulfillRandomWordsLINK() (gas: 765378)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRequestAndFulfillRandomWordsNative() (gas: 709857)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRequestAndFulfillRandomWords_NetworkGasPriceExceedsGasLane() (gas: 613829)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRequestAndFulfillRandomWords_OnlyPremium_LinkPayment() (gas: 765812)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testRequestAndFulfillRandomWords_OnlyPremium_NativePayment() (gas: 710331)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

[PASS] testSetConfig() (gas: 68113)
Logs:
  changePrank is deprecated. Please use vm.startPrank instead.

Test result: ok. 11 passed; 0 failed; 0 skipped; finished in 8.48ms

Ran 1 test suites: 11 tests passed, 0 failed, 0 skipped (11 total tests)

Copy link
Contributor

github-actions bot commented Mar 6, 2024

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

leeyikjiun
leeyikjiun previously approved these changes Mar 8, 2024
ibrajer
ibrajer previously approved these changes Mar 8, 2024
Copy link
Contributor

@ibrajer ibrajer left a comment

Choose a reason for hiding this comment

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

LGTM

jinhoonbang
jinhoonbang previously approved these changes Mar 8, 2024
@kidambisrinivas kidambisrinivas changed the title fulfilRandomWords msg.data length validation fulfillRandomWords msg.data length validation Mar 11, 2024
@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

@kidambisrinivas kidambisrinivas added this pull request to the merge queue Mar 11, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 11, 2024
@kidambisrinivas kidambisrinivas added this pull request to the merge queue Mar 11, 2024
Merged via the queue into develop with commit a2db9de Mar 11, 2024
108 of 109 checks passed
@kidambisrinivas kidambisrinivas deleted the VRF-910-data-len-check branch March 11, 2024 17:57
ogtownsend pushed a commit that referenced this pull request Mar 14, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
kidambisrinivas added a commit that referenced this pull request Mar 18, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
kidambisrinivas added a commit that referenced this pull request Mar 27, 2024
* fulfillRandomWords msg.data length validation

* Addressed PR comments

* Added changeset
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