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
Dynamic gas data trie loads #4804
Conversation
…-trie-loads # Conflicts: # cmd/node/config/enableEpochs.toml # cmd/node/config/gasSchedules/gasScheduleV7.toml # common/enablers/enableEpochsHandler.go # common/enablers/epochFlags.go # config/epochConfig.go # go.mod # go.sum
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## rc/v1.6.0 #4804 +/- ##
=============================================
- Coverage 80.10% 80.09% -0.02%
=============================================
Files 708 706 -2
Lines 93408 93359 -49
=============================================
- Hits 74821 74772 -49
+ Misses 13275 13271 -4
- Partials 5312 5316 +4
☔ View full report in Codecov by Sentry. |
# The current values for the coefficients were computed based on benchmarking | ||
[DynamicStorageLoad] | ||
A = 687 | ||
SignOfA = 0 |
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.
Looking for better naming...
…-trie-loads # Conflicts: # cmd/node/config/enableEpochs.toml # common/enablers/enableEpochsHandler.go # common/enablers/epochFlags.go # common/interface.go # config/epochConfig.go # go.mod # go.sum # sharding/mock/enableEpochsHandlerMock.go # testscommon/enableEpochsHandlerStub.go
…-trie-loads # Conflicts: # go.mod # go.sum # integrationTests/vm/txsFee/multiShard/asyncCall_test.go # integrationTests/vm/txsFee/multiShard/asyncESDT_test.go # integrationTests/vm/txsFee/multiShard/relayedTxScCalls_test.go # integrationTests/vm/txsFee/multiShard/scCalls_test.go # integrationTests/vm/txsFee/relayedScCalls_test.go # integrationTests/vm/txsFee/scCalls_test.go # integrationTests/vm/wasm/utils.go
cmd/node/config/enableEpochs.toml
Outdated
@@ -236,6 +236,9 @@ | |||
# WipeSingleNFTLiquidityDecreaseEnableEpoch represents the epoch when the system account liquidity is decreased for wipeSingleNFT as well | |||
WipeSingleNFTLiquidityDecreaseEnableEpoch = 5 | |||
|
|||
# DynamicGasCostForDataTrieStorageLoadEnableEpoch represents the epoch when dynamic gas cost for data trie storage load will be enabled | |||
DynamicGasCostForDataTrieStorageLoadEnableEpoch = 6 |
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.
switch the value to 3? (what will come from rc/v1.4.0 will have all the other values set to 2)
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.
Done.
@@ -691,3 +691,16 @@ | |||
MaxBuiltInCallsPerTx = 100 | |||
MaxNumberOfTransfersPerTx = 100 | |||
MaxNumberOfTrieReadsPerTx = 100 | |||
|
|||
# Quadratic, Linear and Constant are the coefficients for a quadratic func. Separate variables are used for the | |||
# sign of each coefficient, 0 meaning + and 1 meaning - |
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.
0 meaning positive and 1 meaning negative
?
as it reads better. Valid on all the other gasmaps
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.
Done.
@@ -91,6 +91,7 @@ type EnableEpochs struct { | |||
RefactorPeersMiniBlocksEnableEpoch uint32 | |||
MaxBlockchainHookCountersEnableEpoch uint32 | |||
WipeSingleNFTLiquidityDecreaseEnableEpoch uint32 | |||
DynamicGasCostForDataTrieStorageLoadEnableEpoch uint32 |
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.
also adapt tests in the tomlConfig_test.go ?
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.
Done.
@@ -11,14 +11,17 @@ import ( | |||
"testing" | |||
|
|||
"github.com/multiversx/mx-chain-go/config" | |||
"github.com/multiversx/mx-chain-go/integrationTests" |
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.
please add a semiintegration test here in which you test the transaction fee is computed correctly if the DynamicGasCostForDataTrieStorageLoad is activated. Suggestion to have 2 tests: one when using the SaveKeyValue builtin function and one using a contract that can add data (maybe using an internal array or something).
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.
…-trie-loads # Conflicts: # cmd/node/config/gasSchedules/gasScheduleV1.toml # cmd/node/config/gasSchedules/gasScheduleV2.toml # cmd/node/config/gasSchedules/gasScheduleV3.toml # cmd/node/config/gasSchedules/gasScheduleV4.toml # cmd/node/config/gasSchedules/gasScheduleV5.toml # cmd/node/config/gasSchedules/gasScheduleV6.toml # cmd/node/config/gasSchedules/gasScheduleV7.toml # common/enablers/enableEpochsHandler.go # common/enablers/epochFlags.go # common/interface.go # config/epochConfig.go # sharding/mock/enableEpochsHandlerMock.go # testscommon/enableEpochsHandlerStub.go
…-trie-loads # Conflicts: # config/tomlConfig_test.go # go.mod # go.sum
go.sum
Outdated
@@ -611,14 +611,14 @@ github.com/multiversx/mx-chain-storage-go v1.0.7 h1:UqLo/OLTD3IHiE/TB/SEdNRV1GG2 | |||
github.com/multiversx/mx-chain-storage-go v1.0.7/go.mod h1:gtKoV32Cg2Uy8deHzF8Ud0qAl0zv92FvWgPSYIP0Zmg= | |||
github.com/multiversx/mx-chain-vm-common-go v1.3.34/go.mod h1:sZ2COLCxvf2GxAAJHGmGqWybObLtFuk2tZUyGqnMXE8= | |||
github.com/multiversx/mx-chain-vm-common-go v1.3.36/go.mod h1:sZ2COLCxvf2GxAAJHGmGqWybObLtFuk2tZUyGqnMXE8= | |||
github.com/multiversx/mx-chain-vm-common-go v1.3.37 h1:KeK6JCjeNUOHC5Z12/CTQIa8Z1at0dnnL9hY1LNrHS8= | |||
github.com/multiversx/mx-chain-vm-common-go v1.3.37/go.mod h1:sZ2COLCxvf2GxAAJHGmGqWybObLtFuk2tZUyGqnMXE8= | |||
github.com/multiversx/mx-chain-vm-common-go v1.3.38-0.20230227140728-5bd58c1e7990 h1:AYpgFg+jhi90nuxK8sRFyFPovSvQgbF4wdo025SrsFE= |
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.
proper release after initial tests
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.
Will add a proper release right before merge
config/tomlConfig_test.go
Outdated
RuntimeMemStoreLimitEnableEpoch: 63, | ||
DynamicGasCostForDataTrieStorageLoadEnableEpoch: 64, |
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.
go fmt here? plus remove line 690
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.
Done.
…-trie-loads # Conflicts: # common/enablers/enableEpochsHandler.go # common/enablers/epochFlags.go # common/interface.go # config/epochConfig.go # config/tomlConfig_test.go # go.mod # go.sum # integrationTests/benchmarks/loadFromTrie_test.go # integrationTests/testInitializer.go # integrationTests/vm/txsFee/asyncCall_test.go # integrationTests/vm/wasm/utils.go # sharding/mock/enableEpochsHandlerMock.go # testscommon/enableEpochsHandlerMock/enableEpochsHandlerStub.go
…-trie-loads # Conflicts: # config/tomlConfig_test.go # go.sum # sharding/mock/enableEpochsHandlerMock.go
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.
Normal allin test: master-0a0bcee937 -> dynamic-gas-data-trie-load-2a6908a5d3
--- Specific errors ---
block hash does not match 8743
wrong nonce in block 3105
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 3
Nr. of all WARNS: 145
Nr. of new ERRORS: 0
Nr. of new WARNS: 5
Nr. of PANICS: 0
/------/
…-trie-loads # Conflicts: # go.mod # go.sum
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.
just the proper release
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.
Normal allin test: master-0a0bcee937 -> dynamic-gas-data-trie-load-12a225a566
--- Specific errors ---
block hash does not match 1080
wrong nonce in block 467
miniblocks does not match 0
num miniblocks does not match 0
miniblock hash does not match 0
block bodies does not match 0
receipts hash missmatch 0
/------/
--- Statistics ---
Nr. of all ERRORS: 0
Nr. of all WARNS: 133
Nr. of new ERRORS: 0
Nr. of new WARNS: 0
Nr. of PANICS: 0
/------/
--- ERRORS ---
/------/
--- WARNINGS ---
/------/
Reasoning behind the pull request
Proposed changes
DynamicGasCostForDataTrieStorageLoadEnableEpoch
that will enable at the specified epoch the computation of gas cost for data trie loads based on the depth of the trie.Testing procedure
Pre-requisites
Based on the Contributing Guidelines the PR author and the reviewers must check the following requirements are met:
feat
branch created?feat
branch merging, do all satellite projects have a proper tag insidego.mod
?