Skip to content

Conversation

@TheDZhon
Copy link
Contributor

@TheDZhon TheDZhon commented Jan 16, 2026

Summary

Comprehensive Lido V3 and stVaults documentation update:

  • New contract docs: VaultHub, StakingVault, Dashboard, LazyOracle, PredepositGuarantee, OperatorGrid, VaultFactory, Accounting
  • Enhanced guides: Rewrote protocol-levers.md and steth-superuser-functions.md with concrete addresses and role holders
  • Added struct definitions and fixed accuracy issues (Burner address, implementation vs proxy labels)

Test cases

  • npm run build
  • Verify Etherscan links and internal doc links
  • Confirm struct definitions match source code

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds comprehensive contract reference documentation for the stVaults system and integrates these references into existing documentation. The changes provide detailed API documentation for 9 stVaults contracts with method signatures, descriptions, and cross-references.

Changes:

  • Added 9 new contract documentation files covering VaultHub, StakingVault, PredepositGuarantee, OperatorGrid, LazyOracle, Dashboard, factories, beacon, and consolidation helper contracts
  • Updated sidebar navigation to include all new contract pages in the contracts section
  • Added cross-reference links from stVaults technical docs and whitepaper to the new contract reference pages

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
sidebars.js Adds 9 new contract reference pages to the contracts section navigation
docs/contracts/vault-hub.md Main VaultHub contract reference with comprehensive API documentation
docs/contracts/staking-vault.md StakingVault primitive contract reference with full method listings
docs/contracts/predeposit-guarantee.md PredepositGuarantee (PDG) contract reference including deposit flow diagrams
docs/contracts/operator-grid.md OperatorGrid registry contract reference with tier and group management APIs
docs/contracts/lazy-oracle.md LazyOracle adapter contract reference with reporting and quarantine mechanisms
docs/contracts/dashboard.md Dashboard management contract reference with role-based operations
docs/contracts/staking-vault-factory.md VaultFactory deployment contract reference
docs/contracts/staking-vault-beacon.md UpgradeableBeacon proxy pattern reference
docs/contracts/validator-consolidation-requests.md Consolidation helper contract reference for EIP-7251 support
run-on-lido/stvaults/tech-documentation/tech-design.md Adds link to contract reference from technical design doc
run-on-lido/stvaults/tech-documentation/integration-overview.md Adds link to contract reference and formatting fix for bullet list
run-on-lido/stvaults/index.md Adds contract reference link to stVaults documentation center
docs/lido-v3-whitepaper.mdx Adds contract reference link to whitepaper related documentation section

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TheDZhon TheDZhon requested a review from a team as a code owner January 16, 2026 16:06
Copy link
Contributor Author

@TheDZhon TheDZhon left a comment

Choose a reason for hiding this comment

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

👀

TheDZhon and others added 11 commits January 16, 2026 19:43
- Add new Accounting contract documentation with structs and methods
- Add roles/permissions and PDGPolicy enum docs to Dashboard
- Add VaultConnection, VaultRecord, Report structs to VaultHub
- Add staged balance explanation and Deposit struct to StakingVault
- Fix requestValidatorExit method signature in VaultHub

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add report freshness documentation to LazyOracle
- Add key concepts (groups, tiers, default tier, jailing) to OperatorGrid
- Add BLS verification context and structs to PredepositGuarantee
- Add factory chaining and connect deposit docs to VaultFactory
- Clarify EIP-7002 for ejectValidators in StakingVault
- Add node operator fee accounting to Dashboard
- Add ownership and ossification context to StakingVaultBeacon

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
These contracts are implementation addresses, not singleton proxies.
Individual instances are deployed by VaultFactory as proxies/beacon proxies.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 44 out of 44 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Comment on lines +119 to +127
The method performs these operations in order:
1. Internalizes bad debt from stVaults
2. Updates consensus layer state on Lido
3. Collects EL rewards and processes withdrawals
4. Finalizes withdrawal queue requests
5. Commits shares to burn
6. Distributes protocol fees to modules and treasury
7. Emits token rebase event
8. Notifies rebase observers
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to list the operations in the order they are executed in the contract, this is the correct order.

  1. Performs sanity checks
  2. Updates consensus layer state on Lido
  3. Internalizes bad debt
  4. Commits shares to burn
  5. Finalizes withdrawal queue requests
  6. Distributes protocol fees to modules and treasury
  7. Notifies rebase observers
  8. Emits token rebase event

https://github.com/lidofinance/core/blob/d5d92266b5bb305044c5dcf3e407463f776a4def/contracts/0.8.9/Accounting.sol#L329

Comment on lines +30 to +38
```mermaid
graph LR;
AO[AccountingOracle]--handleOracleReport-->A[Accounting];
A--collectRewardsAndProcessWithdrawals-->L[Lido];
A--finalize-->WQ[WithdrawalQueue];
A--internalizeBadDebt-->VH[VaultHub];
A--reportModuleRewards-->SR[StakingRouter];
A--sanityChecks-->SC[OracleReportSanityChecker];
```
Copy link
Contributor

Choose a reason for hiding this comment

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

The method names are incorrect, e.g. Accounting calls VaultHub.decreaseInternalizedBadDebt(), and StakingRouter.reportRewardsMinted().

We can update the diagram to use correct method name OR we can leave these names but without camelCase so as they are not confused with actual method names, e.g. A -> report module rewards -> SR

A--sanityChecks-->SC[OracleReportSanityChecker];
```

## Structs
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing struct PreReportState


Simulates an oracle report without applying changes. Returns calculated state changes that would result from the report. Used by oracle daemons to compute the simulated share rate before submitting.

## Methods
Copy link
Contributor

Choose a reason for hiding this comment

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

Constructor missing

Comment on lines +210 to +224
### wrap(uint256 _stETHAmount)

```solidity
function wrap(uint256 _stETHAmount) external returns (uint256)
```

Wraps stETH into wstETH.

### unwrap(uint256 _wstETHAmount)

```solidity
function unwrap(uint256 _wstETHAmount) external returns (uint256)
```

Unwraps wstETH into stETH.
Copy link
Contributor

Choose a reason for hiding this comment

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

These methods don't exist


## Factory flows

VaultFactory exposes two creation flows, reflected in the NatSpec:
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth mentioning that the factory acts as temporary admin during the deploy.

function ossify() external onlyOwner
```

Pins the implementation for this vault (no upgrades).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Pins the implementation for this vault (no upgrades).
Pins the implementation for this vault (no upgrades). After ossification, the vault cannot reconnect to VaultHub.


Returns whether deposits are paused.

## Methods
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's important to document receive function

VaultHub validates that a vault was deployed by the current VaultFactory (or a
previous factory in the chain) before allowing connection.

## Structs
Copy link
Contributor

Choose a reason for hiding this comment

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

Outdated


VaultHub is driven by reports from `LazyOracle` and vault actions routed via the `Dashboard` or direct calls.

## How it works
Copy link
Contributor

Choose a reason for hiding this comment

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

Pause intent not documented

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.

3 participants