-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make mempool aware of MaxGas requirement #2360
Conversation
ea525e0
to
89ab737
Compare
Codecov Report
@@ Coverage Diff @@
## develop #2360 +/- ##
===========================================
+ Coverage 61% 61.09% +0.08%
===========================================
Files 197 197
Lines 16294 16300 +6
===========================================
+ Hits 9940 9958 +18
+ Misses 5495 5482 -13
- Partials 859 860 +1
|
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.
🥇 🏎 🍰
We should add this check:
Also, would be great to see more tests. |
Agreed for adding more tests. Per the issue, I thought we put it on the app to require that gas used is less than gas wanted. We don't run through the block until h+1 so if we decided that the gas used was actually too high, what would we do? Just drop the last txs? |
Added all tests I could think of. I set |
fa5494b
to
0d8c250
Compare
mempool/mempool_test.go
Outdated
@@ -71,6 +71,54 @@ func checkTxs(t *testing.T, mempool *Mempool, count int) types.Txs { | |||
return txs | |||
} | |||
|
|||
func TestReapMaxGasMaxBytes(t *testing.T) { |
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.
TestReapMaxBytesMaxGas
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.
Good catch!
Hrmm, looks like switching the gas from kv store to persistent kv store caused things to break. Not really sure why, since persistent kv store just wraps kv store. I think I'll switch it back to kv store regardless, since it feels kinda strange only the variant that writes to disk does something for gasWanted. |
Oh actually this doesn't update the filter, to ensure no tx is greater than max gas. I think that should be done in a second PR though. |
Closes #2310
TODO: update spec