Skip to content

feat: remove cometbft dependency to GenesisDoc - #2091

Merged
tac0turtle merged 31 commits into
feature/exec_apifrom
feat/genesis-clean
Mar 25, 2025
Merged

feat: remove cometbft dependency to GenesisDoc#2091
tac0turtle merged 31 commits into
feature/exec_apifrom
feat/genesis-clean

Conversation

@randygrok

@randygrokrandygrok commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Overview

Remove dependendency from cometbft GenesisDoc.
Update Genesis struct to mirror ADR 016

Summary by CodeRabbit

  • Documentation

    • Added comprehensive guides for the Block Manager and Full Node services, detailing configuration, synchronization, and operational workflows.
  • Refactor

    • Streamlined genesis configuration handling with a new, flexible structure to improve state initialization and cryptographic key management.
    • Simplified node startup and block syncing processes for enhanced reliability.
  • Tests

    • Updated test suites to align with the revamped genesis handling and synchronization improvements.
  • Chores

    • Cleaned up outdated initialization methods and redundant test cases to ensure a more maintainable integration process.

@randygrok
randygrok changed the base branch from main to feature/exec_apiMarch 19, 2025 09:45
@coderabbitai

coderabbitaiBot commented Mar 19, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update introduces comprehensive documentation for the Block Manager and refactors the genesis handling throughout the codebase. The changes transition from legacy genesis types (e.g., RollkitGenesis and cmtypes.GenesisDoc) to a new, unified genesis.Genesis type. Function signatures, state initialization, and test cases across block management, node components, sync services, and dummy clients have been updated accordingly. Additionally, a new genesis package has been created to provide constructors, validation, and IO operations.

Changes

File(s)Change Summary
block/block-manager.mdNew documentation detailing the Block Manager's operations including block production (normal and lazy modes), syncing, DA publication with retry, state updates, and fault handling.
block/manager.go, block/manager_test.go, block/sync_service.goRefactored genesis handling from legacy types to genesis.Genesis; updated function signatures, state initialization, and block sync logic.
cmd/rollkit/.../run_node.go, cmd/rollkit/.../run_node_test.goSimplified genesis loading and node file initialization by switching to direct usage of genesispkg.LoadGenesis and genesispkg.NewGenesis.
node/... (full.go, full_node.md, full_node_integration_test.go, helpers_test.go, light.go, node.go, node_integration_test.go, node_test.go)Transitioned node components to the new genesis type; adjusted method signatures and test calls to handle additional return values from GetGenesisWithPrivkey and adopt genesispkg.NewGenesis.
core/da/dummy_client_test.go, core/da/dummy_test.goAdjusted parameters for dummy client/data retrieval methods (e.g., switching height arguments from 1 to 0).
core/go.mod, types/state.go, types/utils.goUpdated state initialization and utility functions by renaming ed25519 references and modifying the signature/logic of GetGenesisWithPrivkey; minor formatting tweaks in go.mod.
pkg/genesis/... (genesis.go, genesis_test.go, io.go, io_test.go)Introduced a new genesis package featuring the Genesis struct, supporting types (e.g., GenesisExtraData, ValidatorInfo), constructors (NewGenesis), validation, and IO functions for loading/saving genesis configurations, along with corresponding tests.

Sequence Diagram(s)

sequenceDiagram
participant BM as Block Manager
participant GS as Genesis Module
participant Exec as Executor
participant DA as DA Network
participant Store as Storage
BM->>GS: Load genesis config (NewGenesis/LoadGenesis)
GS-->>BM: Return genesis data
BM->>Exec: Initialize state using genesis data
BM->>BM: Determine production mode (Normal or Lazy)
BM->>DA: Publish block (with exponential backoff on failure)
DA-->>BM: Acknowledge block publication
BM->>Store: Save block and update state
Loading

Possibly related PRs

Suggested labels

T:dependencies

Suggested reviewers

  • tuxcanfly
  • gupadhyaya
  • Manav-Aggarwal
  • tzdybal

Poem

