Catalog
fauziyasin-s2m4qw/erigon-seg-rebase

fauziyasin-s2m4qw

erigon-seg-rebase

Use the 'erigon seg step-rebase' command to change the step size of an existing datadir. Use when the user wants to rebase segments or modify step sizes.

v1.0LATEST
NewUpdated Aug 20, 2026

Erigon Segment Step Rebase

Overview

The erigon seg step-rebase command changes the step size of an existing Erigon datadir. This is used to modify the granularity of snapshot segments.

Command Syntax

./build/bin/erigon seg step-rebase --datadir=<path> --new-step-size=<size> [other-flags]

Flags

  • --datadir: Path to the Erigon datadir (required)
  • --new-step-size: New step size to rebase to (required; must be an exact divisor or multiple of the current step size from snapshots/erigondb.toml)
  • --keep-blocks: Keep chaindata instead of deleting it. Resets only execution state (domains, history, changesets, prune progress) via the same logic as integration stage_exec --reset, so already-downloaded blocks stay in the DB and get re-executed on next start. Without this flag the whole chaindata DB is deleted and the block tail must be re-downloaded from the network.

The command is interactive: it prints the full rename/delete plan and waits for a y/N confirmation on stdin (echo y | erigon seg step-rebase ... when scripting).

Common Step Sizes

  • 1562500: Default/full stepsize
  • 781250: stepsize/2 (half step)
  • 390625: stepsize/4 (quarter step)

Usage Patterns

Rebase to Half Step

./build/bin/erigon seg step-rebase --datadir=/path/to/datadir --new-step-size=781250

Rebase to Quarter Step

./build/bin/erigon seg step-rebase --datadir=/path/to/datadir --new-step-size=390625

Rebase Keeping Already-Downloaded Blocks

./build/bin/erigon seg step-rebase --datadir=/path/to/datadir --new-step-size=781250 --keep-blocks

Run erigon seg retire first to minimize the re-execution window, then after the rebase start erigon (or run integration stage_exec) to re-execute the kept blocks from the snapshot files' end.

Important Considerations

Before Running

  1. Backup datadir: Consider backing up the datadir before rebasing
  2. Stop Erigon: Ensure Erigon is not running on the target datadir
  3. Verify current step: Check what the current step size is
  4. Ensure Erigon binary is built: run make erigon to build it

After Running

  1. Verify the rebase completed successfully
  2. Check segment files in the datadir
  3. Restart Erigon if needed

Step Sizes

Common step sizes used in Erigon:

  • 1562500: Full/default stepsize
  • 781250: Half step (stepsize/2)
  • 390625: Quarter step (stepsize/4)

The step size affects:

  • Snapshot segment granularity
  • File size and organization
  • Query and sync performance

Workflow

When the user wants to rebase step size:

  1. Confirm parameters

    • Ask for target datadir path
    • Ask for desired step size
    • Confirm if they want to rebase a specific range
  2. Safety checks

    • Verify datadir exists
    • Check if Erigon is running (should not be)
  3. Execute rebase

    ./build/bin/erigon seg step-rebase --datadir=/path/to/datadir --new-step-size=<size>
    
  4. Verify results

    • Check command output for errors
    • List segment files to verify changes

Error Handling

Common issues:

  • "datadir not found": Verify the path is correct
  • "database locked": Stop Erigon process first
  • Invalid step size: Use valid step sizes (1562500, 781250, or 390625)

Examples

Example 1: Rebase datadir to half step

./build/bin/erigon seg step-rebase --datadir=./chaindata --new-step-size=781250

Example 2: Rebase to quarter step

./build/bin/erigon seg step-rebase --datadir=/mnt/erigon/datadir --new-step-size=390625

Tips

  • The operation can be time-consuming for large datadirs
  • Smaller step sizes (like 390625) create more granular segments
  • If building from source, use make erigon to build the binary at build/bin/erigon

Overall Score

84/100

Grade

B

Good

Grades are signals, not a certification. Always review a skill yourself before use.

Safety

88

Quality

82

Clarity

87

Completeness

78

Summary

This skill teaches users how to use the `erigon seg step-rebase` command to change the step size granularity of Erigon snapshot segments. It provides command syntax, common step sizes, workflows, and error handling guidance for rebasing existing datadirs to different step sizes.

Detected Capabilities

shell executionfile path readingfilesystem verificationdirectory listing

Trigger Keywords

Phrases that agents use to match this skill to user intent.

erigon step rebasechange segment step sizerebase datadirerigon snapshot rebasestep size adjustment

Use Cases

  • Rebase Erigon datadir to half step size
  • Rebase Erigon datadir to quarter step size
  • Rebase while preserving already-downloaded blocks
  • Verify step rebase completed successfully
  • Handle common step rebase errors

Quality Notes

  • Clear, focused scope limited to Erigon step rebase command
  • Good section organization with Overview, Syntax, Flags, and Examples
  • Helpful common step sizes reference table for easy lookup
  • Before/After guidance provides practical safety instructions
  • Interactive nature of the command is documented (requires y/N confirmation)
  • Error handling section covers common failure modes
  • Workflow section guides users through each step methodically
  • Documentation explains what step sizes affect (granularity, file size, performance)
  • Tips section provides realistic expectations about execution time
  • Multiple concrete examples show different use cases
Model: claude-haiku-4-5-20251001Analyzed: Aug 20, 2026

Reviews

Add this skill to your library to leave a review.

No reviews yet

Be the first to share your experience.

Use fauziyasin-s2m4qw/erigon-seg-rebase in your dev environment

Command Palette

Search for a command to run...