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
rusk: fix high gas limit TXs taking longer #615
Conversation
149c8e6
to
f1d36e9
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.
Some optimisation in the comments that can be addressed in some followup PRs.
Btw I'll approve it after you add at least a test to cover this implementation
363f117
to
6072e34
Compare
I added a test proving the behavior is as expected. I also played around with the suggested performance improvements and even though there were gains (marginal ones), I've decided against including them due to a substantial increase in code footprint. We can always discuss them in a future PR/issue. |
6264a75
to
20ef4e4
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.
LGTM
&refunds[i as usize], | ||
&receiver, | ||
amount, | ||
1_000_000_000, |
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.
Does this mean that is now safe to send txs even with GasLimit higher than the BlockGasLimit?
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.
Yes it does. As long as the gas spent is ultimately smaller or equal than the gas left in the block it will pass.
- Add `fork` method to `RuskState` allowing for copying the underlying `NetworkState` - Change `execute_state_transition` to keep transactions based on `gas_spent` instead of `gas_limit` Resolves: #605
20ef4e4
to
517c62b
Compare
fork
method toRuskState
allowing for copying the underlyingNetworkState
execute_state_transition
to keep transactions based ongas_spent
instead ofgas_limit
Resolves: #605