-
Notifications
You must be signed in to change notification settings - Fork 198
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
gas consumption vs gas provided #3615
Conversation
…ard txs due to stuck status
Codecov Report
@@ Coverage Diff @@
## development #3615 +/- ##
============================================
Coverage 73.69% 73.69%
============================================
Files 585 585
Lines 75317 75317
============================================
Hits 55503 55503
Misses 15405 15405
Partials 4409 4409
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.
checked with the first implementation, looks good 👍
…rd is stuck situation too early, as now could exist many mini blocks (max. 3) from me to the same receiver in one block, because of the recently implemented splitting mechanism from 1.5 bil. to 600 mil. per mini block
@@ -124,8 +124,8 @@ func (gc *gasComputation) GasPenalized(hash []byte) uint64 { | |||
return gasPenalized | |||
} | |||
|
|||
// TotalGasConsumed gets the total gas consumed | |||
func (gc *gasComputation) TotalGasConsumed() uint64 { | |||
// TotalGasProvided gets the total gas consumed |
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.
...total gas provided
process/block/shardblock.go
Outdated
@@ -596,7 +596,7 @@ func (sp *shardProcessor) indexBlockIfNeeded( | |||
return | |||
} | |||
|
|||
gasConsumedInHeader := sp.baseProcessor.gasConsumedProvider.TotalGasConsumed() | |||
gasConsumedInHeader := sp.baseProcessor.gasConsumedProvider.TotalGasProvided() |
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.
gasProvidedInHeader, and maybe we should change also in HeaderGasConsumption DTO (L610) from GasConsumed to GasProvided
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.
b5ebe8f
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.
System test passed.
Errors are safe and will be solved with PR #3623
@@ -621,7 +621,7 @@ func (mp *metaProcessor) indexBlock( | |||
Header: metaBlock, | |||
SignersIndexes: signersIndexes, | |||
HeaderGasConsumption: indexer.HeaderGasConsumption{ | |||
GasConsumed: gasConsumedInHeader, | |||
GasProvided: gasConsumedInHeader, |
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.
gasProvidedInHeader
func (gc *gasComputation) TotalGasProvided() uint64 { | ||
totalGasConsumed := uint64(0) | ||
totalGasProvided := uint64(0) | ||
|
||
gc.mutGasConsumed.RLock() | ||
for _, gasConsumed := range gc.gasConsumed { |
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.
gasProvided and gc.gasProvided ?
use the actual gas consumed for txs preselection
don't limit intrashard txs due to stuck status