I’m a rabbit hopping through the code,
In genesis fields where new blocks are sowed.
The Block Manager sings in lazy or normal mode,
As updates streamline each injected node.
With hoppy joy, I cheer these changes bright—
May our network thrive by day and night!
🐇✨


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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@codecov

codecovBot commented Mar 19, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 49.61832% with 66 lines in your changes missing coverage. Please review.

Project coverage is 23.17%. Comparing base (2262207) to head (4f1d4f2).
Report is 18 commits behind head on feature/exec_api.

Files with missing linesPatch %Lines
types/utils.go9.52%19 Missing ⚠️
cmd/rollkit/commands/run_node.go46.15%13 Missing and 1 partial ⚠️
pkg/genesis/genesis.go52.38%10 Missing ⚠️
pkg/genesis/io.go73.52%6 Missing and 3 partials ⚠️
block/sync_service.go0.00%7 Missing ⚠️
types/state.go0.00%4 Missing ⚠️
block/manager.go75.00%2 Missing ⚠️
node/full.go90.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## feature/exec_api #2091 +/- ##
====================================================
- Coverage 24.11% 23.17% -0.95% 
====================================================
Files 52 54 +2 Lines 8231 8182 -49 ====================================================
- Hits 1985 1896 -89 - Misses 6089 6123 +34 - Partials 157 163 +6 

☔ 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.

@randygrokrandygrok changed the title feat: genesis poc execution layerfeat: remove cometbft dependency to GenesisDocMar 20, 2025
Comment threadcore/execution/execution.go Outdated
Comment threadcore/go.mod
Comment threadcore/go.sum Outdated
@randygrok
randygrok marked this pull request as ready for review March 24, 2025 16:14
@RollkitBot
RollkitBot requested review from a team, Manav-Aggarwal, tuxcanfly and yarikbratashchuk and removed request for a teamMarch 24, 2025 16:14
@randygrok

Copy link
Copy Markdown
ContributorAuthor

@coderabbitai summary

@coderabbitai

Copy link
Copy Markdown
Contributor
✅ Actions performed

Summary regeneration triggered.

@tac0turtletac0turtle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Almost there. Not sure if startheight should be start time, using height for time is confusing

Comment threadblock/block-manager.md Outdated
Comment threadcmd/rollkit/commands/run_node.go Outdated
Comment threadcore/da/dummy_test.go
// Genesis represents the genesis state of the blockchain
type Genesis struct {
ChainID string `json:"chain_id"`
GenesisDAStartHeight time.Time `json:"genesis_da_start_height"` // TODO: change to uint64 and remove time.Time, basically we need a mechanism to convert DAHeight to time.Time

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should be a uint64 (height) or it should be renamed to DAStartTime

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

yeah, this is approved to have some design, as it has some implications this change in order to get the time by DA height. @Manav-Aggarwal will propose something.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

Is a temporary fix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dont follow, what is this a fix of? the adr says height not time. you will need to poll DA for the height every n seconds to see. can we put height here and open an issue for the polling. no need to do it in this pr

Comment threadpkg/genesis/genesis.go Outdated
@github-actions

Copy link
Copy Markdown
Contributor
PR Preview Action v1.6.0

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

Built to branch gh-pages at 2025-03-24 21:40 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@tac0turtle
tac0turtle merged commit c7ee8f6 into feature/exec_apiMar 25, 2025
@tac0turtle
tac0turtle deleted the feat/genesis-clean branch March 25, 2025 08:18
@coderabbitaicoderabbitaiBot mentioned this pull request Apr 4, 2025
@coderabbitaicoderabbitaiBot mentioned this pull request Apr 15, 2025
@tac0turtletac0turtle removed this from EvolveApr 24, 2025
@coderabbitaicoderabbitaiBot mentioned this pull request May 7, 2025
@coderabbitaicoderabbitaiBot mentioned this pull request Mar 20, 2026
@coderabbitaicoderabbitaiBot mentioned this pull request Apr 23, 2026
Sign up for freeto 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.

2 participants

@randygrok@tac0turtle