-
Notifications
You must be signed in to change notification settings - Fork 629
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
Limiting the processing of a block in Runtime by delaying receipts #1610
Conversation
Codecov Report
@@ Coverage Diff @@
## staging #1610 +/- ##
===========================================
+ Coverage 79.88% 79.93% +0.05%
===========================================
Files 130 131 +1
Lines 24504 24764 +260
===========================================
+ Hits 19574 19795 +221
- Misses 4930 4969 +39
Continue to review full report at Codecov.
|
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.
One last suggestion: #1610 (comment)
Documentation for delayed receipts and Runtime crate: nearprotocol/nomicon#7 |
@@ -1153,13 +1219,17 @@ impl Runtime { | |||
|
|||
#[cfg(test)] | |||
mod tests { | |||
use super::*; | |||
|
|||
use near::config::INITIAL_GAS_PRICE; |
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 a bit weird to depend on near for just a constant that doesn't matter anyway.
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.
It was used within gas_burnt_to_reward
. So right now it's indirect dependency anyway. I can refactor all of this in a different PR to remove dependency on near
from fees_utils
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.
@@ -635,6 +637,8 @@ impl RuntimeAdapter for NightshadeRuntime { | |||
epoch_length: self.genesis_config.epoch_length, | |||
gas_price, | |||
block_timestamp, | |||
// NOTE: verify transaction doesn't use gas limit | |||
gas_limit: None, |
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.
should we use gas limit for verification as well?
because if block limit is small-ish and tx is gigantic, it won't fit in the block as well?
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 probably shouldn't have TXs that are large enough to not fit into the block. We'll be able to refactor this later.
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.
Generally looks good. Let's just remove near from dev-dependencies in runtime as it's not really needed.
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.
On a second look, I think we should split gas_limit
into transaction_gas_limit
and receipt_gas_limit
, instead of dividing gas_limit
by 2.
This is not an easy fix, cause it requires to change half of the chain, cause we recalculate |
gas_limit
from chunk_extra to the Runtime.gas_limit
.Going to update nomicon before merging this PR.
Ref #1507