Skip to content
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

Link inner txs to results #6529

Open
wants to merge 13 commits into
base: rc/v1.7.next1
Choose a base branch
from
8 changes: 3 additions & 5 deletions cmd/node/config/enableEpochs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -325,16 +325,14 @@
UnJailCleanupEnableEpoch = 4

# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions V3 will be enabled
RelayedTransactionsV3EnableEpoch = 7
RelayedTransactionsV3EnableEpoch = 4

# FixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost will be enabled
FixRelayedBaseCostEnableEpoch = 7
# LinkInnerTransactionEnableEpoch represents the epoch when the inner transactions of relayed V3 will be linked to results
LinkInnerTransactionEnableEpoch = 4

# MultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign cross chain opcodes are enabled
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 9999999

# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 7

# BLSMultiSignerEnableEpoch represents the activation epoch for different types of BLS multi-signers
BLSMultiSignerEnableEpoch = [
Expand Down
10 changes: 3 additions & 7 deletions common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,9 +498,6 @@ const (
// MetricRelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions v3 is enabled
MetricRelayedTransactionsV3EnableEpoch = "erd_relayed_transactions_v3_enable_epoch"

// MetricFixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost is enabled
MetricFixRelayedBaseCostEnableEpoch = "erd_fix_relayed_base_cost_enable_epoch"

// MetricUnbondTokensV2EnableEpoch represents the epoch when the unbond tokens v2 is applied
MetricUnbondTokensV2EnableEpoch = "erd_unbond_tokens_v2_enable_epoch"

Expand Down Expand Up @@ -737,8 +734,8 @@ const (
// MetricMultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign opcodes are enabled
MetricMultiESDTNFTTransferAndExecuteByUserEnableEpoch = "erd_multi_esdt_transfer_execute_by_user_enable_epoch"

// MetricFixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non-payable sc is enabled
MetricFixRelayedMoveBalanceToNonPayableSCEnableEpoch = "erd_fix_relayed_move_balance_to_non_payable_sc_enable_epoch"
// MetricLinkInnerTransactionEnableEpoch represents the epoch when the inner transactions are linked to the results
MetricLinkInnerTransactionEnableEpoch = "erd_link_inner_transaction_enable_epoch"

// MetricMaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MetricMaxNodesChangeEnableEpoch = "erd_max_nodes_change_enable_epoch"
Expand Down Expand Up @@ -1235,8 +1232,7 @@ const (
CryptoOpcodesV2Flag core.EnableEpochFlag = "CryptoOpcodesV2Flag"
UnJailCleanupFlag core.EnableEpochFlag = "UnJailCleanupFlag"
RelayedTransactionsV3Flag core.EnableEpochFlag = "RelayedTransactionsV3Flag"
FixRelayedBaseCostFlag core.EnableEpochFlag = "FixRelayedBaseCostFlag"
MultiESDTNFTTransferAndExecuteByUserFlag core.EnableEpochFlag = "MultiESDTNFTTransferAndExecuteByUserFlag"
FixRelayedMoveBalanceToNonPayableSCFlag core.EnableEpochFlag = "FixRelayedMoveBalanceToNonPayableSCFlag"
LinkInnerTransactionFlag core.EnableEpochFlag = "LinkInnerTransactionFlag"
// all new flags must be added to createAllFlagsMap method, as part of enableEpochsHandler allFlagsDefined
)
12 changes: 3 additions & 9 deletions common/enablers/enableEpochsHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,23 +768,17 @@ func (handler *enableEpochsHandler) createAllFlagsMap() {
},
activationEpoch: handler.enableEpochsConfig.RelayedTransactionsV3EnableEpoch,
},
common.FixRelayedBaseCostFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.FixRelayedBaseCostEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.FixRelayedBaseCostEnableEpoch,
},
common.MultiESDTNFTTransferAndExecuteByUserFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.MultiESDTNFTTransferAndExecuteByUserEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.MultiESDTNFTTransferAndExecuteByUserEnableEpoch,
},
common.FixRelayedMoveBalanceToNonPayableSCFlag: {
common.LinkInnerTransactionFlag: {
isActiveInEpoch: func(epoch uint32) bool {
return epoch >= handler.enableEpochsConfig.FixRelayedMoveBalanceToNonPayableSCEnableEpoch
return epoch >= handler.enableEpochsConfig.LinkInnerTransactionEnableEpoch
},
activationEpoch: handler.enableEpochsConfig.FixRelayedMoveBalanceToNonPayableSCEnableEpoch,
activationEpoch: handler.enableEpochsConfig.LinkInnerTransactionEnableEpoch,
},
}
}
Expand Down
13 changes: 5 additions & 8 deletions common/enablers/enableEpochsHandler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,9 @@ func createEnableEpochsConfig() config.EnableEpochs {
EGLDInMultiTransferEnableEpoch: 103,
CryptoOpcodesV2EnableEpoch: 104,
RelayedTransactionsV3EnableEpoch: 105,
FixRelayedBaseCostEnableEpoch: 106,
MultiESDTNFTTransferAndExecuteByUserEnableEpoch: 107,
FixRelayedMoveBalanceToNonPayableSCEnableEpoch: 108,
UseGasBoundedShouldFailExecutionEnableEpoch: 110,
MultiESDTNFTTransferAndExecuteByUserEnableEpoch: 106,
LinkInnerTransactionEnableEpoch: 107,
UseGasBoundedShouldFailExecutionEnableEpoch: 108,
}
}

