Skip to content

Conversation

@tzdybal
Copy link
Member

@tzdybal tzdybal commented Apr 24, 2025

Overview

Added a section on block size management to the Execution API documentation, detailing the role of the maxBytes parameter in InitChain and ExecuteTxs methods. This update clarifies how the parameter aids in maintaining consistent block size constraints and its usage in Rollkit for validating block sizes before submission.

Summary by CodeRabbit

  • Documentation
    • Expanded and clarified the design and rationale of the Execution API, including its support for multiple execution environments and improved modularity.
    • Enhanced API method specifications with detailed expected behaviors and state management guidelines.
    • Added a comprehensive section on block size management and its coordination across system components.
    • Introduced implementation guidelines covering state management, error handling, performance, and security.
    • Updated the consequences section with additional considerations.
    • Added a new reference to the relevant repository.
    • Removed internal refactoring, testing, and user documentation notes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

Walkthrough

This change revises the ADR (Architecture Decision Record) document for the Rollkit Execution API. The update elaborates on the API’s design, rationale, and operational expectations, including expanded sections on context, alternative approaches, API behaviors, state management, and block size management. New implementation guidelines and references are added, while previous notes on Rollkit’s internal code changes and testing are removed. The consequences section is updated with additional points regarding flexibility, complexity, and coordination. No code or exported entity signatures are modified; the changes are limited to documentation.

Changes

File(s) Change Summary
specs/lazy-adr/adr-010-exec-api.md Expanded and clarified Execution API design, rationale, and operational details; added block size management and implementation guidelines; updated consequences; removed internal refactoring/testing notes; added new references.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Rollkit
    participant ExecutionAPI
    participant Sequencer
    participant DA_Layer

    Client->>Rollkit: Submit Transaction
    Rollkit->>ExecutionAPI: ExecuteTxs (with txs)
    ExecutionAPI-->>Rollkit: Execution result, maxBytes
    Rollkit->>Sequencer: Propose Block (respecting maxBytes)
    Sequencer->>DA_Layer: Submit Block
    DA_Layer-->>Sequencer: Confirm Block
    Sequencer-->>Rollkit: Block Finalized
Loading

Possibly related PRs

Suggested labels

T:spec-and-docs, execution-api

Suggested reviewers

  • tuxcanfly
  • yarikbratashchuk

Poem

In the warren of docs, I burrow and hop,
Clarifying APIs, I just can’t stop!
With block size and state, I nibble and chew,
Guidelines and context, all shiny and new.
No code was disturbed, just words rearranged—
This bunny ensures the design’s well explained! 🐇✨


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@tzdybal tzdybal force-pushed the tzdybal/adr-010-improvements branch from 855bb83 to bb04675 Compare April 24, 2025 06:18
@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2025

PR Preview Action v1.6.1

🚀 View preview at
https://rollkit.github.io/rollkit/pr-preview/pr-2215/

Built to branch gh-pages at 2025-04-24 15:12 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@tzdybal tzdybal force-pushed the tzdybal/adr-010-improvements branch from bb04675 to f4772f7 Compare April 24, 2025 06:20
@codecov
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.92%. Comparing base (addcb75) to head (88586a1).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2215      +/-   ##
==========================================
- Coverage   44.96%   44.92%   -0.05%     
==========================================
  Files          48       48              
  Lines        4561     4561              
==========================================
- Hits         2051     2049       -2     
- Misses       2290     2292       +2     
  Partials      220      220              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tzdybal tzdybal marked this pull request as ready for review April 24, 2025 15:12
@RollkitBot RollkitBot requested review from a team, Manav-Aggarwal, gupadhyaya and tuxcanfly and removed request for a team April 24, 2025 15:12
@github-actions
Copy link
Contributor

github-actions bot commented Apr 24, 2025

The latest Buf updates on your PR. Results from workflow CI and Release / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedApr 28, 2025, 12:05 PM

@tzdybal tzdybal requested review from tac0turtle and removed request for tuxcanfly April 24, 2025 15:13
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (4)
specs/lazy-adr/adr-010-exec-api.md (4)

25-26: Suggest Article in ABCI Application Reference
The phrase “implement other VMs inside ABCI application” could read more naturally as “inside an ABCI application” or “inside the ABCI application.”


111-111: Clarify “Properly Formatted” Requirement
Please specify what “properly formatted” entails (e.g., field order, encoding, schema version) or reference a schema/validator to avoid ambiguity.


161-162: Reevaluate Storage Optimization Placement
The note on “Optimize storage for finalized blocks” may be better placed under performance guidelines to keep behavioral specs focused on immutability guarantees.


193-197: Detail Protocol Overhead Buffer Calculation
Consider specifying how the overhead buffer is computed (fixed byte count vs. percentage) or providing a formula to avoid implementation discrepancies.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bcd4db4 and 2325ceb.

📒 Files selected for processing (1)
  • specs/lazy-adr/adr-010-exec-api.md (7 hunks)
🧰 Additional context used
🪛 LanguageTool
specs/lazy-adr/adr-010-exec-api.md

