Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
Integrated new VM
  • Loading branch information
iulianpascalau authored Aug 19, 2024
2 parents 7cab1a5 + 943e43b commit 41962f7
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 96 deletions.
3 changes: 3 additions & 0 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,9 @@
# AlwaysMergeContextsInEEIEnableEpoch represents the epoch in which the EEI will always merge the contexts
AlwaysMergeContextsInEEIEnableEpoch = 1

# UseGasBoundedShouldFailExecutionEnableEpoch represents the epoch when use bounded gas function should fail execution in case of error
UseGasBoundedShouldFailExecutionEnableEpoch = 1

# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
BLSMultiSignerEnableEpoch = [
{ EnableEpoch = 0, Type = "no-KOSK" },
Expand Down
1 change: 1 addition & 0 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -1014,5 +1014,6 @@ const (
CleanupAuctionOnLowWaitingListFlag core.EnableEpochFlag = "CleanupAuctionOnLowWaitingListFlag"
StakingV4StartedFlag core.EnableEpochFlag = "StakingV4StartedFlag"
AlwaysMergeContextsInEEIFlag core.EnableEpochFlag = "AlwaysMergeContextsInEEIFlag"
UseGasBoundedShouldFailExecutionFlag core.EnableEpochFlag = "UseGasBoundedShouldFailExecutionFlag"
// all new flags must be added to createAllFlagsMap method, as part of enableEpochsHandler allFlagsDefined
)
6 changes: 6 additions & 0 deletions common/enablers/enableEpochsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,12 @@ func (handler *enableEpochsHandler) createAllFlagsMap() {
},
activationEpoch: handler.enableEpochsConfig.AlwaysMergeContextsInEEIEnableEpoch,
},
common.UseGasBoundedShouldFailExecutionFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.UseGasBoundedShouldFailExecutionEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.UseGasBoundedShouldFailExecutionEnableEpoch,
},
}
}

Expand Down
2 changes: 2 additions & 0 deletions common/enablers/enableEpochsHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func createEnableEpochsConfig() config.EnableEpochs {
StakingV4Step3EnableEpoch: 98,
CleanupAuctionOnLowWaitingListEnableEpoch: 96,
AlwaysMergeContextsInEEIEnableEpoch: 99,
UseGasBoundedShouldFailExecutionEnableEpoch: 100,
}
}

Expand Down Expand Up @@ -431,6 +432,7 @@ func TestEnableEpochsHandler_GetActivationEpoch(t *testing.T) {
require.Equal(t, cfg.CleanupAuctionOnLowWaitingListEnableEpoch, handler.GetActivationEpoch(common.CleanupAuctionOnLowWaitingListFlag))
require.Equal(t, cfg.StakingV4Step1EnableEpoch, handler.GetActivationEpoch(common.StakingV4StartedFlag))
require.Equal(t, cfg.AlwaysMergeContextsInEEIEnableEpoch, handler.GetActivationEpoch(common.AlwaysMergeContextsInEEIFlag))
require.Equal(t, cfg.UseGasBoundedShouldFailExecutionEnableEpoch, handler.GetActivationEpoch(common.UseGasBoundedShouldFailExecutionFlag))
}

