Skip to content

Instantly share code, notes, and snippets.

View yongkangc's full-sized avatar
🎃
Focusing

YK yongkangc

🎃
Focusing
View GitHub Profile
@yongkangc
yongkangc / multiproof_allocs.rs
Created December 23, 2025 04:58
multiproof bench code
#![allow(missing_docs, unreachable_pub)]
use alloy_primitives::{map::B256Set, B256};
use criterion::{black_box, criterion_group, criterion_main, BatchSize, BenchmarkId, Criterion};
use reth_trie_common::MultiProofTargets;
fn b256_from_u64(value: u64) -> B256 {
let mut bytes = [0u8; 32];
bytes[24..].copy_from_slice(&value.to_be_bytes());
B256::from(bytes)
}
@yongkangc
yongkangc / multiproof_bench_output.txt
Created December 23, 2025 04:58
multiproof bench results
MultiProofTargets::extend/extend_owned/accounts_256/slots_4
time: [16.338 µs 16.802 µs 17.227 µs]
change: [-20.088% -15.558% -10.625%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
9 (9.00%) high mild
MultiProofTargets::extend/extend_owned/accounts_1024/slots_2
time: [88.835 µs 98.353 µs 107.04 µs]
change: [-33.188% -25.654% -17.153%] (p = 0.00 < 0.05)
Performance has improved.
@yongkangc
yongkangc / multiproof_targets_extend_violin.svg
Created December 23, 2025 04:56
multiproof microbench graphs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / lines.png
Last active December 22, 2025 07:50
Criterion bench: state_provider_builder reuse
lines.png
@yongkangc
yongkangc / engine-newpayload-perf-recs.md
Last active December 22, 2025 06:51
engine_newPayload hot path perf recommendations (Abseil fast hints)

engine_newPayload Hot Path — Performance Recommendations

Source: https://abseil.io/fast/hints.html

Scope

Focused on engine_newPayload execution path in crates/engine/tree.

Hot Path Map

  • crates/engine/tree/src/tree/mod.rs: on_new_payloadtry_insert_payloadinsert_block_or_payload
  • crates/engine/tree/src/tree/payload_validator.rs: validate_block_with_statespawn_payload_processorexecute_blockvalidate_post_execution
@yongkangc
yongkangc / bal-for-nodes.md
Created December 8, 2025 07:03
Block Access List (BAL) - Impact on Ethereum Nodes and Builders (EIP-7928)

The Three Priorities Unlocked by BAL for Nodes

Priority What It Does Reth Component
1. BAL → SR Start state root computation immediately using BAL's final values crates/trie/parallel/
2. BAL → Cache Populate execution cache with exact slots from BAL crates/engine/tree/...rs
3. BAL → Parallel Exec Group non-conflicting txs using BAL access info crates/engine/tree/...essor/

The key insight: BAL transforms execution from discovery to verification. Instead of "execute to find out what happens," it becomes "verify that what BAL says happened is correct."

@yongkangc
yongkangc / overlay_root_bench.md
Created December 1, 2025 06:44
reth overlay_root bench

overlay_root bench (reth-trie-db)

Dataset: 1 block, 256 accounts × 4 slots seeded into Account/StorageChangeSets. Keccak hashing.

Results (Criterion, 100 samples, flat sampling):

  • overlay_root unsorted (HashedPostState) → 1.826 ms median
  • overlay_root_sorted (HashedPostStateSorted) → 1.699 ms median

Impact: Sorted fast-path is ~7.5% faster for this setup by skipping the HashMap→Vec conversion and using the sorted prefix-set builder. Hashing still dominates; larger/denser workloads may show bigger gaps.

@yongkangc
yongkangc / from_reverts_bench.md
Created December 1, 2025 06:40
reth from_reverts bench

from_reverts bench (reth-trie-db)

Dataset: 1 block of 256 accounts × 4 slots (Account/StorageChangeSets). Keccak hashing.

Results (Criterion, 100 samples, flat sampling):

  • from_reverts unsorted → 872.3 µs (median)
  • from_reverts sorted → 882.1 µs (median)

Observation: the sorted path is ~1.1% slower on this small dataset. The extra sort avoidance isn’t visible at this scale; overhead likely dominated by hashing and cursor walks. Larger or more skewed datasets may show wins; this run mostly confirms parity.

@yongkangc
yongkangc / violin.svg
Created December 1, 2025 04:34
from_reverts benchmark violin
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / Analysis.md
Created October 11, 2025 11:37
ptj analysis

1) Fact‑check & correlation map of PTJ’s key points

A. “This feels like 1999; the NASDAQ doubled from the first week of Oct ’99 to March 2000.”

  • The analogy to 1999 (late‑cycle “blow‑off” run) is reasonable as a narrative, but the “doubled” stat isn’t quite right on a closing‑price basis. From Oct 8, 1999 (NASDAQ Composite close 2,886.57) to the bubble peak on Mar 10, 2000 (5,048.62), the index rose ~75%, not 100%. Intraday or picking an even earlier October low can make the move look closer to 2x, but by standard closes it was +75%. ([Yahoo Finance][1])

B. “Monetary policy is easing now (multiple cuts ahead) vs. hikes into the 2000 top; fiscal is very loose (≈6% deficit/GDP) vs. surplus in 1999–2000.”

  • Rate regime: The Fed cut 25 bps in September 2025 to a 4.00%–4.25% target range, and the dot plot / street base cases suggest more cuts into 2026, i.e., we’re in an easing cycle. In 1999–2000 the Fed hiked from 5.0% to 6.5%. ([fedprimerate.com][2])