Agent skill

Devp2p Snap Sync

by Nethereum in Nethereum/Nethereum

Help users snap sync an Ethereum node — cold start state without replaying every block from genesis, using Nethereum (.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming…

MITAuto-check passedBackend & APIs

Install Devp2p Snap Sync

skills CLI
$ npx skills add Nethereum/Nethereum --skill devp2p-snap-sync -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Nethereum/Nethereum devp2p-snap-sync --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Nethereum/Nethereum.git skills-src && mkdir -p .claude/skills && cp -r skills-src/plugins/nethereum-skills/skills/devp2p-snap-sync .claude/skills/devp2p-snap-sync && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
devp2p-snap-sync
GitHub stars
2.3k
Token cost
~2.8k tokens
SKILL.md length
980 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Help users snap sync an Ethereum node — cold start state without replaying every block from genesis, using Nethereum (.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming…

  • Works in 2 steps: the leaf-stream fetcher → healing
  • The user mentions snap sync
  • SKILL.md covers Package, Mental model: three phases,…, Run the full orchestrated sync… and Tuning the orchestration, plus 6 more sections
  • Calls dotnet

What it does

Devp2p Snap Sync is an agent skill from Nethereum/Nethereum. Help users snap sync an Ethereum node — cold start state without replaying every block from genesis, using Nethereum (.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming, TrieHealer trie healing, and checkpoint/resume. Use this skill whenever the user mentions snap sync, sync state without an archive, cold start a node, state download, SnapSyncOrchestrator, SnapBootstrapper, TrieHealer, trie healing, SnapRootMismatchException, resuming an interrupted sync, or a moving/rolling sync pivot.

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs. It works with .NET and Ethereum. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user mentions snap sync
  • Sync state without an archive
  • Cold start a node
  • SnapSyncOrchestrator

Example prompts

  • “/devp2p-snap-sync”

Workflow steps

2 steps, taken from the step headings in SKILL.md.

  1. the leaf-stream fetcher
  2. healing

What it can do on your machine

Read from SKILL.md and the folder at commit 229f278. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • dotnet

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • docs.nethereum.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Devp2p Snap Sync loads about 2.8k tokens when it runs. Until then it costs about 134 tokens; SKILL.md has 980 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~134
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Nethereum/Nethereum at commit 229f278, republished under its MIT licence (© Nethereum). 980 words, ~2,753 tokens.

Download SKILL.mdSave it as .claude/skills/devp2p-snap-sync/SKILL.md (or your agent's skills folder).
name
devp2p-snap-sync
description
Help users snap sync an Ethereum node — cold start state without replaying every block from genesis, using Nethereum (.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming, TrieHealer trie healing, and checkpoint/resume. Use this skill whenever the user mentions snap sync, sync state without an archive, cold start a node, state download, SnapSyncOrchestrator, SnapBootstrapper, TrieHealer, trie healing, SnapRootMismatchException, resuming an interrupted sync, or a moving/rolling sync pivot.
user-invocable
true

Snap Sync (State Download) — Nethereum.DevP2P.Sync

Full sync (devp2p-full-sync) covers downloading the block archive — headers, bodies, receipts. That tells you what happened, but not the current state (every account's balance, nonce, code, and storage). Replaying every block from genesis to compute that state is exactly what snap sync avoids: it streams the state at a recent pivot block directly, verified against Merkle-Patricia proofs, then heals any gaps. This skill covers cold-starting that state stream (Phase 2), healing the reconstructed trie (Phase 3), and resuming a sync that was interrupted partway through.

Package

bash
dotnet add package Nethereum.DevP2P.Sync

You need a peer pool with peers advertising snap/1 (see devp2p-peer-connect for capability negotiation), an IChainStoreBundle, IChainActivations for the target chain, and an ICanonicalStateRootSource — a trusted-tip source that anchors the pivot block.

Mental model: three phases, one orchestrator

SyncNode                             the "start here" facade — one object: serve state + snap-bootstrap
   └─ SnapSyncOrchestrator           anchor pivot, retry/backoff, follow rolling pivot
        └─ SnapBootstrapper          sequence one pivot: skip-if-synced -> Phase 2 -> heal-on-mismatch -> commit
             ├─ ParallelBlockBackfiller   Phase 1: header + body + receipt + persist stages over a BlockTaskQueue
             │     └─ BackwardBlockWalker  (skeleton mode) lay headers backward from a trusted tip
             ├─ SnapSyncClient            Phase 2: parallel account/storage/bytecode leaf stream -> ISnapSyncSink
             └─ TrieHealer                Phase 3: BFS re-fetch of missing trie nodes until root matches

Phase 1 (devp2p-full-sync) can run inside this same orchestration or standalone. Phase 2 streams the full account/storage/bytecode state at the pivot, verifying every range against a proof and comparing the assembled root to the pivot's StateRoot. Phase 3 walks the resulting trie and re-fetches anything still missing, following the pivot forward if the head advances while healing runs — which is exactly the scenario devp2p-bal-sync covers in more depth for the snap-v2 case.

Run the full orchestrated sync (the production path)

SnapSyncOrchestrator.RunAsync is the top-level driver — anchors the pivot from your canonical tip source, runs the bootstrapper, and follows a rolling pivot with backoff if the chain keeps advancing while you sync:

csharp
var activations = new FixedChainActivations(HardforkNames.Parse("prague"));
var result = await SnapSyncOrchestrator.RunAsync(
    bundle, pool, scheduler, canonical, activations, logger,
    new SnapSyncOrchestratorOptions { UseBackwardSkeleton = true }, ct);
// result.Ran / result.SkipReason / result.PivotBlockNumber

This is what SyncNode.RunSnapBootstrapAsync (devp2p-run-a-node) delegates to — reach for the orchestrator directly only when you need tuning it doesn't expose through the facade, or you're not using SyncNode at all.

Tuning the orchestration

SnapSyncOrchestratorOptions is where mode and tuning knobs live. The defaults are chosen for a fresh cold-start against a live network; most callers only override one or two:

PropertyTypeDefault
UseBackwardSkeletonbooltrue
MetricsSnapSyncMetrics?null
RootRefreshIntervalMsint12_000
PivotStaleDistanceBlocksulongSnapSyncOrchestrator.PivotStaleDistanceBlocks
HeaderSweepOverride(ulong From, ulong To)?null
BackfillOnlyboolfalse
RunHistoryBackfillbooltrue
Phase1Firstboolfalse
AccountConcurrencyint?null
LargeContractConcurrencyint?null
EnableFlatReconcileboolfalse
FinalizeVerifybooltrue
HeaderFollowHeaderFollowService?null
BalHealEnabledboolfalse

RootRefreshIntervalMs is how often the orchestrator re-checks whether the pivot has moved; BackfillOnly lets you run just Phase 1 through this same entry point when you don't want state sync at all. BalHealEnabled gates the snap-v2 BAL heal path — see devp2p-bal-sync for what it does and why it defaults to false.

Drive SnapBootstrapper directly

For advanced control over a single pivot — skipping the orchestrator's rolling-pivot/backoff loop — SnapBootstrapper.RunAsync sequences one cold-start: skip if state is already committed, run Phase 2, heal on root mismatch, then persist the pivot and completion sentinel:

csharp
var scheduler = new FetchRequestScheduler(pool, new PeerRequestWorker(), new FetchRequestSchedulerOptions());
var snapPeer  = new SchedulerSnapPeer(scheduler);

await bundle.Blocks.SaveAsync(pivotHeader, pivotHash); // trusted pivot header
var result = await SnapBootstrapper.RunAsync(
    bundle, snapPeer, pivotHeader, pivotHash, logger,
    new SnapRunOptions
    {
        Scheduler = scheduler,
        PivotRefresher = null,
        RunBackfill = false,
        Activations = new FixedChainActivations(HardforkNames.Parse("prague")),
        Pool = pool,
    },
    ct);

The pivot header is saved to the store before calling RunAsync — the bootstrapper trusts the header you hand it as the sync target; it doesn't independently fetch and validate the pivot itself (that trust decision belongs to whatever supplies your ICanonicalStateRootSource in the orchestrated path above). SnapBootstrapper also exposes pure, unit-tested decision helpers if you need to reason about resume routing yourself: DecideResumeMode(SnapPhase savedPhase, bool healTargetValid, bool pivotMoved) and ShouldMarkPhase2Entry(bool skipPhase2, bool backfillOnly).

Phase 2: the leaf-stream fetcher

SnapSyncClient is what actually pulls state during Phase 2 — account ranges via 16 (AccountConcurrency) partitioned parallel workers, per-account storage, and bytecodes, verifying proofs and comparing the assembled root against target as it goes:

csharp
Task<SyncResult> SyncStateAsync(byte[] targetRoot, CancellationToken ct = default);

If the assembled root doesn't match targetRoot when the stream completes, SyncStateAsync doesn't fail silently — it signals via a SnapRootMismatchException, which is exactly the trigger SnapBootstrapper uses to hand off to Phase 3 healing.

Show full SKILL.md (397 more words)Show less

Resume from a checkpoint

A cold-start over a large state trie can run for hours — you need to survive a restart partway through without re-streaming everything:

csharp
Task<SyncResult> SyncStateAsync(byte[] targetRoot, SnapSyncState resumeFrom,
                                Action<SnapSyncState> checkpointSink, CancellationToken ct = default);
// The checkpointing entry the resumable overload delegates to (checkpoints a SnapSyncCheckpoint):
Task<SyncResult> SyncStateWithCheckpointAsync(byte[] targetRoot, SnapSyncState resumeFrom,
                                Action<SnapSyncCheckpoint> checkpointSink, CancellationToken ct = default);

Phase 2 checkpoints a SnapSyncState blob roughly every 8 MB and on graceful shutdown. On the next run, SnapBootstrapper.DecideResumeMode reads the saved SnapPhase (NotStarted/Phase2Running/Phase3Running/Complete) and routes accordingly — critically, a kill during heal resumes heal directly even if the pivot moved in the meantime, rather than restarting Phase 2 from scratch. Phase 1's resume is simpler: it just picks up from the LastFetchedHeader/LastFetchedBody metadata cursors (devp2p-full-sync).

Note: the checkpoint/resume signatures above are verified against the README's accepted signature block; no tagged doc-example test exercises a full checkpoint-then-resume cycle end to end.

Phase 3: healing

TrieHealer BFS-walks the in-storage trie under a target root, re-fetching any hash-referenced node (or bytecode) still missing, and re-roots as the pivot advances:

csharp
Task<HealResult> HealAsync(byte[] targetRoot,
    IReadOnlyList<(byte[] AccountHash, byte[] StorageRoot)> seedStorageHeal = null,
    IReadOnlyList<byte[]> seedCodeHeal = null,
    ulong pivotBlock = 0, bool wipeSeedsFirst = false, CancellationToken ct = default);

Heal deliberately caps its snap response sizes below the server's frame limit, because eth and snap share one RLPx socket per peer (devp2p-peer-connect) — an oversized snap response would starve a concurrent Phase-1 backfill sharing the same connection. The bootstrapper also refuses to declare heal successful if it converged after fetching implausibly few nodes from an all-zero leaf stream — a guard against a stale-subtree false positive rather than a real completion.

Common mistakes

SymptomCauseFix
SyncStateAsync throws SnapRootMismatchExceptionExpected — this is Phase 2 signaling that heal is required, not necessarily a bugSnapBootstrapper catches this and hands off to TrieHealer automatically in the orchestrated path
Sync appears to restart from zero after a restartNot using SyncStateWithCheckpointAsync/resumeFrom, or resume routing decided Fresh because the saved phase was invalidConfirm you're persisting SnapSyncState via the checkpoint sink and passing it back in on restart
Heal never converges while the chain keeps producing blocksPivot moving faster than heal can catch upWiden PivotStaleDistanceBlocks, or see devp2p-bal-sync for the dedicated gap-closing mechanism
Snap responses seem throttled compared to eth trafficIntentional — heal caps snap frame sizes to protect concurrent Phase-1 traffic on the same socketNot a bug; tune peer count/concurrency instead of frame size

Decision guidance

I want to…Use
The production cold-start path with rolling-pivot followSnapSyncOrchestrator.RunAsync (or SyncNode.RunSnapBootstrapAsync)
One pivot, advanced control, no rolling-pivot loopSnapBootstrapper.RunAsync directly
Just the leaf-stream fetch, custom sinkSnapSyncClient.SyncStateAsync
Resume across restartsSnapSyncClient.SyncStateWithCheckpointAsync + persisted SnapSyncState
Re-fetch missing trie nodes after a root mismatchTrieHealer.HealAsync

For full documentation, see: https://docs.nethereum.com/docs/devp2p/guide-snap-sync

© Nethereum, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in plugins/nethereum-skills/skills/devp2p-snap-sync of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Devp2p Snap Sync next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Devp2p Snap Sync compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Devp2p Snap Sync this skillNethereum/Nethereum2.3k—~2.8kAutomated safety check: PassMIT
FoundatioFoundatioFx/Foundatio2.1k—~3.9kAutomated safety check: PassApache-2.0
NEAR Intents Swap Integrationinternet-court/internet-court-skill6.4k2 repos~939Automated safety check: PassCustom licence
Aspnet Corefanslead/ReverseProxy.Store1632 repos~1.4kAutomated safety check: PassApache-2.0
.NET API Compatibility DesignAaronontheweb/dotnet-skills1.2k2 repos~2.7kAutomated safety check: PassMIT
Msal Auth Code FlowAzureAD/microsoft-authentication-library-for-dotnet1.5k—~917Automated safety check: PassMIT

Similar skills

  • Foundatio

    FoundatioFx/Foundatio

    A skill your agent uses when working with Foundatio infrastructure abstractions for .NET -- caching, queuing, messaging, file storage, distributed locking, or background jobs.

    2.1k GitHub stars~3.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • NEAR Intents Swap Integration

    internet-court/internet-court-skill

    Builds cross-chain token swaps and bridge flows with the NEAR Intents 1Click API: quotes, deposit addresses, per-chain deposits and status polling.

    6.4k GitHub starsUsed in 2 repos~939 tokens
    Backend & APIsAuto-check passed
  • Aspnet Core

    fanslead/ReverseProxy.Store

    Build, review, refactor, or architect ASP.NET Core web applications using current official guidance for .NET web development.

    163 GitHub starsUsed in 2 repos~1.4k tokens
    Backend & APIsAuto-check passed
  • .NET API Compatibility Design

    Aaronontheweb/dotnet-skills

    Applies extend-only design rules to NuGet packages and distributed systems, covering source, binary and wire compatibility and how to deprecate members safely.

    1.2k GitHub starsUsed in 2 repos~2.7k tokens
    Backend & APIsAuto-check passed
  • Msal Auth Code Flow

    AzureAD/microsoft-authentication-library-for-dotnet

    Authorization Code Flow for web applications using MSAL.NET confidential client to sign in users and access APIs on their behalf

    1.5k GitHub stars~917 tokensUpdated today
    Backend & APIsAuto-check passed
  • Tsp Csharp

    querylenshq/ef-querylens

    Comprehensive C and .NET development skill for TSP projects.

    225 GitHub stars~1.3k tokensUpdated 1 mo ago
    Backend & APIsAuto-check passed

More from Nethereum/Nethereum

All 71 skills in this repo
  • Aa Batching Paymasters

    Nethereum/Nethereum

    Help users batch multiple calls into a single UserOperation and sponsor gas with paymasters using Nethereum Account Abstraction.

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Aa Bundler

    Nethereum/Nethereum

    Help users run an ERC-4337 bundler using Nethereum — set up in-process or standalone bundlers with mempool, validation, reputation, and JSON-RPC server.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Encoding

    Nethereum/Nethereum

    Encode and decode Ethereum ABI data with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.3k tokensUpdated 2 days ago
    Auto-check passed
  • Abi Retrieval

    Nethereum/Nethereum

    Fetch contract ABIs from Sourcify, Etherscan, and 4Byte Directory using the composite ABIInfoStorage pattern (.NET/C).

    2.3k GitHub stars~1.5k tokensUpdated 2 days ago
    Auto-check passed
  • Account Abstraction

    Nethereum/Nethereum

    Help users implement ERC-4337 Account Abstraction with Nethereum — send UserOperations, use smart accounts, route contract calls through a bundler, enable gasless transactions, or work with AA in…

    2.3k GitHub stars~1.7k tokensUpdated 2 days ago
    Auto-check passed
  • Address Utils

    Nethereum/Nethereum

    Validate and format Ethereum addresses with Nethereum. An agent skill from Nethereum/Nethereum.

    2.3k GitHub stars~1.2k tokensUpdated 2 days ago
    Auto-check passed

Works with

Categories

Questions about Devp2p Snap Sync

What does Devp2p Snap Sync do?

Help users snap sync an Ethereum node — cold start state without replaying every block from genesis, using Nethereum (.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming…. Devp2p Snap Sync is an agent skill from Nethereum/Nethereum.NET)'s SnapSyncOrchestrator/SnapBootstrapper, SnapSyncClient state streaming, TrieHealer trie healing, and checkpoint/resume.

When should I use Devp2p Snap Sync?

Devp2p Snap Sync fits situations like: the user mentions snap sync; sync state without an archive; cold start a node; snapSyncOrchestrator.

How do I install Devp2p Snap Sync in Claude Code?

Run `npx skills add Nethereum/Nethereum --skill devp2p-snap-sync -a claude-code`. Or copy the skill folder (plugins/nethereum-skills/skills/devp2p-snap-sync in Nethereum/Nethereum) into .claude/skills/devp2p-snap-sync in your project. Claude Code loads it when a task matches its description.

How do I install Devp2p Snap Sync in Codex?

Run `npx skills add Nethereum/Nethereum --skill devp2p-snap-sync -a codex`. Or copy the skill folder (plugins/nethereum-skills/skills/devp2p-snap-sync in Nethereum/Nethereum) into .agents/skills/devp2p-snap-sync in your project. Codex loads it when a task matches its description.

Can I use Devp2p Snap Sync in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Nethereum/Nethereum --skill devp2p-snap-sync -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/devp2p-snap-sync, .gemini/skills/devp2p-snap-sync, .github/skills/devp2p-snap-sync and .opencode/skills/devp2p-snap-sync in your project.

What does Devp2p Snap Sync need to run?

Going by SKILL.md and its folder, Devp2p Snap Sync needs the command-line tools its instructions call (dotnet).

Does Devp2p Snap Sync access the network?

SKILL.md names 1 domain. As links in the text: docs.nethereum.com. This is read from the text; nothing was executed.

Is Devp2p Snap Sync safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Devp2p Snap Sync use?

Devp2p Snap Sync is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Devp2p Snap Sync use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Devp2p Snap Sync?

Skills that share tags, products or a category with Devp2p Snap Sync: Foundatio (FoundatioFx/Foundatio, 2.1k stars), NEAR Intents Swap Integration (internet-court/internet-court-skill, 6.4k stars), Aspnet Core (fanslead/ReverseProxy.Store, 163 stars) and .NET API Compatibility Design (Aaronontheweb/dotnet-skills, 1.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Devp2p Snap Sync?

Nethereum (a GitHub organization) maintains it in Nethereum/Nethereum, which has 2,260 GitHub stars. The repository holds 71 skills in this directory. The repository was last updated on October 5, 2026.

Source: Nethereum/Nethereum on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.