Tags: StrobeLabs/eth.zig
Tags
Add Flashbots MEV bundle submission support (#32) * Add Flashbots MEV bundle submission support (#13) Implement Flashbots relay client with eth_sendBundle, mev_sendBundle, eth_callBundle, and eth_cancelBundle. Includes EIP-191 auth signing (X-Flashbots-Signature header) and Bundle convenience builder. * Fix review findings: thread allocator through JSON parsers, add ownership docs Use caller's allocator instead of page_allocator in response parsing functions for consistent memory tracking. Add doc comments clarifying Bundle's borrowing semantics for transaction slices. * Bump version to 0.3.0 for Flashbots bundle support release * Fix CallBundleOpts stateBlockNumber to accept tags, parse decimal strings - Change state_block_number from ?u64 to ?BlockParam so callers can pass block tags like "latest" per the Flashbots spec - Add decimal string parsing for bundleGasPrice/coinbaseDiff/etc fields which Flashbots returns as decimal strings, not hex * Escape JSON strings in params builders, fix decimal u256 overflow check - Add appendJsonEscaped helper for RFC 8259 string escaping (quotes, backslashes, control chars) and use it for replacement_uuid, privacy.hints, and privacy.builders - Fix parseDecimalU256 to use pre-multiply overflow bounds check (maxInt(u256)/10) instead of post-wrap comparison
GLV secp256k1 + lane-complementing Keccak: beat Voltaire on all crypt… …o benchmarks (#22) * GLV secp256k1 + lane-complementing Keccak: beat Voltaire on all crypto benchmarks * Update alloy.rs benchmark results with GLV + lane-complementing Keccak numbers * Revert inline unroll and @vector theta: runtime loop is faster on Apple Silicon * Apply zig fmt to keccak_optimized.zig * Clean up chiLane dead code and add derivePublicKey scalar validation Remove unused cx parameter and need_complement dead code from chiLane (XKCP correctness comes from full round interaction, not per-lane invariant). Add explicit scalar validation to derivePublicKey matching sign(). Fix sweep test comment (0 to 299, not 300).
Optimize performance: beat alloy.rs on 18/24 benchmarks (#3) * Optimize performance: beat alloy.rs on 18/24 benchmarks Major performance optimizations across the entire eth-zig library to compete with alloy.rs. Previously alloy won 14/24 benchmarks; now eth-zig wins 18/24 with only 5 alloy wins remaining (secp256k1 EC curve limitation and u256 LLVM multiplication overhead). Key optimizations: - Replace GeneralPurposeAllocator with c_allocator in benchmarks - Remove redundant verifyRecovery from secp256k1 sign() (5 EC muls -> 1) - Add zero-overhead direct buffer RLP encoding (writeDirect API) - Add zero-overhead direct buffer ABI encoding (writeValuesDirect) - Pre-calculate RLP/ABI/TX sizes to enable single-allocation encoding - Eliminate all temp ArrayList buffers in RLP, ABI, and TX serialization - Add u256 fastDiv with u128 fast-path (67ns -> 6ns) - Add comptime hex decode lookup table (36ns -> 16ns) - Optimize bytesToUint with BSWAP instead of byte loop (12ns -> 6ns) - Use @clz for branchless byte-length counting in RLP encoding - Fix address_derivation benchmark to match alloy's scope - Add alloy.rs comparison benchmark suite and compare.sh script * Add benchmark comparison results table Documents the full eth-zig vs alloy.rs benchmark comparison with before/after numbers, score summary, and analysis of remaining gaps. * Fix zig fmt formatting in rlp.zig
Add integration tests, README overhaul, and bug fixes (#2) * Add integration tests, overhaul README, fix provider/wallet bugs Integration tests (tests/integration_tests.zig): - 15 Anvil-backed tests covering chain state, account state, gas, blocks, wallet transactions, and receipt verification - Graceful skip when Anvil is not running README overhaul: - Add "Why eth.zig?" section with key differentiators - Add ERC-20 Quick Start example - Fix HD wallet example to use actual API - Add examples directory table - Add feature comparison vs Zabi - Update module and feature tables with new modules Bug fixes in provider.zig: - Fix use-after-free in extractResultString (was returning slice into freed JSON parser memory) - Fix Zig 0.15 optional coercion in parseOptionalHash/parseOptionalHexU64 Bug fix in wallet.zig: - Fix std.time.sleep -> std.Thread.sleep for Zig 0.15 * Add benchmark suite, CONTRIBUTING, CHANGELOG, and issue templates - bench/bench.zig: 11 benchmarks (keccak, secp256k1, ABI encode/decode, RLP, tx serialization, HD wallet, EIP-712, address checksum) - build.zig: add `zig build bench` step (always ReleaseFast) - CONTRIBUTING.md: build/test/PR guidelines + architecture diagram - CHANGELOG.md: full v0.1.0 feature list - .github/ISSUE_TEMPLATE: bug report + feature request templates
Initial release: pure Zig Ethereum client library v0.1.0 Complete implementation of core Ethereum primitives, ABI/RLP encoding, ECDSA signing, transaction types (legacy through EIP-4844), BIP-32/39/44 HD wallets, HTTP+WebSocket JSON-RPC transports, ENS resolution, contract interaction, Multicall3, EIP-712, and multi-chain support. Zero external dependencies. 446 passing tests.