Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace manually proof_size calculation with storage_proof_size host function #1483

Open
boundless-forest opened this issue Jul 31, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@boundless-forest
Copy link
Collaborator

Motivation

The current frontier transaction proof_size calculation relies on the EVM hook and is calculated manually. For example, see https://github.com/polkadot-evm/frontier/blob/master/frame/evm/src/runner/stack.rs#L952-L1168. This is due to the lack of a workable solution to query the consumed proof_size of the executed Ethereum transaction. This approach makes the codebase harder to maintain and prone to errors.

Suggested Solution

Utilized the Polkadot storage_proof_size host function. By integrating it into the current Ethereum and EVM pallets, the transaction proof size can be restricted easily and accurately.

Additional Information

The only drawback that comes to mind is that the newly added host function requires a forced upgrade for the network nodes. This may pose a challenge for networks with thousands of decentralized nodes. (But I believe it's doable; we managed it when switching to async backing mode.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant