Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,13 @@ exports[`CCIP Sidebar Configuration Snapshot should match the expected sidebar s
"evm",
],
"children": [
{
"chainTypes": [
"evm",
],
"title": "Operational Security",
"url": "ccip/tutorials/evm/cross-chain-tokens/operational-security",
},
{
"chainTypes": [
"evm",
Expand Down
5 changes: 5 additions & 0 deletions src/config/sidebar/ccip-dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
import evmCcipV151Contents from "./ccip/api-reference/evm/v1_5_1.json" with { type: "json" }
import evmCcipV160Contents from "./ccip/api-reference/evm/v1_6_0.json" with { type: "json" }
import evmCcipV161Contents from "./ccip/api-reference/evm/v1_6_1.json" with { type: "json" }
import evmCcipV162Contents from "./ccip/api-reference/evm/v1_6_2.json" with { type: "json" }

Check warning on line 20 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV162Contents' is defined but never used

Check warning on line 20 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV162Contents' is defined but never used
import evmCcipV163Contents from "./ccip/api-reference/evm/v1_6_3.json" with { type: "json" }

Check warning on line 21 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV163Contents' is defined but never used

Check warning on line 21 in src/config/sidebar/ccip-dynamic.ts

View workflow job for this annotation

GitHub Actions / eslint

'evmCcipV163Contents' is defined but never used
import aptosCcipV160Contents from "./ccip/api-reference/aptos/v1_6_0.json" with { type: "json" }
import svmCcipV160Contents from "./ccip/api-reference/svm/v1_6_0.json" with { type: "json" }
import tonCcipV160Contents from "./ccip/api-reference/ton/v1_6_0.json" with { type: "json" }
Expand Down Expand Up @@ -466,6 +466,11 @@
url: "ccip/tutorials/evm/cross-chain-tokens",
chainTypes: ["evm"],
children: [
{
title: "Operational Security",
url: "ccip/tutorials/evm/cross-chain-tokens/operational-security",
chainTypes: ["evm"],
},
{
title: "Using Remix IDE",
chainTypes: ["evm"],
Expand Down
65 changes: 7 additions & 58 deletions src/content/ccip/api-reference/evm/v1.6.1/rate-limiter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ This library provides rate limiting functionality with the following features:

## Events

### TokensConsumed

```solidity
event TokensConsumed(uint256 tokens);
```

<Aside>Emitted when tokens are successfully consumed from the [`TokenBucket`](#tokenbucket).</Aside>

**Parameters**

| Name | Type | Description |
| -------- | --------- | ----------------------------- |
| `tokens` | `uint256` | The number of tokens consumed |

### ConfigChanged

```solidity
Expand All @@ -70,14 +56,6 @@ error BucketOverfilled();

<Aside>Thrown when the [`TokenBucket`](#tokenbucket) contains more tokens than its capacity.</Aside>

### OnlyCallableByAdminOrOwner

```solidity
error OnlyCallableByAdminOrOwner();
```

<Aside>Thrown when a restricted function is called by an unauthorized address.</Aside>

### TokenMaxCapacityExceeded

```solidity
Expand All @@ -96,31 +74,13 @@ error TokenRateLimitReached(uint256 minWaitInSeconds, uint256 available, address
Thrown when attempting to consume more tokens than currently available in the [`TokenBucket`](#tokenbucket).
</Aside>

### AggregateValueMaxCapacityExceeded

```solidity
error AggregateValueMaxCapacityExceeded(uint256 capacity, uint256 requested);
```

<Aside>Thrown when attempting to consume more aggregate value than the [`TokenBucket`](#tokenbucket)'s capacity.</Aside>

### AggregateValueRateLimitReached

```solidity
error AggregateValueRateLimitReached(uint256 minWaitInSeconds, uint256 available);
```

<Aside>
Thrown when attempting to consume more aggregate value than currently available in the [`TokenBucket`](#tokenbucket).
</Aside>

### InvalidRateLimitRate

```solidity
error InvalidRateLimitRate(Config rateLimiterConfig);
```

<Aside>Thrown when the rate limit [`Config`](#config) is invalid (rate is zero or exceeds capacity).</Aside>
<Aside>Thrown when the rate limit [`Config`](#config) is invalid (rate exceeds capacity).</Aside>

### DisabledNonZeroRateLimit

Expand All @@ -130,14 +90,6 @@ error DisabledNonZeroRateLimit(Config config);

<Aside>Thrown when a disabled [`Config`](#config) has non-zero rate or capacity values.</Aside>

### RateLimitMustBeDisabled

```solidity
error RateLimitMustBeDisabled();
```

<Aside>Thrown when attempting to enable rate limiting in a context where it must be disabled.</Aside>

## Structs

### TokenBucket
Expand Down Expand Up @@ -207,7 +159,6 @@ Key behaviors:
- Skips execution if rate limiting is disabled or requestTokens is zero
- Automatically refills tokens based on elapsed time
- Enforces capacity and rate limits
- Emits [`TokensConsumed`](#tokensconsumed) event for non-zero consumption
- Reverts with [`TokenMaxCapacityExceeded`](#tokenmaxcapacityexceeded) or [`TokenRateLimitReached`](#tokenratelimitreached) on violations

</Aside>
Expand Down Expand Up @@ -275,28 +226,26 @@ Configuration update process:
Validates rate limiter configuration parameters.

```solidity
function _validateTokenBucketConfig(Config memory config, bool mustBeDisabled) internal pure;
function _validateTokenBucketConfig(Config memory config) internal pure;
```

<Aside>

Validation rules:

- For enabled configurations:
- Rate must be non-zero and less than capacity
- Validates against mustBeDisabled requirement
- Rate must be less than or equal to capacity
- For disabled configurations:
- Rate and capacity must be zero
- May throw [`InvalidRateLimitRate`](#invalidratelimitrate), [`DisabledNonZeroRateLimit`](#disablednonzeroratelimit), or [`RateLimitMustBeDisabled`](#ratelimitmustbedisabled)
- May throw [`InvalidRateLimitRate`](#invalidratelimitrate) or [`DisabledNonZeroRateLimit`](#disablednonzeroratelimit)

</Aside>

**Parameters**

| Name | Type | Description |
| ---------------- | ------------------- | ------------------------------------------ |
| `config` | [`Config`](#config) | The configuration to validate |
| `mustBeDisabled` | `bool` | Whether the configuration must be disabled |
| Name | Type | Description |
| -------- | ------------------- | ----------------------------- |
| `config` | [`Config`](#config) | The configuration to validate |

### \_calculateRefill

Expand Down
65 changes: 7 additions & 58 deletions src/content/ccip/api-reference/evm/v1.6.2/rate-limiter.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,6 @@ This library provides rate limiting functionality with the following features:

## Events

### TokensConsumed

```solidity
event TokensConsumed(uint256 tokens);
```

<Aside>Emitted when tokens are successfully consumed from the [`TokenBucket`](#tokenbucket).</Aside>

**Parameters**

| Name | Type | Description |
| -------- | --------- | ----------------------------- |
| `tokens` | `uint256` | The number of tokens consumed |

### ConfigChanged

```solidity
Expand All @@ -70,14 +56,6 @@ error BucketOverfilled();

<Aside>Thrown when the [`TokenBucket`](#tokenbucket) contains more tokens than its capacity.</Aside>

### OnlyCallableByAdminOrOwner

```solidity
error OnlyCallableByAdminOrOwner();
```

<Aside>Thrown when a restricted function is called by an unauthorized address.</Aside>

### TokenMaxCapacityExceeded

```solidity
Expand All @@ -96,31 +74,13 @@ error TokenRateLimitReached(uint256 minWaitInSeconds, uint256 available, address
Thrown when attempting to consume more tokens than currently available in the [`TokenBucket`](#tokenbucket).
</Aside>

### AggregateValueMaxCapacityExceeded

```solidity
error AggregateValueMaxCapacityExceeded(uint256 capacity, uint256 requested);
```

<Aside>Thrown when attempting to consume more aggregate value than the [`TokenBucket`](#tokenbucket)'s capacity.</Aside>

### AggregateValueRateLimitReached

```solidity
error AggregateValueRateLimitReached(uint256 minWaitInSeconds, uint256 available);
```

<Aside>
Thrown when attempting to consume more aggregate value than currently available in the [`TokenBucket`](#tokenbucket).
</Aside>

### InvalidRateLimitRate

```solidity
error InvalidRateLimitRate(Config rateLimiterConfig);
```

<Aside>Thrown when the rate limit [`Config`](#config) is invalid (rate is zero or exceeds capacity).</Aside>
<Aside>Thrown when the rate limit [`Config`](#config) is invalid (rate exceeds capacity).</Aside>

### DisabledNonZeroRateLimit

Expand All @@ -130,14 +90,6 @@ error DisabledNonZeroRateLimit(Config config);

<Aside>Thrown when a disabled [`Config`](#config) has non-zero rate or capacity values.</Aside>

### RateLimitMustBeDisabled

```solidity
error RateLimitMustBeDisabled();
```

<Aside>Thrown when attempting to enable rate limiting in a context where it must be disabled.</Aside>

## Structs

### TokenBucket
Expand Down Expand Up @@ -207,7 +159,6 @@ Key behaviors:
- Skips execution if rate limiting is disabled or requestTokens is zero
- Automatically refills tokens based on elapsed time
- Enforces capacity and rate limits
- Emits [`TokensConsumed`](#tokensconsumed) event for non-zero consumption
- Reverts with [`TokenMaxCapacityExceeded`](#tokenmaxcapacityexceeded) or [`TokenRateLimitReached`](#tokenratelimitreached) on violations

</Aside>
Expand Down Expand Up @@ -275,28 +226,26 @@ Configuration update process:
Validates rate limiter configuration parameters.

```solidity
function _validateTokenBucketConfig(Config memory config, bool mustBeDisabled) internal pure;
function _validateTokenBucketConfig(Config memory config) internal pure;
```

<Aside>

Validation rules:

- For enabled configurations:
- Rate must be non-zero and less than capacity
- Validates against mustBeDisabled requirement
- Rate must be less than or equal to capacity
- For disabled configurations:
- Rate and capacity must be zero
- May throw [`InvalidRateLimitRate`](#invalidratelimitrate), [`DisabledNonZeroRateLimit`](#disablednonzeroratelimit), or [`RateLimitMustBeDisabled`](#ratelimitmustbedisabled)
- May throw [`InvalidRateLimitRate`](#invalidratelimitrate) or [`DisabledNonZeroRateLimit`](#disablednonzeroratelimit)

</Aside>

**Parameters**

| Name | Type | Description |
| ---------------- | ------------------- | ------------------------------------------ |
| `config` | [`Config`](#config) | The configuration to validate |
| `mustBeDisabled` | `bool` | Whether the configuration must be disabled |
| Name | Type | Description |
| -------- | ------------------- | ----------------------------- |
| `config` | [`Config`](#config) | The configuration to validate |

### \_calculateRefill

Expand Down
Loading
Loading