Skip to content

Surface block-accumulated cost on ApplyStateOutcome - #19

Merged
mwaddip merged 1 commit into
mainfrom
feat/surface-block-cost
Aug 19, 2026
Merged

Surface block-accumulated cost on ApplyStateOutcome#19
mwaddip merged 1 commit into
mainfrom
feat/surface-block-cost

Conversation

@mwaddip

@mwaddip mwaddip commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add block_cost: Option<u64> to ApplyStateOutcomeSome when scripts were evaluated, None when skipped (at or below checkpoint height)
  • Both digest and UTXO validators now capture the evaluate_scripts return value instead of discarding it
  • Contract updated in facts/validation.md

Motivated by SANTA/donner needing the cost as a conformance observable without reimplementing the state replay.

Test plan

  • cargo test -p ergo-validation — 73 passed
  • cargo clippy -p ergo-validation --all-targets — clean
  • cargo build --workspace — clean

🤖 Generated with Claude Code

The cost was already computed by evaluate_scripts and gate-checked
against maxBlockCost inside it — both validators just dropped the
return value. Surface it as Option<u64> so external conformance
runners (SANTA/donner) can grade it without reimplementing the
state replay.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mwaddip
mwaddip merged commit 0517ec4 into main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant