Skip to content

Commit 27ae40b

Browse files
update intro content and add new security considerations (#3175)
* update intro content and add new security considerations * add deprecated v2 * Update security.mdx
1 parent a611454 commit 27ae40b

File tree

5 files changed

+18
-19
lines changed

5 files changed

+18
-19
lines changed

src/config/sidebar.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
16081608
],
16091609
},
16101610
{
1611-
section: "VRF V2 [Legacy]",
1611+
section: "VRF V2 [DEPRECATED]",
16121612
contents: [
16131613
{
16141614
title: "VRF V2 Subscription Method",
@@ -2106,7 +2106,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
21062106
],
21072107
[SIDEBAR_SECTIONS.LEGACY]: [
21082108
{
2109-
section: "VRF V2 Subscription Method [Legacy]",
2109+
section: "VRF V2 Subscription Method [DEPRECATED]",
21102110
contents: [
21112111
{
21122112
title: "Migrate to VRF V2.5",
@@ -2143,7 +2143,7 @@ export const SIDEBAR: Partial<Record<Sections, SectionEntry[]>> = {
21432143
],
21442144
},
21452145
{
2146-
section: "VRF V2 Direct Funding Method [Legacy]",
2146+
section: "VRF V2 Direct Funding Method [DEPRECATED]",
21472147
contents: [
21482148
{
21492149
title: "Migrate to VRF V2.5",

src/content/vrf/index.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ import { Aside } from "@components"
1515

1616
<Vrf2_5Common callout="security" />
1717

18-
**Chainlink VRF (Verifiable Random Function)** is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability. For each request, Chainlink VRF generates one or more random values and cryptographic proof of how those values were determined. The proof is published and verified onchain before any consuming applications can use it. This process ensures that results cannot be tampered with or manipulated by any single entity including oracle operators, miners, users, or smart contract developers.
18+
**Chainlink VRF (Verifiable Random Function)** is a provably fair and verifiable random number generator (RNG) that enables smart contracts to access random values without compromising security or usability. For each request, Chainlink VRF generates one or more random values and cryptographic proof of how those values were determined. The proof is published and verified onchain before any consuming applications can use it. This process helps ensure that results cannot be tampered with or manipulated by any single entity including oracle operators, smart contract developers, users, miners, or block builders\*.
19+
20+
\*In the unlikely event that an adversary compromises VRF's randomness-generating secret key and obtains the ability to construct blocks on the target chain, they could strongly bias the result.
1921

2022
<Aside type="note" title="Migrate to V2.5">
2123
Follow the [migration guide](/vrf/v2-5/migration-from-v2) to learn how VRF has changed in V2.5 and to get example

src/content/vrf/v2-5/security.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ title: "VRF Security Considerations"
66

77
Gaining access to high quality randomness onchain requires a solution like Chainlink's VRF, but it also requires you to understand some of the ways that miners or validators can potentially manipulate randomness generation. Here are some of the top security considerations you should review in your project.
88

9-
- [Use `requestId` to match randomness requests with their fulfillment in order](#use-requestid-to-match-randomness-requests-with-their-fulfillment-in-order)
10-
- [Choose a safe block confirmation time, which will vary between blockchains](#choose-a-safe-block-confirmation-time-which-will-vary-between-blockchains)
11-
- [Do not allow re-requesting or cancellation of randomness](#do-not-allow-re-requesting-or-cancellation-of-randomness)
12-
- [Don't accept bids/bets/inputs after you have made a randomness request](#dont-accept-bidsbetsinputs-after-you-have-made-a-randomness-request)
13-
- [The `fulfillRandomWords` function must not revert](#fulfillrandomwords-must-not-revert)
14-
- [Use `VRFConsumerBaseV2Plus` in your contract to interact with the VRF service](#use-vrfconsumerbasev2plus-in-your-contract-to-interact-with-the-vrf-service)
15-
169
## Use `requestId` to match randomness requests with their fulfillment in order
1710

1811
If your contract could have multiple VRF requests in flight simultaneously, you must ensure that the order in which the VRF fulfillments arrive cannot be used to manipulate your contract's user-significant behavior.
@@ -54,3 +47,11 @@ If your `fulfillRandomWords()` implementation reverts, the VRF service will not
5447
## Use `VRFConsumerBaseV2Plus` in your contract, to interact with the VRF service
5548

5649
If you implement the [subscription method](/vrf/v2-5/overview/subscription), use `VRFConsumerBaseV2Plus`. It includes a check to ensure the randomness is fulfilled by `VRFCoordinatorV2_5`. For this reason, it is a best practice to inherit from `VRFConsumerBaseV2Plus`. Similarly, don't override `rawFulfillRandomness`.
50+
51+
## Avoid ERC-4337 account-abstracted (smart-account) wallets for subscription management
52+
53+
Pre-signed ERC-4337 UserOperations can be executed by any bundler until they expire. If executed inside a fulfillment transaction callback, the subscription management call can no-op, delaying or preventing the change.
54+
55+
## Keep your subscription funded well above the minimum balance
56+
57+
Fulfillments require sufficient subscription balance at processing time. If the balance sits near the minimum and multiple consumers make concurrent requests, fulfillments can be delayed. After adding funds, it can take some time for previous requests to be processed again.

src/content/vrf/v2/direct-funding/index.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ metadata:
1616
import VrfCommon from "@features/vrf/v2/common/VrfCommon.astro"
1717
import { Aside, ClickToZoom } from "@components"
1818

19-
<Aside type="tip" title="VRF V2.5 Direct Funding Method">
20-
Refer to the [VRF V2.5 Direct Funding Method Introduction page](/vrf/v2-5/overview/direct-funding) to learn how the
21-
direct funding method works in VRF V2.5. To compare V2.5 and V2, refer to the [migration
22-
guide](/vrf/v2-5/migration-from-v2).
19+
<Aside type="caution" title="Migrate to VRF V2.5">
20+
VRF V2.5 replaces both VRF V1 and VRF V2 on November 29, 2024. [Migrate to VRF V2.5](/vrf/v2-5/migration-from-v1).
2321
</Aside>
2422

2523
<VrfCommon callout="directFunding" />

src/content/vrf/v2/subscription/index.mdx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@ import VrfCommon from "@features/vrf/v2/common/VrfCommon.astro"
1717
import { Aside, ClickToZoom } from "@components"
1818
import { YouTube } from "@astro-community/astro-embed-youtube"
1919

20-
<Aside type="tip" title="VRF V2.5 Subscription Method">
21-
Refer to the [VRF V2.5 Subscription Method Introduction page](/vrf/v2-5/overview/subscription) to learn how the
22-
subscription method works in VRF V2.5. To compare V2.5 and V2, refer to the [migration
23-
guide](/vrf/v2-5/migration-from-v2).
20+
<Aside type="caution" title="Migrate to VRF V2.5">
21+
VRF V2.5 replaces both VRF V1 and VRF V2 on November 29, 2024. [Migrate to VRF V2.5](/vrf/v2-5/migration-from-v1).
2422
</Aside>
2523

2624
<VrfCommon callout="subscription" />

0 commit comments

Comments
 (0)