Agent skill

Devp2p Bal Sync

by Nethereum in Nethereum/Nethereum

Help users close the state gap when a snap sync pivot moves mid-flight, using snap/2 Block Access Lists (BAL) with Nethereum (.NET) — instead of re-streaming already-fetched ranges.

MITAuto-check passedBackend & APIs

Install Devp2p Bal Sync

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

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

GitHub CLI
$ gh skill install Nethereum/Nethereum devp2p-bal-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-bal-sync .claude/skills/devp2p-bal-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-bal-sync
GitHub stars
2.3k
Token cost
~2.2k tokens
SKILL.md length
944 words
Files
1
Skills in repo
71
Repo updated
First seen
Licence
MIT

At a glance

Help users close the state gap when a snap sync pivot moves mid-flight, using snap/2 Block Access Lists (BAL) with Nethereum (.NET) — instead of re-streaming already-fetched ranges.

  • Works in 3 steps: Fetch each intervening block's BAL from… → Verify it against the block header's… → Apply only the changes that land inside…
  • The user mentions block access list
  • SKILL.md covers Package, Mental model: patch the…, Fetch: pulling raw BAL entries and Verify: checking the…, plus 6 more sections
  • Calls dotnet

What it does

Devp2p Bal Sync is an agent skill from Nethereum/Nethereum. Help users close the state gap when a snap sync pivot moves mid-flight, using snap/2 Block Access Lists (BAL) with Nethereum (.NET) — instead of re-streaming already-fetched ranges. Use this skill whenever the user mentions block access list, BAL heal, snap/2, snap-v2, heal while the pivot moves, BalHealEnabled, BlockAccessListFetcher/Verifier/Applier, or patching state deltas during snap sync on Amsterdam or later.

Its SKILL.md is about 2.2k 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. The repository describes itself as: Ethereum .Net cross platform integration library. The licence is MIT.

When your agent uses it

  • The user mentions block access list
  • Heal while the pivot moves
  • BlockAccessListFetcher/Verifier/Applier
  • Patching state deltas during snap sync on Amsterdam

Example prompts

  • “/devp2p-bal-sync”

Workflow steps

3 steps, taken from the first numbered list in SKILL.md.

  1. Fetch each intervening block's BAL from a peer.
  2. Verify it against the block header's BAL-hash commitment (never trust an unverified change set).
  3. Apply only the changes that land inside the already-fetched frontier — anything outside it will be picked up naturally when Phase 2/3…

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 Bal Sync loads about 2.2k tokens when it runs. Until then it costs about 109 tokens; SKILL.md has 944 words of instructions outside code blocks.

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

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). 944 words, ~2,201 tokens.

