erigon-seg-rebase
It provides a command to modify step sizes in Erigon datadirs and allows for resetting execution state without removing chaindata.
Install
mkdir -p .claude/skills/erigon-seg-rebase && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4072" && unzip -o skill.zip -d .claude/skills/erigon-seg-rebase && rm skill.zipInstalls to .claude/skills/erigon-seg-rebase
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
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.Key capabilities
- →Change step size of an existing Erigon datadir
- →Reset execution state while maintaining chaindata
- →Verify segment file organization
- →Rebase snapshot segments to different granularities
How it works
The skill uses the 'erigon seg step-rebase' command to modify snapshot segment granularity by re-executing blocks or resetting the execution state.
Inputs & outputs
When to use erigon-seg-rebase
- →Changing snapshot segment granularity
- →Rebasing to a new step size
- →Resetting execution state in Erigon
- →Optimizing datadir storage configuration
About this skill
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 fromsnapshots/erigondb.toml)--keep-blocks: Keep chaindata instead of deleting it. Resets only execution state (domains, history, changesets, prune progress) via the same logic asintegration 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 stepsize781250: 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
- Backup datadir: Consider backing up the datadir before rebasing
- Stop Erigon: Ensure Erigon is not running on the target datadir
- Verify current step: Check what the current step size is
- Ensure Erigon binary is built: run
make erigonto build it
After Running
- Verify the rebase completed successfully
- Check segment files in the datadir
- Restart Erigon if needed
Step Sizes
Common step sizes used in Erigon:
1562500: Full/default stepsize781250: 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:
-
Confirm parameters
- Ask for target datadir path
- Ask for desired step size
- Confirm if they want to rebase a specific range
-
Safety checks
- Verify datadir exists
- Check if Erigon is running (should not be)
-
Execute rebase
./build/bin/erigon seg step-rebase --datadir=/path/to/datadir --new-step-size=<size> -
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 erigonto build the binary atbuild/bin/erigon
When not to use it
- →Tasks unrelated to Erigon datadir management
Prerequisites
Limitations
- →Requires Erigon to be stopped
- →Operation can be time-consuming for large datadirs
- →Must use valid step sizes (1562500, 781250, or 390625)
How it compares
It provides a structured, command-line approach to modifying internal database granularity compared to manual file manipulation.
Compared to similar skills
erigon-seg-rebase side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| erigon-seg-rebase (this skill) | 1 | 2mo | Review | Advanced |
| azure-data-explorer | 0 | 1mo | No flags | Advanced |
| aws-aurora | 1 | 4mo | Review | Intermediate |
| database-admin | 1 | 4mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by erigontech
View all by erigontech →You might also like
azure-data-explorer
vinodrex
Expert knowledge for Azure Data Explorer development including troubleshooting, best practices, decision making, architecture & design patterns, limits & quotas, security, configuration, integrations & coding patterns, and deployment. Use when configuring ADX clusters, KQL/T-SQL queries, ingestion p
aws-aurora
alinaqi
AWS Aurora Serverless v2, RDS Proxy, Data API, connection pooling
database-admin
sickn33
Expert database administrator specializing in modern cloud databases, automation, and reliability engineering. Masters AWS/Azure/GCP database services, Infrastructure as Code, high availability, disaster recovery, performance optimization, and compliance. Handles multi-cloud strategies, container databases, and cost optimization. Use PROACTIVELY for database architecture, operations, or reliability engineering.
k8s-storage
rohitg00
Kubernetes storage management for PVCs, storage classes, and persistent volumes. Use when provisioning storage, managing volumes, or troubleshooting storage issues.
local-cluster-manager
multigres
Manage local multigres cluster components (multipooler, pgctld, multiorch, multigateway) - start/stop services, view logs, connect with psql, test S3 backups locally
ignite-cluster-setup
apache
Set up and manage a local Apache Ignite 3 cluster using just commands. Use when asked to setup cluster, start nodes, rebuild, initialize cluster, or check status.