Skip to content

Commit 9bf8977

Browse files
authored
docs: add "safe" tag to V2 API documentation (#13051)
* docs: initial copy of https://filoznotebook.notion.site/Filecoin-V2-APIs-1d0dc41950c1808b914de5966d501658 * docs: add CLAUDE.md with context about V2 API documentation work * docs: clean up formatting in V2 API documentation * docs: added table of contents This makes it easier to see what content sections are being changed/added in future diffs. * docs: add safe tag documentation with 200 epoch distance\n\nThis adds:\n- Safe tag to TipSetSelector options\n- Documentation about 200 epochs behind head placement\n- Updated comprehensive table of contents to include new sections * docs: update based on changes/suggestions from Gemini 2.5 Pro Preview 03-25 * docs: added status update and minor CLAUDE.md update * docs: fixed incorrect statement and pointed to safe constant investigation tracking item * docs: fixing GoDoc for SafeHeightDistance * docs: update api-v2-experimental.md based on PR feedback - Removed bad recommendations for handling when need consistent state - Fixed mermaid diagram - Made clear this doc isn't the permanent home * chore: cleanup Fixed formatting errors. Added docs about the table of contents. * chore: fix go fmt issues in comment formatting
1 parent 3cfad11 commit 9bf8977

File tree

3 files changed

+1204
-3
lines changed

3 files changed

+1204
-3
lines changed

build/buildconstants/params_shared_vals.go

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,17 @@ const MinimumBaseFee int64 = 100
104104
const PackingEfficiencyNum int64 = 4
105105
const PackingEfficiencyDenom int64 = 5
106106

107-
// SafeHeightDistance is the distance from the current head that we call "safe" for the purpose of
108-
// assuming finality when relying on EC. It's not a substitute for ChainFinality, but a compromise
109-
// where it's acceptable to have a nonzero margin of error in the finality assumption.
107+
// SafeHeightDistance is the distance from the latest tipset, i.e. heaviest, that
108+
// is considered to be safe from re-orgs at an increasingly diminishing
109+
// probability.
110+
//
111+
// This is used to determine the safe tipset when using the "safe" tag in
112+
// TipSetSelector or via Eth JSON-RPC APIs. Note that "safe" doesn't guarantee
113+
// finality, but rather a high probability of not being reverted. For guaranteed
114+
// finality, use the "finalized" tag.
115+
//
116+
// This constant is experimental and may change in the future.
117+
// Discussion on this current value and a tracking item to document the
118+
// probabilistic impact of various values is in
119+
// https://github.com/filecoin-project/go-f3/issues/944
110120
const SafeHeightDistance abi.ChainEpoch = 200
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# V2 API Documentation Context
2+
3+
## Project Overview
4+
This directory contains the experimental user-facing documentation for Filecoin's V2 API. The purpose of this work is to maintain the documentation in source control for easier team review before publishing to external platforms like Notion.
5+
6+
## Source Information
7+
- Original source: https://filoznotebook.notion.site/Filecoin-V2-APIs-1d0dc41950c1808b914de5966d501658
8+
- This documentation describes experimental V2 APIs that are subject to change
9+
10+
## Workflow
11+
1. (If this hasn't already been don) Copy updates from Notion into this repository
12+
2. Make changes, likely using Claude Code by pointing to to local changes or changes in a PR.
13+
2. Regenerate the table of contents if you've added or modified sections
14+
3. Submit changes for team review via pull request
15+
4. After approval, publish updated content back to Notion
16+
17+
**Important**: Always regenerate the table of contents before committing changes to ensure it accurately reflects the document structure. The table of contents is comprehensive and includes all sections of the document, helping readers navigate the content. It also helps give an overview in the diff of what content is being added/changed and where in the document.
18+
19+
## Key Files
20+
- `api-v2-experimental.md`: The main user facing documentation file that is copied to Notion.
21+
- Related code: `api/v2api/full.go` (API implementation)
22+
- Related code: `chain/types/tipset_selector.go` (Key types)
23+
- Generated docs: `documentation/en/api-v2-unstable-methods.md`
24+
25+
## Commands
26+
27+
### Regenerating the Table of Contents
28+
For Claude to regenerate the table of contents:
29+
1. Extract all headers from the document using grep:
30+
```bash
31+
grep -n '^#\|^##\|^###\|^####' api-v2-experimental.md
32+
```
33+
2. Use this information to update the Table of Contents section, ensuring all headers are properly nested according to their level and linked.
34+
35+
Humans in their IDE can use [Markdown All in One](https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one).

0 commit comments

Comments
 (0)