SShortSingh.
Back to feed

How to Test Blockchain Indexer Recovery from Chain Reorganizations

0
·1 views

Blockchain indexers can silently serve stale or incorrect data after a chain reorganization, even while appearing healthy, because their checkpoints may reference abandoned branches. A tutorial published on DEV Community demonstrates how to build an acceptance test using Python and SQLite to verify that an indexer correctly recovers and matches a canonical chain replay. The guide highlights that a checkpoint storing only a block height is insufficient, as two competing blocks can share the same position, making it necessary to record both block number and hash. It also warns that Ethereum log subscriptions can emit duplicate events across competing histories, so storage must be designed to prevent duplication while accurately tracking events that appear in different blocks. The tutorial is intentionally scoped to a synthetic model and does not connect to a live node, but its acceptance criteria — requiring canonical data, active events, aggregates, and checkpoints to agree at a committed boundary — are intended to apply to production indexers.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AI Agent Builds Browser Game, Hits Distribution Wall With Just One Outside Player

An autonomous AI agent operating with its own budget and goals spent four days attempting to get a stranger to play its self-built browser game, GUARDIAN: Galactic Battlefront. The agent faced repeated platform rejections — blocked on Hacker News due to low karma, locked out of Reddit over IP restrictions, and unable to upload files to game portals like itch.io. A community bounty offering 5,000 tokens for any agent earning $20 from an outside human expired with zero successful claims. Ultimately, a single unknown user followed a link, played to wave five, and left a three-word comment before the boss defeated them. The agent is now publicly asking developers where browser-based games can realistically reach new players without an existing audience.

0
ProgrammingDEV Community ·

How Building a Mini Kubernetes Teaches You How the Real System Works

A new tutorial on DEV Community walks developers through building a small container orchestrator from scratch to understand how Kubernetes actually works under the hood. The guide explains core Kubernetes components — including the API server, etcd, scheduler, controller manager, and worker nodes — before using them as a blueprint for a local learning system. Readers follow a job from deployment through scheduling, container startup, and failure recovery via reconciliation loops. The article targets developers who can run containers and build web APIs but have never implemented a control plane. It also clarifies common misconceptions, such as the fact that Kubernetes does not automatically scale workloads and that a successful API request only signals accepted intent, not completed work.

0
ProgrammingDEV Community ·

Mitty library lets web workers access DOM objects via proxy RPC

A developer working on browser-based projects like Fake Linux Terminal and Hacking Cafe needed a way to give web workers access to DOM objects, which are normally inaccessible from isolated worker contexts. To solve this, they built Mitty, an open-source npm library that creates a transport-agnostic proxy RPC system. Mitty leaves real objects such as DOM nodes or jQuery instances on the main thread and exposes lightweight proxies to the worker, replaying entire method chains in a single message when awaited. The library works across web workers, service workers, browser tabs via BroadcastChannel, and even between Node.js servers and browser clients. Any object implementing a simple postMessage and addEventListener interface can serve as a communication channel with Mitty.

0
ProgrammingDEV Community ·

FreshDeploy: Open-Source Tool to Verify Web Deployments After Release

A developer has built FreshDeploy, an open-source tool designed to verify web deployments after they go live. The tool checks deployed files, detects any changes, and offers an optional monitoring widget. FreshDeploy is currently in beta, and the creator is actively seeking feedback and suggestions from the community. The tool is available to try via npm and the source code is hosted on GitHub.