Skip to content

feat(gas): derive cold storage cost from gas params#3777

Open
daixihegu wants to merge 1 commit into
bluealloy:mainfrom
daixihegu:main
Open

feat(gas): derive cold storage cost from gas params#3777
daixihegu wants to merge 1 commit into
bluealloy:mainfrom
daixihegu:main

Conversation

@daixihegu

Copy link
Copy Markdown

Summary

Make GasParams::cold_storage_cost() behave as a helper by deriving the cold storage cost from cold_storage_additional_cost() plus warm_storage_read_cost().

This keeps the default Berlin value equal to COLD_SLOAD_COST, while also making custom gas parameter overrides compose correctly when either of the underlying values changes.

Closes #3342.

Testing

  • cargo test -p revm-context-interface test_cold_storage_cost
  • cargo fmt --all --check
  • cargo test -p revm-context-interface
  • cargo clippy -p revm-context-interface --all-targets --all-features -- -D warnings
  • typos crates/context/interface/src/cfg/gas_params.rs
  • git diff --check

Signed-off-by: daixihegu <daixihegu@163.com>
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.

Helper for GasParams cold_storage_cost()

1 participant