Skip to content

Commit

Permalink
update gas trace names
Browse files Browse the repository at this point in the history
  • Loading branch information
laurci committed Oct 21, 2024
1 parent bd6ef70 commit b35d85c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ require (
github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1
github.com/gogo/protobuf v1.3.2
github.com/mitchellh/mapstructure v1.5.0
github.com/multiversx/mx-chain-core-go v1.2.21
github.com/multiversx/mx-chain-core-go v1.2.22
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f
github.com/multiversx/mx-chain-logger-go v1.0.15
github.com/multiversx/mx-chain-scenario-go v1.4.5-0.20240802080531-0906745c04b2
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241021074004-c2bdb78da54a
github.com/multiversx/mx-components-big-int v1.0.0
github.com/pelletier/go-toml v1.9.3
github.com/stretchr/testify v1.8.1
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua
github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
github.com/multiversx/mx-chain-core-go v1.2.21 h1:+XVKznPTlUU5EFS1A8chtS8fStW60upRIyF4Pgml19I=
github.com/multiversx/mx-chain-core-go v1.2.21/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-core-go v1.2.22 h1:yDYrvoQOBbsDerEp7L3+de5AfMy3pTF333gWPpd+FNk=
github.com/multiversx/mx-chain-core-go v1.2.22/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f h1:jydjrmVFvSllBOTppveOAkLITpOYKk0kma5z0bfDImI=
github.com/multiversx/mx-chain-crypto-go v1.2.12-0.20240725071000-c3212540166f/go.mod h1:9aSp//uBSvqFdzh4gvYISraoruhr1FCTXgPQalQ687k=
github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+wRqOwi3n+m2QIHXc=
Expand All @@ -93,8 +93,8 @@ github.com/multiversx/mx-chain-scenario-go v1.4.5-0.20240802080531-0906745c04b2
github.com/multiversx/mx-chain-scenario-go v1.4.5-0.20240802080531-0906745c04b2/go.mod h1:5lkUsHiCCX1rJOx0d763OIlD85y85xCYU0Zlzasq6OM=
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf h1:L9K7Xzq5SZz6k55R7HrafiRcU+c8/PqozJxys65G4bI=
github.com/multiversx/mx-chain-storage-go v1.0.16-0.20240725070753-aa7fb322ebdf/go.mod h1:ptvW/8r6bam55mVpeVZbyvvvydYM0DQwcPOH0W4Xyx8=
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef h1:6fxfLOgKwZ2Rn5MIl9TMaeYmyPigC2XQRCASC4P0PHQ=
github.com/multiversx/mx-chain-vm-common-go v1.5.14-0.20240802080126-92fc435bbbef/go.mod h1:OSvFbzdWThfRbLZbUsEr7bikBSaLrPJQ2iUm9jw9nXQ=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241021074004-c2bdb78da54a h1:+D5GR9SkHTkKU6fIMZLdSQHeIzbDzOT6fSJfKBG80+g=
github.com/multiversx/mx-chain-vm-common-go v1.5.17-0.20241021074004-c2bdb78da54a/go.mod h1:1rSkXreUZNXyPTTdhj47M+Fy62yjxbu3aAsXEtKN3UY=
github.com/multiversx/mx-components-big-int v1.0.0 h1:Wkr8lSzK2nDqixOrrBa47VNuqdhV1m/aJhaP1EMaiS8=
github.com/multiversx/mx-components-big-int v1.0.0/go.mod h1:maIEMgHlNE2u78JaDD0oLzri+ShgU4okHfzP3LWGdQM=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
Expand Down
12 changes: 8 additions & 4 deletions vmhost/vmhooks/baseOps.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ const (
getOriginalTxHashName = "getOriginalTxHash"
getCurrentTxHashName = "getCurrentTxHash"
getPrevTxHashName = "getPrevTxHash"
getRoundTimeName = "getRoundTime"
epochStartBlockTimeStampName = "epochStartBlockTimeStamp"
epochStartBlockNonceName = "epochStartBlockNonce"
epochStartBlockRoundName = "epochStartBlockRound"
)

type CreateContractCallType int
Expand Down Expand Up @@ -2916,7 +2920,7 @@ func (context *VMHooksImpl) GetRoundTime() int64 {
metering := context.GetMeteringContext()

gasToUse := metering.GasSchedule().BaseOpsAPICost.GetRoundTime
metering.UseGasAndAddTracedGas(getPrevBlockRandomSeedName, gasToUse)
metering.UseGasBoundedAndAddTracedGas(getRoundTimeName, gasToUse)

Check failure on line 2923 in vmhost/vmhooks/baseOps.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `metering.UseGasBoundedAndAddTracedGas` is not checked (errcheck)

return int64(blockchain.RoundTime())
}
Expand All @@ -2928,7 +2932,7 @@ func (context *VMHooksImpl) EpochStartBlockTimeStamp() int64 {
metering := context.GetMeteringContext()

gasToUse := metering.GasSchedule().BaseOpsAPICost.EpochStartBlockTimeStamp
metering.UseGasAndAddTracedGas(getPrevBlockRandomSeedName, gasToUse)
metering.UseGasBoundedAndAddTracedGas(epochStartBlockTimeStampName, gasToUse)

Check failure on line 2935 in vmhost/vmhooks/baseOps.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `metering.UseGasBoundedAndAddTracedGas` is not checked (errcheck)

return int64(blockchain.EpochStartBlockTimeStamp())
}
Expand All @@ -2940,7 +2944,7 @@ func (context *VMHooksImpl) EpochStartBlockNonce() int64 {
metering := context.GetMeteringContext()

gasToUse := metering.GasSchedule().BaseOpsAPICost.EpochStartBlockNonce
metering.UseGasAndAddTracedGas(getPrevBlockRandomSeedName, gasToUse)
metering.UseGasBoundedAndAddTracedGas(epochStartBlockNonceName, gasToUse)

Check failure on line 2947 in vmhost/vmhooks/baseOps.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `metering.UseGasBoundedAndAddTracedGas` is not checked (errcheck)

return int64(blockchain.EpochStartBlockNonce())
}
Expand All @@ -2952,7 +2956,7 @@ func (context *VMHooksImpl) EpochStartBlockRound() int64 {
metering := context.GetMeteringContext()

gasToUse := metering.GasSchedule().BaseOpsAPICost.EpochStartBlockRound
metering.UseGasAndAddTracedGas(getPrevBlockRandomSeedName, gasToUse)
metering.UseGasBoundedAndAddTracedGas(epochStartBlockRoundName, gasToUse)

Check failure on line 2959 in vmhost/vmhooks/baseOps.go

View workflow job for this annotation

GitHub Actions / golangci linter

Error return value of `metering.UseGasBoundedAndAddTracedGas` is not checked (errcheck)

return int64(blockchain.EpochStartBlockRound())
}
Expand Down

0 comments on commit b35d85c

Please sign in to comment.