Skip to content

Instantly share code, notes, and snippets.

@roninjin10
roninjin10 / datastoragereth.md
Created November 30, 2025 20:52
Reth data storage

Comprehensive Reth Storage Architecture Report

   Based on my thorough exploration of the Reth codebase, here's a detailed understanding of the storage architecture:

   1. Database Technology: MDBX + Static Files (Hybrid Model)

   Reth implements a hybrid storage approach combining two technologies:

   MDBX (Memory-Mapped Database Exchange)
@roninjin10
roninjin10 / helios-report.md
Last active November 24, 2025 00:09
How helios works

Helios Ethereum Light Client Architecture (L1 & L2)

A maximally concise, information-dense reference for reimplementation in Zig.

Helios is a trust-minimized, stateless Ethereum light client. It verifies consensus-layer (CL) headers and execution-layer (EL) state using cryptographic proofs without storing the chain. The design consists of two tightly integrated subsystems:

  • Consensus Layer: Verifies canonical chain head via sync-committee signatures (L1) or sequencer signatures (L2).
  • Execution Layer: Verifies state (accounts, storage, receipts, logs) using Merkle-Patricia proofs tied to the trusted header’s state root.

The result is a local JSON-RPC server that returns only verifiably correct blockchain data.

@roninjin10
roninjin10 / canon.vibe.prd.md
Created November 21, 2025 07:54
Onchain canon product

PRD: Canon Tables


1. Vision

  • Multiplayer canon platform for IPs
  • Communities co-create “official” timelines
  • Feels like D&D + fandom + creator coin, not governance app
@roninjin10
roninjin10 / ephemeralchannels.md
Last active November 8, 2025 01:34
App layer ephemeral channels

EVENT‑SOURCED STATE CHANNELS: PRODUCT REQUIREMENTS DOCUMENT (v0.0.4)

Version: 0.0.4 Date: 2025‑11‑08 Status: Draft Authors: Fucory


Table of Contents

@roninjin10
roninjin10 / zig-vs-rust-guillotine.md
Last active October 30, 2025 23:47
zig-vs-rust-guillotine

Zig vs. Rust When Building Guillotine

I started Guillotine in Rust, but quickly switched to Zig. This piece explains why in hindsight that was the right call.


TL;DR

  • Zig: fanatically explicit, zero hidden control flow/allocations, first-class C interop, powerful comptime for safety + customization, simple mental model for size/perf.
  • Rust: superb compiler and ecosystem, strong safety model, great tooling; but hidden control flow and panic/unwind mechanics make size/perf reasoning harder, and FFI ergonomics add ceremony.
@roninjin10
roninjin10 / napi-example.ts
Created October 13, 2025 10:46
foundry-compilers napi rs exmaple api
Here's what a TypeScript interface would look like if you wrapped the
foundry-compilers Rust API with NAPI-RS:
// =======================================================================
=====
// Core Types
// =======================================================================
=====
export type Severity = 'error' | 'warning' | 'info';
@roninjin10
roninjin10 / gist:35cdb0afbe31594b62612754661f2208
Last active October 11, 2025 06:17
javascript benchmarks aos vs soa
import { bench, describe } from 'vitest';
const NUM_ENTITIES = 100000;
// ============================================================================
// IMPLEMENTATION 1: Array of Structs (AoS) - Traditional OOP approach
// ============================================================================
// Using objects with MANY unused fields
const entitiesAoS_Objects = [];
@roninjin10
roninjin10 / blockprompt.md
Created August 20, 2025 19:11
block-prompt.md

Block-Based EVM Optimization with BLOCK_START Instructions

Overview

This prompt outlines the implementation of a comprehensive block-based optimization system for the Guillotine EVM that introduces BLOCK_START pseudo-instructions to enable advanced optimizations including stack validation, gas pre-calculation, and intelligent prefetching.

Core Philosophy

Instead of validating stack depth and calculating gas costs instruction-by-instruction during execution, we pre-analyze bytecode into basic blocks and aggregate requirements at the block level. This enables:

/// Frame represents the entire execution state of the EVM as it executes opcodes
/// Layout designed around actual opcode access patterns and data correlations
pub const Frame = struct {
// ULTRA HOT - Accessed by virtually every opcode
stack: Stack, // 33,536 bytes - accessed by every opcode (PUSH/POP/DUP/SWAP/arithmetic/etc)
gas_remaining: u64, // 8 bytes - checked/consumed by every opcode for gas accounting
// HOT - Accessed by major opcode categories
memory: *Memory, // 8 bytes - hot for memory ops (MLOAD/MSTORE/MSIZE/MCOPY/LOG*/KECCAK256)
analysis: *const CodeAnalysis, // 8 bytes - hot for control flow (JUMP/JUMPI validation)
// Hot execution flags (only the bits that are actually checked frequently)
@roninjin10
roninjin10 / high-effort-prompt.md
Created July 28, 2025 02:49
High effort prompt

Implement Secure Git Command Execution Wrapper

<task_definition> Create a secure, high-performance Git command execution wrapper in Zig that provides a safe interface for running Git operations. This wrapper will be the foundation for all Git functionality in Plue, supporting both local operations and Git smart HTTP protocol for remote operations. </task_definition>

<context_and_constraints>

<technical_requirements>