Expand Down Expand Up @@ -325,8 +324,7 @@ func TestEnableEpochsHandler_IsFlagEnabled(t *testing.T) {
require.True(t, handler.IsFlagEnabled(common.AlwaysMergeContextsInEEIFlag))
require.True(t, handler.IsFlagEnabled(common.DynamicESDTFlag))
require.True(t, handler.IsFlagEnabled(common.RelayedTransactionsV3Flag))
require.True(t, handler.IsFlagEnabled(common.FixRelayedBaseCostFlag))
require.True(t, handler.IsFlagEnabled(common.FixRelayedMoveBalanceToNonPayableSCFlag))
require.True(t, handler.IsFlagEnabled(common.LinkInnerTransactionFlag))
}

func TestEnableEpochsHandler_GetActivationEpoch(t *testing.T) {
Expand Down Expand Up @@ -448,9 +446,8 @@ func TestEnableEpochsHandler_GetActivationEpoch(t *testing.T) {
require.Equal(t, cfg.EGLDInMultiTransferEnableEpoch, handler.GetActivationEpoch(common.EGLDInESDTMultiTransferFlag))
require.Equal(t, cfg.CryptoOpcodesV2EnableEpoch, handler.GetActivationEpoch(common.CryptoOpcodesV2Flag))
require.Equal(t, cfg.RelayedTransactionsV3EnableEpoch, handler.GetActivationEpoch(common.RelayedTransactionsV3Flag))
require.Equal(t, cfg.FixRelayedBaseCostEnableEpoch, handler.GetActivationEpoch(common.FixRelayedBaseCostFlag))
require.Equal(t, cfg.MultiESDTNFTTransferAndExecuteByUserEnableEpoch, handler.GetActivationEpoch(common.MultiESDTNFTTransferAndExecuteByUserFlag))
require.Equal(t, cfg.FixRelayedMoveBalanceToNonPayableSCEnableEpoch, handler.GetActivationEpoch(common.FixRelayedMoveBalanceToNonPayableSCFlag))
require.Equal(t, cfg.LinkInnerTransactionEnableEpoch, handler.GetActivationEpoch(common.LinkInnerTransactionFlag))
}

func TestEnableEpochsHandler_IsInterfaceNil(t *testing.T) {
Expand Down
3 changes: 1 addition & 2 deletions config/epochConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,8 @@ type EnableEpochs struct {
CryptoOpcodesV2EnableEpoch uint32
UnJailCleanupEnableEpoch uint32
RelayedTransactionsV3EnableEpoch uint32
FixRelayedBaseCostEnableEpoch uint32
MultiESDTNFTTransferAndExecuteByUserEnableEpoch uint32
FixRelayedMoveBalanceToNonPayableSCEnableEpoch uint32
LinkInnerTransactionEnableEpoch uint32
BLSMultiSignerEnableEpoch []MultiSignerConfig
}

Expand Down
14 changes: 5 additions & 9 deletions config/tomlConfig_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -878,14 +878,11 @@ func TestEnableEpochConfig(t *testing.T) {
# RelayedTransactionsV3EnableEpoch represents the epoch when the relayed transactions V3 will be enabled
RelayedTransactionsV3EnableEpoch = 99

# FixRelayedBaseCostEnableEpoch represents the epoch when the fix for relayed base cost will be enabled
FixRelayedBaseCostEnableEpoch = 100

# MultiESDTNFTTransferAndExecuteByUserEnableEpoch represents the epoch when enshrined sovereign cross chain opcodes are enabled
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 101
MultiESDTNFTTransferAndExecuteByUserEnableEpoch = 100

# FixRelayedMoveBalanceToNonPayableSCEnableEpoch represents the epoch when the fix for relayed move balance to non payable sc will be enabled
FixRelayedMoveBalanceToNonPayableSCEnableEpoch = 102
# LinkInnerTransactionEnableEpoch represents the epoch when the inner transactions of relayed V3 will be linked to results
LinkInnerTransactionEnableEpoch = 101

# MaxNodesChangeEnableEpoch holds configuration for changing the maximum number of nodes and the enabling epoch
MaxNodesChangeEnableEpoch = [
Expand Down Expand Up @@ -1005,9 +1002,8 @@ func TestEnableEpochConfig(t *testing.T) {
EGLDInMultiTransferEnableEpoch: 97,
CryptoOpcodesV2EnableEpoch: 98,
RelayedTransactionsV3EnableEpoch: 99,
FixRelayedBaseCostEnableEpoch: 100,
MultiESDTNFTTransferAndExecuteByUserEnableEpoch: 101,
FixRelayedMoveBalanceToNonPayableSCEnableEpoch: 102,
MultiESDTNFTTransferAndExecuteByUserEnableEpoch: 100,
LinkInnerTransactionEnableEpoch: 101,
MaxNodesChangeEnableEpoch: []MaxNodesChangeConfig{
{
EpochEnable: 44,
Expand Down
1 change: 1 addition & 0 deletions factory/api/apiResolverFactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ func CreateApiResolver(args *ApiResolverArgs) (facade.ApiResolver, error) {
DataFieldParser: dataFieldParser,
TxMarshaller: args.CoreComponents.TxMarshalizer(),
EnableEpochsHandler: args.CoreComponents.EnableEpochsHandler(),
Hasher: args.CoreComponents.Hasher(),
}
apiTransactionProcessor, err := transactionAPI.NewAPITransactionProcessor(argsAPITransactionProc)
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ require (
github.com/klauspost/cpuid/v2 v2.2.5
github.com/mitchellh/mapstructure v1.5.0
github.com/multiversx/mx-chain-communication-go v1.1.0
github.com/multiversx/mx-chain-core-go v1.2.22
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241010094929-2bbea4371d73
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do not forget the proper release

github.com/multiversx/mx-chain-crypto-go v1.2.12
github.com/multiversx/mx-chain-es-indexer-go v1.7.9
github.com/multiversx/mx-chain-es-indexer-go v1.7.10-0.20241007132117-9e25a5f84d3d
github.com/multiversx/mx-chain-logger-go v1.0.15
github.com/multiversx/mx-chain-scenario-go v1.4.4
github.com/multiversx/mx-chain-storage-go v1.0.16
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -387,12 +387,12 @@ github.com/multiversx/concurrent-map v0.1.4 h1:hdnbM8VE4b0KYJaGY5yJS2aNIW9TFFsUY
github.com/multiversx/concurrent-map v0.1.4/go.mod h1:8cWFRJDOrWHOTNSqgYCUvwT7c7eFQ4U2vKMOp4A/9+o=
github.com/multiversx/mx-chain-communication-go v1.1.0 h1:J7bX6HoN3HiHY7cUeEjG8AJWgQDDPcY+OPDOsSUOkRE=
github.com/multiversx/mx-chain-communication-go v1.1.0/go.mod h1:WK6bP4pGEHGDDna/AYRIMtl6G9OA0NByI1Lw8PmOnRM=
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-core-go v1.2.23-0.20241010094929-2bbea4371d73 h1:+pnMCOuqq3kbGB+vBfzKebPOe1WVOVEHIfyEbgGnNt0=
github.com/multiversx/mx-chain-core-go v1.2.23-0.20241010094929-2bbea4371d73/go.mod h1:B5zU4MFyJezmEzCsAHE9YNULmGCm2zbPHvl9hazNxmE=
github.com/multiversx/mx-chain-crypto-go v1.2.12 h1:zWip7rpUS4CGthJxfKn5MZfMfYPjVjIiCID6uX5BSOk=
github.com/multiversx/mx-chain-crypto-go v1.2.12/go.mod h1:HzcPpCm1zanNct/6h2rIh+MFrlXbjA5C8+uMyXj3LI4=
github.com/multiversx/mx-chain-es-indexer-go v1.7.9 h1:rWq9phJu8GG6TtoJ5cL+MmhyReWCEyqBE5ymXUvudCg=
github.com/multiversx/mx-chain-es-indexer-go v1.7.9/go.mod h1:oGcRK2E3Syv6vRTszWrrb/TqD8akq0yeoMr1wPPiTO4=
github.com/multiversx/mx-chain-es-indexer-go v1.7.10-0.20241007132117-9e25a5f84d3d h1:QzzAdWFcn1hpRdqvJIr8CBV3ZEc8pA0N1+ixbeCqOFg=
github.com/multiversx/mx-chain-es-indexer-go v1.7.10-0.20241007132117-9e25a5f84d3d/go.mod h1:oGcRK2E3Syv6vRTszWrrb/TqD8akq0yeoMr1wPPiTO4=
github.com/multiversx/mx-chain-logger-go v1.0.15 h1:HlNdK8etyJyL9NQ+6mIXyKPEBo+wRqOwi3n+m2QIHXc=
github.com/multiversx/mx-chain-logger-go v1.0.15/go.mod h1:t3PRKaWB1M+i6gUfD27KXgzLJJC+mAQiN+FLlL1yoGQ=
github.com/multiversx/mx-chain-scenario-go v1.4.4 h1:DVE2V+FPeyD/yWoC+KEfPK3jsFzHeruelESfpTlf460=
Expand Down
Loading
Loading