Download SKILL.mdSave it as .claude/skills/devp2p-bal-sync/SKILL.md (or your agent's skills folder).
name
devp2p-bal-sync
description
Help users close the state gap when a snap sync pivot moves mid-flight, using snap/2 Block Access Lists (BAL) with Nethereum (.NET) — instead of re-streaming already-fetched ranges. Use this skill whenever the user mentions block access list, BAL heal, snap/2, snap-v2, heal while the pivot moves, BalHealEnabled, BlockAccessListFetcher/Verifier/Applier, or patching state deltas during snap sync on Amsterdam or later.
user-invocable
true

Block Access Lists (Snap-v2 BAL Heal) — Nethereum.DevP2P.Sync

Snap sync (devp2p-snap-sync) follows a rolling pivot as the chain advances, and Phase 3 heal re-fetches missing trie nodes when the root doesn't match. But there's a gap those mechanisms don't close by themselves: while Phase 2/3 is still streaming or healing, the live chain keeps producing blocks — and the account/storage ranges you already fetched at the old pivot are now stale relative to the new one. Re-streaming those ranges from scratch would waste everything already downloaded. Snap-v2's Block Access List (BAL) — a per-block account/storage/code/nonce/balance change set — lets you patch just the deltas instead. This is an advanced, opt-in path: everything here sits behind SnapSyncOrchestratorOptions.BalHealEnabled, which defaults to false.

Package

bash
dotnet add package Nethereum.DevP2P.Sync

This skill assumes you've already read devp2p-snap-sync — BAL heal is a supplement to Phase 2/3, not a replacement. You also need peers advertising snap/2 — devp2p-peer-connect covers DevP2PConfig.AdvertiseSnap2, the flag that puts snap/2 in your own Hello.

Mental model: patch the frontier, don't re-stream it

Everything Phase 2 has already fetched has a frontier — the boundary of account/storage ranges already covered. When the pivot moves mid-flight, Snap/CatchUp's job is narrow and specific:

  1. Fetch each intervening block's BAL from a peer.
  2. Verify it against the block header's BAL-hash commitment (never trust an unverified change set).
  3. Apply only the changes that land inside the already-fetched frontier — anything outside it will be picked up naturally when Phase 2/3 reaches that range anyway, so applying it early would be wasted (or worse, inconsistent) work.

This is the same trustless-fetch discipline as the rest of the sync engine (devp2p-full-sync, devp2p-snap-sync): nothing gets applied to state without being checked against a cryptographic commitment first.

Fetch: pulling raw BAL entries

IBlockAccessListFetcher (concrete: BlockAccessListFetcher) fetches raw BAL entries for a set of block references from serviceable peers, retrying and redistributing across peers on refusal, hash mismatch, or a stateless response:

csharp
// IBlockAccessListFetcher.FetchAsync — Snap/CatchUp/IBlockAccessListFetcher.cs:10
Task<IReadOnlyList<IReadOnlyList<AccountChanges>>> FetchAsync(
    IReadOnlyList<BalBlockRef> blocks, CancellationToken ct);

Each BalBlockRef is (byte[] BlockHash, byte[] BlockAccessListHash) — the block's identity plus the commitment the fetched entry must hash-match. The fetcher batches at most MaxHashesPerRequest (28) blocks per request within a ResponseByteBudget of 2 MiB, and throws InvalidOperationException if a block becomes unobtainable from every serviceable peer — there's no silent partial result to accidentally apply.

Verify: checking the commitment before trusting anything

BlockAccessListVerifier.Verify(expectedBalHashes, rawEntries) Keccak-hashes each raw entry against its expected commitment and decodes it via BlockAccessListRLPEncoder, returning one VerifiedBlockAccessList per entry:

  • VerifiedBlockAccessList.Status (enum BlockAccessListStatus) is one of Verified / Unavailable / HashMismatch.
  • Only on Verified does the result carry a decoded IReadOnlyList<AccountChanges> — an Unavailable or HashMismatch result carries nothing to apply.

This is the checkpoint that keeps a malicious or buggy peer from injecting fabricated balance/storage changes: a mismatched hash is discarded, not applied.

Apply: patching flat state and the trie

IBlockAccessListApplier (concrete: BlockAccessListApplier) is where verified changes actually land in storage:

csharp
// IBlockAccessListApplier.ApplyAsync — Snap/CatchUp/IBlockAccessListApplier.cs:10
Task ApplyAsync(IReadOnlyList<AccountChanges> blockAccessList, ISnapTaskFrontier frontier, CancellationToken ct = default);

ApplyAsync applies a verified block's AccountChanges — balance, nonce, code, and storage — into flat state (ISnapFlatStateWriter, plus IStateStore for code), and, when supplied, into the in-progress trie via IHealedStateWriter. Empty accounts are deleted, matching Ethereum's account-clearing rule. Within one account's changes, conflicting writes at different points in the block resolve last-writer-wins by BlockAccessIndex — not by list order:

Given balance changes at indices 3 (→ 500) and 0 (→ 100) submitted in that order, the applied balance is 500 — the change with the higher BlockAccessIndex wins, regardless of which one appears first in the list.

Confirmed in tests/Nethereum.DevP2P.Sync.UnitTests/CatchUp/BlockAccessListApplierTests.cs:24 (Given_BalanceAndNonceChanges_When_Applied_Then_PostValuesAreLastWriteByIndexNotByListOrder).

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

The frontier: only patch what you already fetched

ISnapTaskFrontier (concrete: SnapTaskFrontier) is what makes "only patch state already fetched" possible — it answers two questions the applier asks before writing anything:

  • IsAccountFetched(accountHash)
  • IsStorageFetched(accountHash, slotHash)

If an account or slot falls outside the Phase-2 range-task frontier, the applier skips it — that range hasn't been streamed yet, so applying a delta to it now would create state that's inconsistent with everything around it. It'll be picked up correctly once Phase 2 actually reaches that range.

Where BAL peers come from

IBlockAccessListPeerSource (concrete: PeerPoolBlockAccessListPeerSource) filters your existing peer pool down to sessions where SyncPeerSession.SupportsSnap2 is true — you don't maintain a separate BAL-capable peer list; it's derived from the same pool devp2p-peer-connect and devp2p-peer-discovery built up.

Turning it on

BAL heal is opt-in for a reason — it's additional machinery most syncs don't need. Enable it via the orchestrator option (devp2p-snap-sync):

csharp
var options = new SnapSyncOrchestratorOptions { BalHealEnabled = true };

Gotcha — the flag alone isn't enough. Setting BalHealEnabled = true has no effect unless the block's active hardfork is Amsterdam or later — SnapBootstrapper.ShouldBalHeal gates on both the option and the fork schedule. Enabling the flag against a pre-Amsterdam chain silently does nothing; there's no error, because BAL simply isn't part of the wire protocol yet at that fork.

Verified in tests/Nethereum.DevP2P.Sync.UnitTests/SnapBalHealGapCloserTests.cs:36-53 (ShouldBalHeal_DisabledByConfig_ReturnsFalse, ShouldBalHeal_EnabledButPreAmsterdam_ReturnsFalse, ShouldBalHeal_EnabledAndAmsterdamActive_ReturnsTrue); default false is set in SnapSyncOrchestratorOptions.cs:39.

Common mistakes

SymptomCauseFix
BalHealEnabled = true but nothing happensPre-Amsterdam fork active at the pivotConfirm IChainActivations resolves Amsterdam or later at the relevant block
BlockAccessListFetcher.FetchAsync throws InvalidOperationExceptionEvery serviceable (snap/2-supporting) peer refused, mismatched, or went stateless for at least one requested blockWiden the peer pool, or check whether any peers actually advertise snap/2 (DevP2PConfig.AdvertiseSnap2)
A verified BAL entry doesn't change stateThe affected account/slot fell outside ISnapTaskFrontier's already-fetched rangeExpected — that range will be covered correctly once Phase 2 reaches it
Conflicting values for the same account after applyAssumed list order determines the winnerIt doesn't — highest BlockAccessIndex wins, regardless of list position

Decision guidance

SituationAction
Pivot is stable, Phase 2/3 keeps up on its ownLeave BalHealEnabled at its default (false) — no need for this machinery
Pivot moves faster than heal converges, chain is on/after AmsterdamEnable BalHealEnabled; peers must advertise snap/2
Pivot moves but chain is pre-AmsterdamBAL heal is unavailable at this fork — rely on TrieHealer's own pivot-follow instead (see devp2p-snap-sync)

For full documentation, see: https://docs.nethereum.com/docs/devp2p/guide-block-access-lists

© 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-bal-sync of Nethereum/Nethereum.

Open the folder on GitHubat commit 229f278

Compare with similar skills

Devp2p Bal 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 Bal Sync compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Devp2p Bal Sync this skillNethereum/Nethereum2.3k—~2.2kAutomated safety check: PassMIT
FoundatioFoundatioFx/Foundatio2.1k—~3.9kAutomated safety check: PassApache-2.0
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
Tsp Csharpquerylenshq/ef-querylens225—~1.3kAutomated 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
  • 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
  • Msal Client Credentials

    AzureAD/microsoft-authentication-library-for-dotnet

    Client Credentials Flow for service-to-service (daemon) authentication in MSAL.NET without user involvement

    1.5k GitHub stars~1.1k tokensUpdated today
    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 Bal Sync

What does Devp2p Bal Sync do?

Help users close the state gap when a snap sync pivot moves mid-flight, using snap/2 Block Access Lists (BAL) with Nethereum (.NET) — instead of re-streaming already-fetched ranges. Devp2p Bal Sync is an agent skill from Nethereum/Nethereum.NET) — instead of re-streaming already-fetched ranges.

When should I use Devp2p Bal Sync?

Devp2p Bal Sync fits situations like: the user mentions block access list; heal while the pivot moves; blockAccessListFetcher/Verifier/Applier; patching state deltas during snap sync on Amsterdam.

How do I install Devp2p Bal Sync in Claude Code?

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

How do I install Devp2p Bal Sync in Codex?

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

Can I use Devp2p Bal 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-bal-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-bal-sync, .gemini/skills/devp2p-bal-sync, .github/skills/devp2p-bal-sync and .opencode/skills/devp2p-bal-sync in your project.

What does Devp2p Bal Sync need to run?

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

Does Devp2p Bal 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 Bal 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 Bal Sync use?

Devp2p Bal 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 Bal Sync use?

About 2.2k tokens (SKILL.md is roughly 8.8k 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 Bal Sync?

Skills that share tags, products or a category with Devp2p Bal Sync: Foundatio (FoundatioFx/Foundatio, 2.1k stars), Aspnet Core (fanslead/ReverseProxy.Store, 163 stars), .NET API Compatibility Design (Aaronontheweb/dotnet-skills, 1.2k stars) and Msal Auth Code Flow (AzureAD/microsoft-authentication-library-for-dotnet, 1.5k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Devp2p Bal 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.