[uncategorized] ~24-~24: You might be missing the article “the” here.
Context: ...nterface and implement other VMs inside ABCI application. - Pros: No changes requ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[grammar] ~200-~200: This phrase is duplicated. You should probably use “the sequencer” only once.
Context: ...alue from the DA layer and passes it to the sequencer - The sequencer uses this value to limit the size of tr...

(PHRASE_REPETITION)


[duplication] ~214-~214: Possible typo: you repeated a word.
Context: ...on environments must maintain their own state - State transitions should be atomic - State...

(ENGLISH_WORD_REPEAT_RULE)


[uncategorized] ~310-~310: You might be missing the article “a” here.
Context: ...yer. ### Neutral 1. Need to introduce new API exposed by rollkit. 2. Changes to e...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: rollkit-docker / docker-build (GHCR; ghcr.io/rollkit/rollkit)
  • GitHub Check: test / Run Unit Tests
  • GitHub Check: test / Build All Rollkit Binaries
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
🔇 Additional comments (20)
specs/lazy-adr/adr-010-exec-api.md (20)

6-6: Changelog Entry Addition
The new changelog entry for “2025.04.24: Various improvements” accurately records the PR’s date and scope of changes.


13-21: Enhance Context with Execution API Bridge Explanation
The added paragraph clearly describes the Execution API as a bridge between Rollkit and diverse VMs, and the bulleted list concisely enumerates its benefits.


28-29: Approach 2 Pros and Cons are Clear
The pros and cons for migrating to the Engine API are well-balanced and succinct.


31-32: Approach 3 Pros and Cons are Well-Defined
The analysis for creating a new generic API clearly outlines the trade-offs.


88-88: InitChain Behavior Clarified
Adding “Ensure all necessary state is initialized for subsequent operations” strengthens the specification by explicitly requiring post-genesis readiness.


140-140: Atomic Execution Guarantee Added
Mandating atomic execution (“either all transactions succeed or none do”) greatly improves correctness guarantees.


169-170: General Notes on State Management and Atomicity
The general notes now correctly emphasize the execution environment’s state responsibility and atomicity of state transitions.


181-181: Add Block Size Management Section
Introducing this new section draws necessary attention to how maxBytes is handled across the API.


183-184: Introduce maxBytes Parameter Role
Defining maxBytes as a return value in both methods immediately contextualizes its importance in block size enforcement.


185-192: Clarify Dynamic Adjustment Mechanism
How should Rollkit handle decreases in maxBytes between blocks (e.g., trimming pending batches or applying backpressure)? Please verify that edge cases are documented.


199-205: Clarify Source of Initial maxBytes
Earlier you state that InitChain returns maxBytes from the execution environment, but here it reads as coming from the DA layer. Please confirm the authoritative source and update for consistency.

🧰 Tools
🪛 LanguageTool

[grammar] ~200-~200: This phrase is duplicated. You should probably use “the sequencer” only once.
Context: ...alue from the DA layer and passes it to the sequencer - The sequencer uses this value to limit the size of tr...

(PHRASE_REPETITION)


207-210: Rollkit Usage of maxBytes Is Clear
The guidance on how Rollkit validates and applies block size limits before submission is concise and actionable.


213-218: Implementation Guidelines—State Management
These bullets cover persistence, crash recovery, and atomic transitions thoroughly.

🧰 Tools
🪛 LanguageTool

[duplication] ~214-~214: Possible typo: you repeated a word.
Context: ...on environments must maintain their own state - State transitions should be atomic - State...

(ENGLISH_WORD_REPEAT_RULE)


219-224: Implementation Guidelines—Error Handling
Error handling best practices are clearly outlined, including context cancellation and cleanup on failures.


225-230: Implementation Guidelines—Performance Considerations
Performance tips like caching and minimizing state transitions are appropriate for high-throughput environments.


231-236: Implementation Guidelines—Security
Security requirements (validation, access control, sensitive data handling) are comprehensive and align with best practices.


298-300: Positive Consequences Updated
The new points on flexibility and clearer boundaries accurately describe the architectural benefits.


305-307: Negative Consequences Expanded
Including coordination complexity and abstraction overhead presents a balanced view of potential drawbacks.


311-312: Neutral Consequences Added
The neutral observations around API introduction and tooling updates are well noted.


317-317: References Section Enhanced
Linking directly to the go-execution repository gives readers immediate access to the API definitions.

Copy link
Member

@Manav-Aggarwal Manav-Aggarwal left a comment

Choose a reason for hiding this comment

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

Thanks! Left some comments.

tzdybal added 3 commits April 28, 2025 14:00
…details

Added a section on block size management to the Execution API documentation, detailing the role of the `maxBytes` parameter in `InitChain` and `ExecuteTxs` methods. This update clarifies how the parameter aids in maintaining consistent block size constraints and its usage in Rollkit for validating block sizes before submission.
@tzdybal tzdybal force-pushed the tzdybal/adr-010-improvements branch from 2325ceb to 88586a1 Compare April 28, 2025 12:05
@tzdybal tzdybal enabled auto-merge April 28, 2025 12:06
@tzdybal tzdybal requested a review from Manav-Aggarwal April 28, 2025 12:06
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 (4)
specs/lazy-adr/adr-010-exec-api.md (4)

