From b35d85c0cb5a6b3cfb788b9fd9c56544bbb65dd0 Mon Sep 17 00:00:00 2001 From: Laurentiu Ciobanu Date: Mon, 21 Oct 2024 07:48:29 +0000 Subject: [PATCH] update gas trace names --- go.mod | 4 ++-- go.sum | 8 ++++---- vmhost/vmhooks/baseOps.go | 12 ++++++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/go.mod b/go.mod index cdcab02c9..2b9a0b8bd 100644 --- a/go.mod +++ b/go.mod @@ -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 diff --git a/go.sum b/go.sum index 7ecf7fce0..b89e8efa0 100644 --- a/go.sum +++ b/go.sum @@ -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= @@ -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= diff --git a/vmhost/vmhooks/baseOps.go b/vmhost/vmhooks/baseOps.go index 9d84677c8..190e15aeb 100644 --- a/vmhost/vmhooks/baseOps.go +++ b/vmhost/vmhooks/baseOps.go @@ -100,6 +100,10 @@ const ( getOriginalTxHashName = "getOriginalTxHash" getCurrentTxHashName = "getCurrentTxHash" getPrevTxHashName = "getPrevTxHash" + getRoundTimeName = "getRoundTime" + epochStartBlockTimeStampName = "epochStartBlockTimeStamp" + epochStartBlockNonceName = "epochStartBlockNonce" + epochStartBlockRoundName = "epochStartBlockRound" ) type CreateContractCallType int @@ -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) return int64(blockchain.RoundTime()) } @@ -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) return int64(blockchain.EpochStartBlockTimeStamp()) } @@ -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) return int64(blockchain.EpochStartBlockNonce()) } @@ -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) return int64(blockchain.EpochStartBlockRound()) }