Skip to content

chore: migrate chain id#68

Merged
MicBun merged 1 commit intomainfrom
chore/migrate-chain
Aug 11, 2025
Merged

chore: migrate chain id#68
MicBun merged 1 commit intomainfrom
chore/migrate-chain

Conversation

@outerlook
Copy link
Contributor

@outerlook outerlook commented Aug 11, 2025

Description

Related Problem

related to #67 (comment)

How Has This Been Tested?

Summary by CodeRabbit

  • Chores
    • Updated network genesis to tn-v2.1 with new chain_id and initial_height.
    • Introduced a new single ed25519 validator and aligned leader reference.
    • Refreshed state hash.
    • Migration block unchanged (start_height: 0, end_height: 0).
    • Retained parameters: db_owner, max_block_size (6291456), join_expiry (168h0m0s), disabled_gas_costs (true), max_votes_per_tx (200).
    • Impact: Clients must use the updated genesis and validator key to connect; a resync may be required.

@outerlook outerlook self-assigned this Aug 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 11, 2025

Walkthrough

Genesis configuration updated: chain_id and initial_height changed; state_hash replaced; validator set switched to a single ed25519 validator with a new pubkey and explicit type/power; leader key aligned to the new validator; migration block unchanged; other top-level parameters unchanged.

Changes

Cohort / File(s) Summary of Changes
Genesis config update
configs/network/v2/genesis.json
Updated chain_id and initial_height; replaced state_hash; replaced validator set with a single ed25519 validator (power: 1, new pubkey); aligned leader.key to new validator; retained migration block and other top-level fields (db_owner, max_block_size, join_expiry, disabled_gas_costs, max_votes_per_tx).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Possibly related PRs

Poem

A rabbit taps the genesis drum,
New keys hum where the ledgers come.
One validator, steady and bright,
Chain awakens to a fresh height.
State-hash moon, a silver sign—
Blocks hop forth, in perfect line. 🐇✨

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chore/migrate-chain

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.
    • Explain this complex logic.
    • 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 explain this code block.
  • 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 explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate unit tests to generate unit tests for 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.

@outerlook outerlook requested a review from MicBun August 11, 2025 14:28
@holdex
Copy link

holdex bot commented Aug 11, 2025

Time Submission Status

Member Status Time Action Last Update
@outerlook ❌ Missing - ⚠️ Submit time -
MicBun ✅ Submitted 15min Update time Aug 11, 2025, 2:58 PM

Copy link

@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 (2)
configs/network/v2/genesis.json (2)

21-24: disabled_gas_costs: true — confirm this is intentional.

  • Leaving gas disabled is fine for test/dev, but in prod it can enable DoS vectors and unbounded resource usage even with a 6MB block size.
  • If prod, consider enabling gas or adding compensating controls (rate limits, stricter mempool/tx caps).

Confirm intended environment (dev/test/prod) for tn-v2.1. I can propose safe defaults accordingly.


6-11: Confirm single-validator set for tn-v2.1

The genesis file currently defines exactly one validator with power 1 and a valid 64-hex ed25519 pubkey:

  • File: configs/network/v2/genesis.json (validators array length: 1)
  • Pubkey format: 64 hex characters (validated)

Please confirm this single-validator configuration is intentional for this network tier. If this setup is intended for a production environment, consider expanding to at least a 3+ validator set to avoid a single point of consensus failure.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f7075b2 and 1dd3ad3.

📒 Files selected for processing (1)
  • configs/network/v2/genesis.json (1 hunks)
🧰 Additional context used
🪛 Gitleaks (8.27.2)
configs/network/v2/genesis.json

19-19: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🔇 Additional comments (4)
configs/network/v2/genesis.json (4)

17-20: Leader key aligns with validator pubkey — good.

The leader.key matches validators[0].pubkey and type is consistent (ed25519). No issues here.


19-19: Gitleaks “Generic API Key” is a false positive on a public ed25519 key.

This is a public key (64 hex chars), not a credential/secret. To reduce CI noise, consider an allowlist for this file/path in your Gitleaks config.

Example .gitleaks.toml snippet:

[allowlist]
  paths = [
    "configs/network/v2/genesis.json"
  ]

Alternative: narrow the rule only for JSON keys named "leader.key" and "validators[].pubkey" if your ruleset supports targeted exclusions.


2-3: Chain ID bump verification successful

  • Genesis JSON is valid (jq syntax check passed).
  • No leftover references to the old tn-v2 ID outside of configs/network/v2/genesis.json.
  • Other chain_id values in staging dirs are unrelated and expected.

You’re all set to merge.


12-16: Verify state_hash and migration semantic correctness

  • File: configs/network/v2/genesis.json
    • state_hash is a valid 64-character hexadecimal.
    • migration window is start_height=0 → end_height=0.

Please confirm that this state_hash exactly matches the app-hash produced by the application at your chosen initial height (e.g., height 195391) to ensure semantic correctness.

@MicBun MicBun merged commit f6fd071 into main Aug 11, 2025
3 of 4 checks passed
@MicBun MicBun deleted the chore/migrate-chain branch August 11, 2025 14:37
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.

2 participants