polkadot-evm / frontier

Ethereum compatibility layer for Substrate.
Apache License 2.0
574 stars 487 forks source link

Pass `WeightInfo` to the runner #1447

Open boundless-forest opened 5 months ago

boundless-forest commented 5 months ago

The WeightInfo is a unique feature in the current evm pallet, it's used to track the consumed the weight in the evm stack execution. There is no such thing in the Ethereum, so we better keep it in a single object instead of multiple places, this makes the whole logic much clearer. In this PR:

  1. I have merged the weight_limit and proof_size_base_cost into the existingWeightInfo struct and initialise it when the transaction starts to execute and pass it along to the runner.
  2. Rename it to EvmWeightInfo to avoid confiict with the one in the polkadot-sdk.
boundless-forest commented 5 months ago

@librelois @sorpaas @koushiro Please take a review.

boundless-forest commented 3 months ago

If https://github.com/polkadot-evm/frontier/pull/1490 is approved, this can be closed.