-
Notifications
You must be signed in to change notification settings - Fork 54
Address POV Underestimations and remove base cost #243
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
base: moonbeam-polkadot-stable2409
Are you sure you want to change the base?
Conversation
b06e9eb
to
3588cb9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (3)
frame/evm/src/runner/stack.rs:316
- By directly assigning actual_proof_size from measured_proof_size_after without subtracting any prior value, the previous proof cost is entirely dropped; please verify that this behavior correctly implements the intended removal of the base cost.
let actual_proof_size = measured_proof_size_after;
frame/ethereum/src/lib.rs:404
- [nitpick] Consider adding a comment here to explain why the condition 'weight_limit.proof_size() > 0' is used to determine transaction eligibility, which would help clarify the rationale behind transitioning to proof_size_pre_execution.
if weight_limit.proof_size() > 0 {
frame/evm/src/tests.rs:103
- [nitpick] Tests have been updated to pass 0 instead of Some(0); please ensure that there are also test cases covering scenarios where a non-zero proof_size_pre_execution is provided to validate the new logic.
weight_limit, 0,
541643c
to
5fdde97
Compare
frame/ethereum/src/lib.rs
Outdated
), | ||
_ => (None, None), | ||
); | ||
let proof_size_pre_execution = get_proof_size().unwrap_or_default(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
get_proof_size return the proof size consumed buy the whole block so far, it's not per transaction (expect at tax validation). So, tests with one transaction might pass but it will not work with several transactions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the proof_size
pre execution, used later to compute the PoV difference between after
and before
evm call. The base cost should no longer be necessary after paritytech/polkadot-sdk#4765
Context: polkadot-evm#1490 (comment)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The host function get_proof_size return the current PoV consumed buy the block under construction, so we can't use it to measure the pov consumed by the transaction pre execution.
…to tarekkma/remove-base-cost
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proof_size_pre_execution seeems to be never used, you should use it to compute the actual_proof_size
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In case of underestimation, the actual_proof_size
should be normalize to the maximum that can be consumed according to the gas limit
Added this commit to enable the CI: 4ab4997 We need to merge the changes from moonbeam-polkadot-stable2409 to this branch and fix all PoV related errors. |
…to tarekkma/remove-base-cost
{ | ||
let _ = weight_limit | ||
.proof_size() | ||
.checked_sub(proof_size_base_cost) | ||
.checked_sub(proof_size_pre_execution) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem right, I would say that this check is no longer necessary
No description provided.