-
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
Added metric for max gas per transaction #3496
Conversation
node/nodeRunner.go
Outdated
@@ -556,7 +557,7 @@ func (nr *nodeRunner) createMetrics( | |||
metrics.SaveStringMetric(managedCoreComponents.StatusHandler(), common.MetricRewardsTopUpGradientPoint, managedCoreComponents.EconomicsData().RewardsTopUpGradientPoint().String()) | |||
metrics.SaveStringMetric(managedCoreComponents.StatusHandler(), common.MetricTopUpFactor, fmt.Sprintf("%g", managedCoreComponents.EconomicsData().RewardsTopUpFactor())) | |||
metrics.SaveStringMetric(managedCoreComponents.StatusHandler(), common.MetricGasPriceModifier, fmt.Sprintf("%g", managedCoreComponents.EconomicsData().GasPriceModifier())) | |||
|
|||
metrics.SaveUint64Metric(managedCoreComponents.StatusHandler(), common.MetricMaxGasPerTransaction, managedCoreComponents.EconomicsData().MaxGasLimitPerMiniBlock(selfShardID)) |
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.
maybe use managedCoreComponents.EconomicsData().MaxGasLimitPerMiniBlockForSafeCrossShard()
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. done
process/economics/economicsData.go
Outdated
@@ -708,6 +708,8 @@ func (ed *economicsData) setGasLimitConfig(currentEpoch uint32) { | |||
"maxGasLimitPerMetaMiniBlock", ed.maxGasLimitPerMetaMiniBlock, | |||
"minGasLimit", ed.minGasLimit, | |||
) | |||
|
|||
ed.statusHandler.SetUInt64Value(common.MetricMaxGasPerTransaction, ed.maxGasLimitPerMiniBlock) |
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.
MaxGasLimitPerMiniBlockForSafeCrossShard?
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 cannot use that function because it has mutex protection and I already am inside a function with mutex protection (until defer). However, I've set the metric value the minimum between shard miniblock limit and meta miniblock limit (just as in that function)
@@ -171,6 +171,7 @@ func (sm *statusMetrics) ConfigMetrics() map[string]interface{} { | |||
configMetrics[common.MetricRewardsTopUpGradientPoint] = sm.loadStringMetric(common.MetricRewardsTopUpGradientPoint) | |||
configMetrics[common.MetricGasPerDataByte] = sm.loadUint64Metric(common.MetricGasPerDataByte) | |||
configMetrics[common.MetricChainId] = sm.loadStringMetric(common.MetricChainId) | |||
configMetrics[common.MetricMaxGasPerTransaction] = sm.loadUint64Metric(common.MetricMaxGasPerTransaction) |
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.
add this new metric also in the test file
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.
added
…nto added-max-tx-gas-limit-metric
Codecov Report
@@ Coverage Diff @@
## development #3496 +/- ##
===============================================
- Coverage 73.87% 73.87% -0.01%
===============================================
Files 582 582
Lines 74441 74444 +3
===============================================
+ Hits 54996 54998 +2
- Misses 15044 15045 +1
Partials 4401 4401
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.
added
erd_max_gas_per_transaction
metric that will also be returned in the/network/config
endpoint