-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(docs): STF readme #23150
chore(docs): STF readme #23150
Conversation
📝 WalkthroughWalkthroughThis pull request focuses on significantly enhancing the documentation for the State Transition Function (STF) in the server/v2/stf/README.md file. The documentation has been comprehensively restructured to provide a more detailed and clear explanation of the STF package. The update includes a new table of contents, sequence diagrams for key functions like DeliverBlock, Simulate, ValidateTx, and Query, and additional sections on error handling and gas management. Changes
Sequence DiagramssequenceDiagram
participant Caller
participant STF
participant PreBlockHandler
participant BeginBlockHandler
participant TxProcessor
participant EndBlockHandler
Caller->>STF: DeliverBlock()
STF->>PreBlockHandler: PreBlock
STF->>BeginBlockHandler: BeginBlock
STF->>TxProcessor: Process Transactions
STF->>EndBlockHandler: EndBlock
STF-->>Caller: Return Block Result
sequenceDiagram
participant Caller
participant STF
participant TxProcessor
Caller->>STF: Simulate()
STF->>TxProcessor: Execute Transaction
TxProcessor-->>STF: Return Simulation Result
STF-->>Caller: Return Result without State Commit
Possibly related PRs
Suggested labels
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (6)
server/v2/stf/README.md (6)
1-152
: Improve markdown formatting for better readabilityThe document needs formatting improvements:
- Add blank lines around headings (e.g., before line 5, 40, 70, 97, 124)
- Use consistent list style (asterisks instead of dashes)
- Use proper list indentation (4 spaces)
- Add blank lines around lists
- Ensure file ends with a single newline
Here's an example of the correct formatting for lists:
- - Context - - BlockRequest containing transactions - - ReadOnly state + * Context + * BlockRequest containing transactions + * ReadOnly state🧰 Tools
🪛 Markdownlint (0.37.0)
6-6: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
7-7: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
8-8: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
9-9: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
41-41: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
42-42: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
43-43: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
44-44: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
45-45: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
46-46: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
47-47: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
48-48: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
49-49: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
50-50: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
51-51: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
71-71: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
72-72: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
73-73: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
74-74: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
75-75: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
76-76: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
77-77: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
78-78: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
79-79: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
98-98: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
99-99: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
100-100: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
101-101: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
102-102: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
103-103: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
104-104: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
105-105: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
125-125: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
126-126: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
127-127: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
128-128: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
129-129: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
130-130: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
131-131: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
132-132: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
133-133: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
138-138: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
139-139: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
140-140: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
141-141: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
142-142: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
147-147: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
148-148: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
149-149: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
150-150: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
42-42: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
43-43: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
44-44: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
46-46: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
47-47: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
48-48: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
49-49: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
50-50: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
51-51: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
72-72: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
73-73: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
74-74: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
75-75: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
77-77: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
78-78: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
79-79: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
99-99: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
100-100: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
101-101: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
102-102: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
104-104: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
105-105: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
126-126: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
127-127: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
128-128: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
129-129: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
131-131: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
132-132: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
133-133: Expected: 4; Actual: 2
Unordered list indentation(MD007, ul-indent)
5-5: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
40-40: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
70-70: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
97-97: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
124-124: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines(MD022, blanks-around-headings)
6-6: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
41-41: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
71-71: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
98-98: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
125-125: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
138-138: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
147-147: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
152-152: null
Files should end with a single newline character(MD047, single-trailing-newline)
3-3
: Enhance introduction with STF's role in Cosmos SDKConsider expanding the introduction to briefly explain STF's role in the Cosmos SDK ecosystem and its importance in blockchain state management.
137-142
: Add error codes and handling strategiesThe error handling section would benefit from:
- Specific error codes for each error type
- Recommended handling strategies
- Examples of error responses
🧰 Tools
🪛 Markdownlint (0.37.0)
138-138: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
139-139: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
140-140: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
141-141: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
142-142: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
138-138: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
146-152
: Enhance gas management section with concrete examplesConsider adding:
- Typical gas costs for common operations
- Gas estimation strategies
- Examples of gas limit calculations
🧰 Tools
🪛 Markdownlint (0.37.0)
147-147: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
148-148: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
149-149: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
150-150: Expected: asterisk; Actual: dash
Unordered list style(MD004, ul-style)
147-147: null
Lists should be surrounded by blank lines(MD032, blanks-around-lists)
152-152: null
Files should end with a single newline character(MD047, single-trailing-newline)
15-38
: Enhance DeliverBlock sequence diagramThe diagram could be improved by:
- Adding error paths
- Including gas consumption points
- Showing state commitment steps
57-67
: Add timing indicators to sequence diagramsConsider adding timing indicators or async/await patterns to the Simulate and Query diagrams to better illustrate the execution flow and potential bottlenecks.
Also applies to: 111-121
📜 Review details
Configuration used: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
server/v2/stf/README.md
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
server/v2/stf/README.md (1)
Pattern **/*.md
: "Assess the documentation for misspellings, grammatical errors, missing documentation and correctness"
🪛 Markdownlint (0.37.0)
server/v2/stf/README.md
6-6: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
7-7: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
8-8: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
9-9: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
41-41: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
42-42: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
43-43: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
44-44: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
45-45: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
46-46: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
47-47: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
48-48: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
49-49: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
50-50: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
51-51: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
71-71: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
72-72: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
73-73: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
74-74: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
75-75: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
76-76: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
77-77: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
78-78: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
79-79: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
98-98: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
99-99: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
100-100: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
101-101: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
102-102: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
103-103: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
104-104: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
105-105: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
125-125: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
126-126: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
127-127: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
128-128: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
129-129: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
130-130: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
131-131: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
132-132: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
133-133: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
138-138: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
139-139: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
140-140: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
141-141: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
142-142: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
147-147: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
148-148: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
149-149: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
150-150: Expected: asterisk; Actual: dash
Unordered list style
(MD004, ul-style)
42-42: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
43-43: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
44-44: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
46-46: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
47-47: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
48-48: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
49-49: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
50-50: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
51-51: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
72-72: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
73-73: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
74-74: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
75-75: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
77-77: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
78-78: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
79-79: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
99-99: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
100-100: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
101-101: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
102-102: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
104-104: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
105-105: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
126-126: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
127-127: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
128-128: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
129-129: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
131-131: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
132-132: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
133-133: Expected: 4; Actual: 2
Unordered list indentation
(MD007, ul-indent)
5-5: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
40-40: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
70-70: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
97-97: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
124-124: Expected: 1; Actual: 0; Below
Headings should be surrounded by blank lines
(MD022, blanks-around-headings)
6-6: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
41-41: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
71-71: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
98-98: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
125-125: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
138-138: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
147-147: null
Lists should be surrounded by blank lines
(MD032, blanks-around-lists)
152-152: null
Files should end with a single newline character
(MD047, single-trailing-newline)
Description
Create a readme that explains each step of STF with diagrams.
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
in the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
Please see Pull Request Reviewer section in the contributing guide for more information on how to review a pull request.
I have...
Summary by CodeRabbit