Skip to content

Commit

Permalink
Merge pull request #316 from lidofinance/docusaurus-v3
Browse files Browse the repository at this point in the history
Feat: Upgrade docusaurus v2 → v3
  • Loading branch information
TheDZhon authored Jan 29, 2024
2 parents a0cf3ea + db8a16c commit 027f003
Show file tree
Hide file tree
Showing 22 changed files with 4,252 additions and 4,217 deletions.
10 changes: 5 additions & 5 deletions docs/contracts/accounting-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ It's advised to read [What is Lido Oracle mechanism](/guides/oracle-operator-man
## What is AccountingOracle

AccountingOracle is a contract which collects information submitted by the off-chain oracles about state of the Lido-participating validators and their balances, the
amount of funds accumulated on the protocol vaults (i.e., [withdrawal](./withdrawal-vault) and [execution layer rewards](./lido-execution-layer-rewards-vault) vaults), the number [exited and stuck](./staking-router/#exited-and-stuck-validators) validators, the number of [withdrawal requests](./withdrawal-queue-erc721#request) the protocol is able to process and distributes node-operator rewards.
amount of funds accumulated on the protocol vaults (i.e., [withdrawal](./withdrawal-vault) and [execution layer rewards](./lido-execution-layer-rewards-vault) vaults), the number [exited and stuck](./staking-router#exited-and-stuck-validators) validators, the number of [withdrawal requests](./withdrawal-queue-erc721#request) the protocol is able to process and distributes node-operator rewards.

## Report cycle

The oracle work is delineated by equal time periods called frames. In normal operation, oracles finalize a report in each frame (the frame duration is 225 Ethereum Consensus Layer epochs, each frame starts at ~12:00 noon UTC). Each frame has a reference slot and processing deadline. Report data is gathered by looking at the world state (both Ethereum Execution and Consensus Layers) at the moment of the frame's reference slot (including any state changes made in that slot), and must be processed before the frame's processing deadline.

Reference slot for each frame is set to the last slot of the epoch preceding the frame's first epoch. The processing deadline is set to the last slot of the last epoch of the frame.

It's worth noting that frame length [can be changed](contracts/hash-consensus#setframeconfig). And if oracle report is delayed it does not extend the report period, unless it's missed. In this case, the next report will have the report period increased.
It's worth noting that frame length [can be changed](./hash-consensus#setframeconfig). And if oracle report is delayed it does not extend the report period, unless it's missed. In this case, the next report will have the report period increased.

The frame includes these stages:

Expand Down Expand Up @@ -233,7 +233,7 @@ address public immutable LEGACY_ORACLE

### SECONDS_PER_SLOT()

See <https://ethereum.org/en/developers/docs/blocks/#block-time>
See [https://ethereum.org/en/developers/docs/blocks/#block-time](https://ethereum.org/en/developers/docs/blocks/#block-time)

:::note
always returns 12 seconds due to [the Merge](https://ethereum.org/en/roadmap/merge/)
Expand All @@ -245,7 +245,7 @@ uint256 public immutable SECONDS_PER_SLOT

### GENESIS_TIME()

See <https://blog.ethereum.org/2020/11/27/eth2-quick-update-no-21>
See [https://blog.ethereum.org/2020/11/27/eth2-quick-update-no-21](https://blog.ethereum.org/2020/11/27/eth2-quick-update-no-21)

:::note
always returns 1606824023 (December 1, 2020, 12:00:23pm UTC) on [Mainnet](https://blog.ethereum.org/2020/11/27/eth2-quick-update-no-21)
Expand Down Expand Up @@ -406,7 +406,7 @@ function submitReportData(ReportData calldata data, uint256 contractVersion)

| Name | Type | Description |
| ------------------ | ------------ | ------------------------------------------------------------ |
| `data` | `ReportData` | The data. See the [ReportData](#reportdata) structure's docs for details. |
| `data` | `ReportData` | The data. See the [ReportData](./accounting-oracle#report-data) structure's docs for details. |
| `contractVersion` | `uint256` | Expected version of the oracle contract. |

#### Reverts
Expand Down
9 changes: 8 additions & 1 deletion docs/contracts/burner.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
The contract provides a way for Lido protocol to burn stETH token shares as a means to finalize withdrawals,
penalize untimely exiting node operators, and, possibly, cover losses in staking.

It relies on the [rebasing](/contracts/lido#rebasing) nature of stETH. The `Lido` contract calculates
It relies on the [rebasing](/contracts/lido#rebase) nature of stETH. The `Lido` contract calculates
user balance using the following equation:
`balanceOf(account) = shares[account] * totalPooledEther / totalShares`.
Therefore, burning shares (e.g. decreasing the `totalShares` amount) increases stETH holders' balances.
Expand Down Expand Up @@ -116,6 +116,7 @@ Reverts if any of the following is true:
- `msg.sender` is not a holder of the `REQUEST_BURN_MY_STETH_ROLE` role;
- no stETH provided (`_stETHAmountToBurn == 0`);
- no stETH transferred (allowance exceeded).

:::

#### Parameters
Expand All @@ -141,6 +142,7 @@ Reverts if any of the following is true:
- `msg.sender` is not a holder of the `REQUEST_BURN_SHARES_ROLE` role;
- no stETH shares provided (`_sharesAmountToBurn == 0`);
- no stETH shares transferred (allowance exceeded).

:::

#### Parameters
Expand All @@ -166,6 +168,7 @@ Reverts if any of the following is true:
- `msg.sender` is not a holder of the `REQUEST_BURN_MY_STETH_ROLE` role;
- no stETH provided (`_stETHAmountToBurn == 0`);
- no stETH transferred (allowance exceeded).

:::

#### Parameters
Expand Down Expand Up @@ -194,6 +197,7 @@ Reverts if any of the following is true:
- `msg.sender` is not a holder of `REQUEST_BURN_SHARES_ROLE` role;
- no stETH shares provided (`_sharesAmountToBurn == 0`);
- no stETH shares transferred (allowance exceeded).

:::

#### Parameters
Expand Down Expand Up @@ -230,6 +234,7 @@ Reverts if any of the following is true:
- `_amount` value is 0 (zero);
- `_token` address is 0 (zero);
- `_token` address equals to the `stETH` address (use `recoverExcessStETH` instead).

:::

#### Parameters
Expand All @@ -253,6 +258,7 @@ Reverts if any of the following is true:

- `_token` address is 0 (zero);
- `_token` address equals to the `stETH` address (use `recoverExcessStETH` instead).

:::

#### Parameters
Expand Down Expand Up @@ -280,6 +286,7 @@ Reverts if any of the following is true:

- `msg.sender` address is NOT equal to the `stETH` address;
- `_sharesToBurn` is greater than the cover plus non-cover shares requested to burn.

:::

#### Parameters
Expand Down
19 changes: 14 additions & 5 deletions docs/contracts/deposit-security-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Returns the contract's owner address.
function getOwner() external view returns (address);
```


### getPauseIntentValidityPeriodBlocks()

Returns `PAUSE_INTENT_VALIDITY_PERIOD_BLOCKS` (see `pauseDeposits`).
Expand Down Expand Up @@ -125,6 +124,7 @@ function setOwner(address newValue) external;

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
- `newValue` is zero address.
:::
Expand All @@ -135,7 +135,6 @@ Reverts if any of the following is true:
| ---------- | --------- | ----------------- |
| `newValue` | `address` | New owner address |


### setPauseIntentValidityPeriodBlocks()

Sets `pauseIntentValidityPeriodBlocks`.
Expand All @@ -146,6 +145,7 @@ function setPauseIntentValidityPeriodBlocks(uint256 newValue)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
- `newValue` is 0 (zero).
:::
Expand All @@ -157,6 +157,7 @@ Reverts if any of the following is true:
| `newValue` | `uint256` | Number of blocks after which message becomes invalid |

### setMaxDeposits()

Sets `maxDepositsPerBlock`.

The value must be harmonized with the parameter `churnValidatorsPerDayLimit` of [OracleReportSanityChecker](/contracts/oracle-report-sanity-checker).
Expand All @@ -167,6 +168,7 @@ function setMaxDeposits(uint256 newValue)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner.
:::

Expand All @@ -188,6 +190,7 @@ function setMinDepositBlockDistance(uint256 newValue)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner.
:::

Expand All @@ -207,6 +210,7 @@ function setGuardianQuorum(uint256 newValue)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
:::

Expand All @@ -226,6 +230,7 @@ function addGuardian(address addr, uint256 newQuorum)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
- `addr` is already a guardian.
:::
Expand All @@ -247,6 +252,7 @@ function addGuardians(address[] memory addresses, uint256 newQuorum)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
- any of the `addresses` is already a guardian.
:::
Expand All @@ -268,6 +274,7 @@ function removeGuardian(address addr, uint256 newQuorum)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner;
- `addr` is not a guardian.
:::
Expand All @@ -287,7 +294,7 @@ Pauses deposits for staking module given that both conditions are satisfied (rev
is a valid signature by the guardian with index guardianIndex of the data
defined below.

2. block.number - blockNumber <= pauseIntentValidityPeriodBlocks
2. `block.number - blockNumber <= pauseIntentValidityPeriodBlocks`

The signature, if present, must be produced for keccak256 hash of the following
message (each component taking 32 bytes):
Expand All @@ -309,7 +316,7 @@ function pauseDeposits(uint256 blockNumber, uint256 stakingModuleId, Signature m
| ----------------- | ----------- | ------------------------------------------------------------------------------------ |
| `blockNumber` | `uint256` | Block number with malicious pre-deposits have been observed by the guardian |
| `stakingModuleId` | `uint256` | Id of the staking module to pause deposits for |
| `sig` | `Signature` | Short ECDSA guardian signature as defined in https://eips.ethereum.org/EIPS/eip-2098 |
| `sig` | `Signature` | Short ECDSA guardian signature as defined in [EIP-2098](https://eips.ethereum.org/EIPS/eip-2098) |

### unpauseDeposits()

Expand All @@ -322,6 +329,7 @@ function unpauseDeposits(uint256 stakingModuleId)

:::note
Reverts if any of the following is true:

- `msg.sender` is not the owner.
:::

Expand All @@ -337,6 +345,7 @@ Verifies the deposit security conditions are met and calls `LIDO.deposit(maxDepo

:::note
Reverts if any of the following is true:

1. IDepositContract.get_deposit_root() != depositRoot;
2. StakingModule.getNonce() != nonce;
3. The number of guardian signatures is less than getGuardianQuorum();
Expand Down Expand Up @@ -372,4 +381,4 @@ function depositBufferedEther(
| `stakingModuleId` | `uint256` | Id of the staking module to deposit with |
| `nonce` | `uint256` | Nonce of key operations of the staking module |
| `depositCalldata` | `bytes` | Staking module deposit calldata |
| `sortedGuardianSignatures` | `Signature[]` | Short ECDSA guardians signatures as defined in https://eips.ethereum.org/EIPS/eip-2098 |
| `sortedGuardianSignatures` | `Signature[]` | Short ECDSA guardians signatures as defined in [EIP-2098](https://eips.ethereum.org/EIPS/eip-2098) |
8 changes: 4 additions & 4 deletions docs/contracts/hash-consensus.md
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function addMember(address addr, uint256 quorum) external

- Reverts with `DuplicateMember()` if `addr` address is already the member of consensus.
- Reverts with `AddressCannotBeZero()` if `addr` address is zero.
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (quorum <= total members / 2)
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (`quorum <= total members / 2`)

### removeMember()

Expand All @@ -348,7 +348,7 @@ function removeMember(address addr, uint256 quorum) external
```

- Reverts with `NonMember()` if `addr` address doesn't exists
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (quorum <= total members / 2)
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (`quorum <= total members / 2`)

### setQuorum()

Expand All @@ -362,7 +362,7 @@ Can only be called by users with `MANAGE_MEMBERS_AND_QUORUM_ROLE` role if `quoru
function setQuorum(uint256 quorum) external
```

- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (quorum <= total members / 2)
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (`quorum <= total members / 2`)

### disableConsensus()

Expand All @@ -374,7 +374,7 @@ Can only be called by users with `DISABLE_CONSENSUS_ROLE`
function disableConsensus() external
```

- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (quorum <= total members / 2)
- Reverts with `QuorumTooSmall(uint256 minQuorum, uint256 receivedQuorum)` if `quorum` less or equal than total members of consensus divided by 2 (`quorum <= total members / 2`)

### setReportProcessor()

Expand Down
16 changes: 8 additions & 8 deletions docs/contracts/legacy-oracle.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ In Lido V2, `LegacyOracle` only supports a subset of view functions and events.
The `LegacyOracle` contract receives the data changes on each `AccountingOracle` report using two stages
(still within the same transaction):

1. Invoke [`handleConsensusLayerReport`](/contracts/legacy-oracle#handleConsensusLayerReport)
1. Invoke [`handleConsensusLayerReport`](./legacy-oracle#handleconsensuslayerreport)
providing the reference slot and validators data from `AccountingOracle` itself.
1. Invoke [`handlePostTokenRebase`](/contracts/legacy-oracle#handlePostTokenRebase)
1. Invoke [`handlePostTokenRebase`](./legacy-oracle#handleposttokenrebase)
from [`Lido`](/contracts/lido).

```mermaid
Expand Down Expand Up @@ -55,7 +55,7 @@ userAPR = protocolAPR * (1 - lidoFeeAsFraction)

#### What's new from Lido V2

See the new Lido API docs with regards to [APR](/integrations/api#LidoAPR).
See the new Lido API docs with regards to [APR](../integrations/api#lido-apr).

```js
// Emits when token rebased (total supply and/or total shares were changed)
Expand Down Expand Up @@ -199,7 +199,7 @@ Always returns (225, 32, 12, 1606824023) for Mainnet and (225, 32, 12, 161650800

### getCurrentEpochId()

Returns the Beacon Chain epoch id calculated from the current timestamp using the [beacon chain spec](/contracts/legacy-oracle#getBeaconSpec).
Returns the Beacon Chain epoch id calculated from the current timestamp using the [beacon chain spec](./legacy-oracle#getbeaconspec).

```sol
function getCurrentEpochId() returns (uint256)
Expand Down Expand Up @@ -260,7 +260,7 @@ function getLastCompletedReportDelta() returns (
Handles a `stETH` token rebase incurred by the succeeded `AccountingOracle` report storing
the total ether and time elapsed stats.

Emits [`PostTotalShares`](/contracts/legacy-oracle#PostTotalShares)
Emits [`PostTotalShares`](./legacy-oracle#posttotalshares)

```sol
function handlePostTokenRebase(
Expand Down Expand Up @@ -294,7 +294,7 @@ The caller must be `Lido`.

Handles a new completed `AccountingOracle` report storing the corresponding Beacon Chain epoch id.

Emits [`Completed`](/contracts/legacy-oracle#Completed).
Emits [`Completed`](./legacy-oracle#completed).

```sol
function handleConsensusLayerReport(
Expand Down Expand Up @@ -334,7 +334,7 @@ event Completed(
```

:::note
Emits inside the [`handleConsensusLayerReport`](/contracts/legacy-oracle#handleConsensusLayerReport) methods.
Emits inside the [`handleConsensusLayerReport`](./legacy-oracle#handleconsensuslayerreport) methods.
:::

#### Parameters
Expand All @@ -361,7 +361,7 @@ event PostTotalShares(
```

:::note
The new [`TokenRebased`](/contracts/lido#TokenRebased) event emitted from the main Lido contract should be used instead because it provides the pre-report total shares amount as well which is essential to properly estimate a token rebase and its projected APR.
The new [`TokenRebased`](../integrations/api#last-lido-apr-for-steth) event emitted from the main Lido contract should be used instead because it provides the pre-report total shares amount as well which is essential to properly estimate a token rebase and its projected APR.
:::

#### Parameters
Expand Down
Loading

0 comments on commit 027f003

Please sign in to comment.