166-167: Avoid duplication of state-management guidance
The “State Management” and “Atomicity” bullets here duplicate points in the later Implementation Guidelines. Consider consolidating to a single section to reduce redundancy.


178-206: Well-structured Block Size Management section
This comprehensive overview of maxBytes usage across InitChain and ExecuteTxs clarifies block-size enforcement. Consider adding a note on the unit (bytes) and explicit handling of protocol overhead calculations for even greater clarity.

🧰 Tools
🪛 LanguageTool

[grammar] ~197-~197: This phrase is duplicated. You should probably use “the sequencer” only once.
Context: ...alue from the DA layer and passes it to the sequencer - The sequencer uses this value to limit the size of tr...

(PHRASE_REPETITION)


209-232: Refine Implementation Guidelines for consistency
Great coverage of state, errors, performance, and security. To improve readability, group related bullets (e.g., combine atomicity and state persistence) or reference the General Notes rather than repeating them.

🧰 Tools
🪛 LanguageTool

[duplication] ~210-~210: Possible typo: you repeated a word.
Context: ...on environments must maintain their own state - State transitions should be atomic - State...

(ENGLISH_WORD_REPEAT_RULE)


306-308: Polish neutral deployment impact bullets
Minor grammar: consider “Need to introduce a new API” for consistency.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~306-~306: You might be missing the article “a” here.
Context: ...yer. ### Neutral 1. Need to introduce new API exposed by rollkit. 2. Changes to e...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2325ceb and 88586a1.

📒 Files selected for processing (1)
  • specs/lazy-adr/adr-010-exec-api.md (7 hunks)
🧰 Additional context used
🪛 LanguageTool
specs/lazy-adr/adr-010-exec-api.md

[uncategorized] ~24-~24: You might be missing the article “the” here.
Context: ...nterface and implement other VMs inside ABCI application. - Pros: No changes requ...

(AI_EN_LECTOR_MISSING_DETERMINER_THE)


[grammar] ~197-~197: This phrase is duplicated. You should probably use “the sequencer” only once.
Context: ...alue from the DA layer and passes it to the sequencer - The sequencer uses this value to limit the size of tr...

(PHRASE_REPETITION)


[duplication] ~210-~210: Possible typo: you repeated a word.
Context: ...on environments must maintain their own state - State transitions should be atomic - State...

(ENGLISH_WORD_REPEAT_RULE)


[uncategorized] ~306-~306: You might be missing the article “a” here.
Context: ...yer. ### Neutral 1. Need to introduce new API exposed by rollkit. 2. Changes to e...

(AI_EN_LECTOR_MISSING_DETERMINER_A)

⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: rollkit-docker / docker-build (GHCR; ghcr.io/rollkit/rollkit)
  • GitHub Check: test / Build All Rollkit Binaries
  • GitHub Check: test / Run Unit Tests
  • GitHub Check: Analyze (go)
  • GitHub Check: Summary
🔇 Additional comments (11)
specs/lazy-adr/adr-010-exec-api.md (11)

6-6: Update changelog with new revision date
The new entry 2025.04.24: Various improvements correctly reflects the latest updates to the ADR.


13-21: Enhance Context section with clear execution-agnostic rationale
The added paragraph clearly frames the Execution API as a bridge to multiple VM types, improving separation of concerns and maintainability.


25-26: Add pros and cons for maintaining ABCI interface
Listing the advantages and drawbacks of keeping the ABCI interface helps readers weigh the trade-offs effectively.


28-29: Add pros and cons for migrating to Engine API
Providing explicit pros and cons for the Engine API alternative clarifies its suitability and limitations.


85-85: Ensure complete state initialization in InitChain
The new expected-behavior bullet emphasizes that all necessary state must be initialized, reinforcing robustness.


108-108: Validate transaction formatting in GetTxs
Explicitly checking that retrieved transactions are valid/formatted improves safety before passing to the sequencer.


137-137: Guarantee atomic execution in ExecuteTxs
The added bullet ensures that either all transactions succeed or none do, which is critical for state consistency.


158-160: Strengthen SetFinal guarantees
Preventing modifications to finalized blocks and optimizing storage are vital for immutability and performance.


294-295: Highlight increased flexibility and cleaner architecture
Adding these positive consequences makes the high-level benefits of the new API more explicit.


301-302: Document coordination complexity and performance trade-offs
The new negative points accurately call out the added abstraction overhead and component coordination challenges.


313-313: Add reference to go-execution repository
Linking to the go-execution repo provides direct access to the implementation details.

@tzdybal tzdybal added this pull request to the merge queue Apr 29, 2025
Merged via the queue into main with commit 7fd4583 Apr 29, 2025
27 checks passed
@tzdybal tzdybal deleted the tzdybal/adr-010-improvements branch April 29, 2025 13:33
@github-project-automation github-project-automation bot moved this to Done in Evolve Apr 29, 2025
@tac0turtle tac0turtle removed this from Evolve Aug 25, 2025
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