refactor: extract precompile gas from CALL overhead and emit synthetic frame#83
Open
refactor: extract precompile gas from CALL overhead and emit synthetic frame#83
Conversation
refactor: extract precompile gas from CALL overhead and emit synthetic frame
…an B memory expansion
…ress to reduce duplication
Savid
approved these changes
Feb 16, 2026
…ties feat(structlog): expose IsPrecompile helper for external use feat(execution): extend StructLog with MemorySize, CallTransfersValue, ExtCodeCopySize test(structlog): add comprehensive tests for cold access and memory expansion
Introduce memory and cold-access counters to enable gas cost breakdown into memory expansion and state-access categories. - Extend CallFrameRow and OpcodeStats with memory-words sums (before/after) and squared sums plus cold-access counts. - Update aggregator to accumulate the new fields per opcode and roll them up to frame summaries. - Add memWordsBefore, memWordsAfter, coldAccessCount params to ProcessStructlog and wire them in transaction processing. - Extend ClickHouse columns and batch insert logic to persist the new metrics. - Remove local precompile list and delegate to structlog pkg.
…stant test(memory_test): add comprehensive unit tests for resolveLastInFrame style(memory): remove outdated comment about RETURN/REVERT stack layout
test: add boundary precision tests for cold access classification test: add unit tests for memory parsing and word computation test: add aggregator tests for resource gas accumulation and nested frames test: add column tests for new resource gas fields
* master: build(goreleaser): disable provenance attestation in docker builds
…e to empty account The classifier now removes the 25 000 gas charged for creating a new account before deciding how many cold accesses occurred. This prevents false positives when the large new-account cost would otherwise be mis-classified as extra cold accesses. docs: clarify CALL value-transfer and stipend comments test: add cases covering CALL to empty accounts with value transfer
…on logic - Add detailed inline comments explaining CALL and EXTCODECOPY gas composition, normalization steps, and range-based classification rules. - Clarify why 200/2600/5200 thresholds are safe (gaps >2000 gas). - Document precompile warm-up via EIP-2929 and fallback stack reads. - No functional change; improves future maintainability.
…pped feat(aggregator): add exact memory expansion gas tracking per opcode refactor: replace hard-coded thresholds with warmAccessCost constant
feat(structlog): add cold access detection and memory expansion utilities
…consistency Replace nullable pointer with zero-value semantics to simplify code and align with the fact that refund is always 0 for failed transactions, per-opcode rows, and non-root frames.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Precompile calls (
CALL/STATICCALLto addresses0x01–0x11,0x100) were previously invisible instructlog_agg. Their gas was silently absorbed into the parent frame'sCALLopcode stats. This change makes them visible by emitting synthetic call frames, the same way we already do for EOA calls.