-
Notifications
You must be signed in to change notification settings - Fork 52
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
Set PoV in frontier template #225
Conversation
@@ -604,6 +605,7 @@ impl<F: FindAuthor<u32>> FindAuthor<H160> for FindAuthorTruncated<F> { | |||
|
|||
parameter_types! { | |||
pub BlockGasLimit: U256 = U256::from(BLOCK_GAS_LIMIT); | |||
pub const GasLimitPovSizeRatio: u64 = BLOCK_GAS_LIMIT.saturating_div(MAX_POV_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.
I always forget how does saturating_div
differ from normal div, so in case anyone is curious:
For unsigned types, it's exactly the same as normal div. It still panics on division by 0.
For signed types, it's the same except one edge case: i8::MIN / -1
returns i8::MAX
instead of overflowing (because -256 is a valid value but +256 is not, so it returns +255 instead).
In this case it's a u64
so it's the same as using /
, but you can keep it for symmetry with the other operations.
Any chance we can test this? |
I am looking for an example test now. Are you aware of any? |
FYI we merged some CI changes and this has conflicts, @rimbi you should merge master and run |
@tmpolaczyk @girazoki The tests pass now. But I am still not sure if they are enough to cover the change. What is your take on it? The tests: |
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.
Removing the expects should not be a solution for this. We need to investigate why the rpc is not returning the proof size
Is it expected to return |
yes, this feature was not merged upstream, you need to cherry-pick this commit on your substrate fork: moonbeam-foundation/substrate@0506153 |
Thanks @librelois, @rimbi I will cherry-pick this change and see if it works |
We added the cherry-pick @rimbi, you need to change the commit in the cargo lock from |
@girazoki the response still lacks |
It works for me locally, make sure to compile with |
I have manipulated the numbers in the tests so that the tests pass. I don't know if they make sense or not. Please check my last commit. @girazoki @tmpolaczyk |
Can we merge this? |
Nope, ideally we would want to know why the values we had originally (same as Moonbeam) dont work. It might well be that the pov is not being accounted in the EVM and that is why you had to lower the values |
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.
I am requesting changes so that we dont forget to look at this
@@ -99,8 +99,8 @@ describeSuite({ | |||
// The block still contain the failed (out of gas) transaction so the PoV is still included | |||
// in the block. | |||
// 1M Gas allows ~250k of PoV, so we verify we are within range. |
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 line is specially suspicious, 1M gas should indeed account for 250K pov proof, and our tests clearly indicate they dont
So I investigated a bit more and I realizde your txs are failing (you can do pnpm moonwall run dev_frontier_tempalte and then grepTest the test that you want to run). I see all of them fail with OutOfGas, but if we remove the pov stuff, they dont fail. So the low numbers are probably because it fails |
More on this, is the estimateGas that it's failing. If the gas was well estimated, things would work. But seems estimateGas is not estimating the pov |
I have copied the settings from the
node-template
infrontier
repo.