func TestEnableEpochsHandler_IsInterfaceNil(t *testing.T) {
Expand Down
1 change: 1 addition & 0 deletions config/epochConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ type EnableEpochs struct {
StakingV4Step3EnableEpoch uint32
CleanupAuctionOnLowWaitingListEnableEpoch uint32
AlwaysMergeContextsInEEIEnableEpoch uint32
UseGasBoundedShouldFailExecutionEnableEpoch uint32
BLSMultiSignerEnableEpoch []MultiSignerConfig
}

Expand Down
4 changes: 4 additions & 0 deletions config/tomlConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,6 +847,9 @@ func TestEnableEpochConfig(t *testing.T) {
# CleanupAuctionOnLowWaitingListEnableEpoch represents the epoch when the cleanup auction on low waiting list is enabled
CleanupAuctionOnLowWaitingListEnableEpoch = 95
# UseGasBoundedShouldFailExecutionEnableEpoch represents the epoch when use bounded gas function should fail execution in case of error
UseGasBoundedShouldFailExecutionEnableEpoch = 96
# MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MaxNodesChangeEnableEpoch = [
{ EpochEnable = 44, MaxNumNodes = 2169, NodesToShufflePerShard = 80 },
Expand Down Expand Up @@ -960,6 +963,7 @@ func TestEnableEpochConfig(t *testing.T) {
CurrentRandomnessOnSortingEnableEpoch: 93,
AlwaysMergeContextsInEEIEnableEpoch: 94,
CleanupAuctionOnLowWaitingListEnableEpoch: 95,
UseGasBoundedShouldFailExecutionEnableEpoch: 96,
MaxNodesChangeEnableEpoch: []MaxNodesChangeConfig{
{
EpochEnable: 44,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require (
github.com/multiversx/mx-chain-scenario-go v1.4.3
github.com/multiversx/mx-chain-storage-go v1.0.15
github.com/multiversx/mx-chain-vm-common-go v1.5.12
github.com/multiversx/mx-chain-vm-go v1.5.29-patch1
github.com/multiversx/mx-chain-vm-go v1.5.29-patch2
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.67
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.68
github.com/multiversx/mx-chain-vm-v1_4-go v1.4.97
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ github.com/multiversx/mx-chain-storage-go v1.0.15 h1:PDyP1uouAVjR32dFgM+7iaQBdRe
github.com/multiversx/mx-chain-storage-go v1.0.15/go.mod h1:GZUK3sqf5onsWS/0ZPWjDCBjAL22FigQPUh252PAVk0=
github.com/multiversx/mx-chain-vm-common-go v1.5.12 h1:Q8F6DE7XhgHtWgg2rozSv4Tv5fE3ENkJz6mjRoAfht8=
github.com/multiversx/mx-chain-vm-common-go v1.5.12/go.mod h1:Sv6iS1okB6gy3HAsW6KHYtAxShNAfepKLtu//AURI8c=
github.com/multiversx/mx-chain-vm-go v1.5.29-patch1 h1:wDrE+ZMoHH+BzG3n4ERUR9Luas2w+GvV6e3w4r9hFw0=
github.com/multiversx/mx-chain-vm-go v1.5.29-patch1/go.mod h1:n0SbVEAhIflreAGi7BnfWg4p4VHh4G8ArbvYQZsZsKQ=
github.com/multiversx/mx-chain-vm-go v1.5.29-patch2 h1:KvTUbtGZmWNr7/b+WT0TlAiXBYtdCvDQoFp8MhWTPPo=
github.com/multiversx/mx-chain-vm-go v1.5.29-patch2/go.mod h1:n0SbVEAhIflreAGi7BnfWg4p4VHh4G8ArbvYQZsZsKQ=
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.67 h1:W0bwj5zXM2JEeOEqfKTZE1ecuSJwTuRZZrl9oircRc0=
github.com/multiversx/mx-chain-vm-v1_2-go v1.2.67/go.mod h1:lrDQWpv1yZHlX6ZgWJsTMxxOkeoVTKLQsl1+mr50Z24=
github.com/multiversx/mx-chain-vm-v1_3-go v1.3.68 h1:px2YHay6BSVheLxb3gdZQX0enlqKzu6frngWEZRtr6g=
Expand Down
50 changes: 0 additions & 50 deletions integrationTests/vm/wasm/wasmvm/mockcontracts/simpleChildSC.go

This file was deleted.

43 changes: 0 additions & 43 deletions integrationTests/vm/wasm/wasmvm/mockcontracts/simpleParentSC.go

This file was deleted.

0 comments on commit 41962f7

Please sign in to comment.