Skip to content

Commit b86b9e9

Browse files
SebForzJasminMusic
andauthored
Feature/docs v2 (#91)
* restructure and apply puffer design system * AVS section * fixing institutional page index * Update broken link, edit page and build --------- Co-authored-by: Jasmin <[email protected]>
1 parent 19cd88d commit b86b9e9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+9730
-6099
lines changed

README.md

Lines changed: 56 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,71 @@
1-
# Website
1+
# Puffer Finance Documentation
22

3-
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
3+
This repository contains the documentation for Puffer Finance products.
44

5-
### Installation
5+
## MDX Issues Resolution
66

7-
```
8-
$ yarn
9-
```
7+
We've implemented several fixes to resolve MDX compilation errors that occurred with Docusaurus 3.x:
108

11-
### Local Development
9+
1. **Configuration Changes**:
10+
- Updated `docusaurus.config.js` to use appropriate MDX options:
11+
- Set `format: 'detect'` to automatically detect the MDX format
12+
- Properly configured KaTeX for math rendering
1213

13-
```
14-
$ yarn start
15-
```
14+
2. **Markdown File Fixes**:
15+
- Simplified math expressions by removing unnecessary backslash escaping
16+
- Converted simple expressions like `\(22\%\)` to regular text `22%`
17+
- For complex math equations, used proper KaTeX syntax with `$$...$$`
18+
- Added comments to prevent JSX from being parsed as JavaScript
19+
- Ensured all code blocks have explicit language tags
20+
- Added MDX comments around problematic areas to prevent incorrect parsing
1621

17-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
22+
3. **Fix Script**:
23+
- Created a script (`scripts/fixMdx.js`) that automatically fixes these issues
24+
- The script targets specific line ranges that were causing errors
25+
- Handles acorn parse errors in JSX expressions
1826

19-
### Build
27+
## Development
2028

21-
```
22-
$ yarn build
23-
```
29+
To work on this documentation:
2430

25-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
31+
1. Install dependencies:
32+
```
33+
npm install
34+
```
2635

27-
### Deployment
36+
2. Start the development server:
37+
```
38+
npm start
39+
```
2840

29-
Using SSH:
41+
3. Build the static site:
42+
```
43+
npm run build
44+
```
3045

31-
```
32-
$ USE_SSH=true yarn deploy
33-
```
46+
## Math Rendering
3447

35-
Not using SSH:
48+
The documentation uses KaTeX for rendering mathematical expressions. Use the following syntax:
3649

37-
```
38-
$ GIT_USER=<Your GitHub username> yarn deploy
39-
```
50+
- For simple percentage values, use regular Markdown: `22%` (not `\(22\%\)`)
51+
- For emphasis, use standard Markdown: `**bold text**` (not math expressions)
52+
- For complex math formulas, use KaTeX block notation:
53+
```
54+
$$
55+
\text{formula goes here}
56+
$$
57+
```
4058

41-
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
59+
## Troubleshooting
60+
61+
If you encounter MDX compilation errors:
62+
63+
1. Run the fix script:
64+
```
65+
node scripts/fixMdx.js
66+
```
67+
68+
2. Check the error messages for specific line numbers and file paths
69+
3. If needed, manually add `{/* MDX-BLOCK-START */}` and `{/* MDX-BLOCK-END */}` comments around problematic content
70+
4. Ensure all code blocks have language tags
71+
5. For JSX expressions that cause acorn parse errors, wrap them with `{/* JSX-FIX */}` and `{/* END-JSX-FIX */}`

docs/burst-threshold.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

docs/institutional.md renamed to docs/institutional/institutional.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Puffer Institutional Staking Solution
3-
slug: puffer-institutional
3+
slug: institutional-intro
44
---
55

66
# Puffer Institutional Solution

docs/purchase-vts.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

docs/unifi-avs-background.md renamed to docs/unifi-avs/unifi-avs-background.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ Preconfirmations provide near-instant transaction assurances by leveraging a net
4949
- 🛡️ Backed by economic security from Ethereum validators
5050
- Validators stake ETH as collateral, ensuring honest behavior
5151
- Breaking preconf promises can result in slashing of staked assets
52+
{/* MDX-BLOCK-START */}
53+
{/* MDX-BLOCK-START */}
54+
{/* MDX-BLOCK-START */}
55+
{/* MDX-BLOCK-START */}
5256
- 🌐 Maintain neutrality and decentralization
5357
- Multiple validators participate, preventing single points of failure
5458
- Open participation ensures no central authority controls the process

docs/unifi-avs-getting-started.md renamed to docs/unifi-avs/unifi-avs-getting-started.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,49 +22,43 @@ Before you begin, ensure you have the following:
2222

2323
1. Install Foundry (if not already installed):
2424

25-
```
25+
```text
2626
curl -L https://foundry.paradigm.xyz | bash
2727
foundryup
28-
```
29-
28+
```text
3029
2. Clone the UniFi repository:
3130
32-
```
31+
```text
3332
git clone https://github.com/PufferFinance/UniFi.git
34-
```
35-
33+
```text
3634
3. Navigate to the cloned directory:
3735
38-
```
36+
```text
3937
cd UniFi
40-
```
41-
38+
```text
4239
4. Install dependencies:
4340
44-
```
41+
```text
4542
yarn install
46-
```
47-
43+
```text
4844
5. Navigate to the l1-contracts directory:
4945
50-
```
46+
```text
5147
cd l1-contracts
52-
```
53-
48+
```text
5449
6. Install Foundry dependencies:
55-
```
50+
```text
5651
forge build
57-
```
58-
52+
```text
5953
## Phase 1 - Register to UniFi AVS
6054
6155
During phase 1 of UniFi AVS mainnet, Operators can register as follows.
6256
6357
1. **Register as an Operator**
6458
Run the following Solidity script:
65-
```
59+
```text
6660
forge script script/UniFiAVSScripts.sol:UniFiAVSScripts --sig "registerOperatorToUniFiAVS(uint256 signerPk)" 'YOUR_OPERATOR_PRIVATE_KEY' --private-key 'YOUR_OPERATOR_PRIVATE_KEY' --rpc-url 'YOUR_MAINNET_RPC_URL' --broadcast
67-
```
61+
```text
6862
Replace `YOUR_OPERATOR_PRIVATE_KEY` and `YOUR_MAINNET_RPC_URL` with your actual values.
6963
7064
:::tip

docs/unifi-avs-intro.md renamed to docs/unifi-avs/unifi-avs-intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Hello UniFi AVS 🦄
2+
title: Introduction to UniFi AVS
33
slug: /unifi-avs-intro
44
---
55

docs/unifi-avs-protocol.md renamed to docs/unifi-avs/unifi-avs-protocol.md

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,51 @@ The UniFi AVS ecosystem involves several key components and actors:
3232
```mermaid
3333
sequenceDiagram
3434
autonumber
35-
participant U as Users
36-
participant O as Operator
37-
participant UAM as UniFiAVSManager
38-
participant G as Gateway
39-
participant BN as Beacon Node
40-
participant CB as Commit-Boost
41-
participant RM as RewardsManager
42-
participant L1 as Ethereum L1
43-
35+
participant U as 👤 Users
36+
participant O as 👨‍💼 Operator
37+
participant UAM as 📋 UniFiAVSManager
38+
participant G as 🌐 Gateway
39+
participant BN as 📡 Beacon Node
40+
participant CB as ⚡ Commit-Boost
41+
participant RM as 💰 RewardsManager
42+
participant L1 as 🔗 Ethereum L1
43+
44+
Note over O,UAM: 🚀 Registration Phase
4445
O->>UAM: Set delegate key to Gateway
46+
47+
Note over G,BN: 🔍 Discovery Phase
4548
G->>BN: Query lookahead window
4649
BN-->>G: Return upcoming proposer indices
47-
loop For each validator
50+
51+
loop 🔄 For each validator
4852
G->>UAM: getValidator(validatorIndex)
4953
UAM-->>G: Validator registration status
5054
end
51-
Note over G: confirm Gateway is delegated to
55+
56+
Note over G: ✅ Confirm Gateway is delegated to
57+
58+
Note over U,G: 💳 Transaction Phase
5259
U->>G: Send transactions to preconf RPC / router
5360
G-->>U: Return Gateway-signed pre-confs
54-
CB->>CB: wait for slot...
61+
62+
Note over CB: ⏳ wait for slot...
63+
64+
Note over CB,L1: 🏗️ Block Production Phase
5565
CB->>G: Request L1 block
5666
G-->>CB: Provide L1 block
5767
CB->>L1: Propose L1 block
68+
69+
Note over L1,G: 💸 Fee Distribution
5870
L1->>G: gateway fee
71+
72+
Note over O,RM: 🎁 Rewards Phase
5973
O->>RM: Claim AVS rewards
6074
```
61-
75+
{/* MDX-BLOCK-START */}
6276
The preconf flow in UniFi AVS involves several interactions:
77+
{/* MDX-BLOCK-START */}
6378

79+
{/* MDX-BLOCK-START */}
6480
1. Operators set their delegate key to point to a Gateway
6581
2. Gateway queries the Beacon Node for the lookahead window to check the upcoming proposers
6682
3. Gateway checks if any of the upcoming proposers are delegated to them
@@ -165,17 +181,7 @@ UniFi AVS will implement a rewards distribution mechanism designed to provide co
165181

166182
#### Rewards Flow
167183

168-
```mermaid
169-
graph TD
170-
A[User] -->|Pays preconf tips in priority fees| B[Gateway]
171-
B -->|Aggregates transactions and produces blocks| C[Validators]
172-
C -->|Publish blocks| D[Fee Recipient]
173-
D -->|Sends block rewards| E[RewardsManager Contract]
174-
E -->|Distribute rewards| F[Operators]
175-
E -->|Distribute rewards| G[Validators]
176-
E -->|Distribute rewards| H[Gateway]
177-
```
178-
184+
<img src="/img/unifi-avs-rewards.png" alt="UniFi AVS Rewards Flow" style={{maxWidth: '100%', height: 'auto', width: '50%', minWidth: '300px', display: 'block', margin: '0 auto'}} />
179185
#### Claiming Rewards
180186

181187
Rewards will be distributed for each validator on the L2. Validators will be able to claim their rewards by setting a claimer address on the rewards contract by signing an EIP-712 hash with their BLS validator key.
@@ -200,15 +206,4 @@ The implementation of the mechanism will depend on EigenLayer's slashing design
200206

201207
#### Slashing Flow
202208

203-
```mermaid
204-
graph TD
205-
A[Validator Signs Pre-confirmation] --> B{Validator Behavior}
206-
B -->|Breaks Promise| C[Safety Fault]
207-
B -->|Misses Block Proposal| D[Liveness Fault]
208-
B -->|Steals MEV| E[Rug Pooling]
209-
C --> F[Proof Submitted]
210-
D --> F
211-
E --> F
212-
F --> G[Slashing Mechanism Triggered]
213-
G --> H[Penalize Validator's Restaked Ether]
214-
```
209+
<img src="/img/unifi-avs-slashing.png" alt="UniFi AVS Slashing Flow" style={{maxWidth: '100%', height: 'auto', width: '50%', minWidth: '300px', display: 'block', margin: '0 auto'}} />

docs/yield/burst-threshold.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Burst Threshold
3+
slug: /protocol/burst-threshold
4+
---
5+
6+
:::info
7+
The Burst Threshold is Puffer's commitment to Ethereum's Ethos.
8+
:::
9+
10+
### Burst Threshold
11+
12+
Puffer is [committed to self-capping](https://x.com/puffer_finance/status/1697817894900711700?s=20) its validator marketshare to \(22\%\) of Ethereum's validator set, which we refer to as the protocol's _Burst Threshold_. Instead of abruptly pausing staking and NoOp registration once the burst threshold is reached, Puffer introduces a mechanism to organically reduce staker demand as the protocol reaches the threshold.
13+
14+
As the protocol reaches \(22\%\), the number of mintable validator tickets will be reduced such that it can only sustain existing validators but not new ones.
15+
16+
This pledge is critical to ensure that the Puffer protocol never breaches the [dangerous consensus threshold of \(33\%\)](https://x.com/dannyryan/status/1688644951230267392?s=46&t=bsdBaPIHlTHEWDDdVUJW4g), which threatens the stability of Ethereum. We firmly believe that the burst threshold must be included from day one rather than after the protocol is profitable.
File renamed without changes.

0 commit comments

Comments
 (0)