Skip to content

Commit 998fdc2

Browse files
Merge pull request #138 from multiversx/update-system-tests-09
Test legacy relayed V1 & V2 before and after de-activation. Removed some dead code, as well.
2 parents 2de766a + 26e46e5 commit 998fdc2

18 files changed

+218
-185
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ Optional: generate sample data (transactions):
252252
```
253253
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py setup --network testnet
254254
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run --network testnet
255+
PYTHONPATH=. python3 ./systemtests/generate_testdata_on_network.py run-for-relayed-v1-v2 --network testnet
255256
```
256257

257258
Run the checks:

cmd/rosetta/cli.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ VERSION:
182182
}
183183

184184
cliFlagActivationEpochSpica = cli.UintFlag{
185-
Name: "activation-epoch-spica",
186-
Usage: "Specifies the activation epoch for Spica release.",
187-
Required: false,
188-
Value: 1575,
185+
Name: "activation-epoch-spica",
186+
Usage: "Deprecated (not used anymore).",
187+
Hidden: true,
188+
Value: 0,
189189
}
190190

191191
cliFlagShouldEnablePprofEndpoints = cli.BoolFlag{
@@ -254,7 +254,6 @@ type parsedCliFlags struct {
254254
numHistoricalEpochs uint32
255255
shouldHandleContracts bool
256256
configFileCustomCurrencies string
257-
activationEpochSpica uint32
258257
shouldEnablePprofEndpoints bool
259258
}
260259

@@ -286,7 +285,6 @@ func getParsedCliFlags(ctx *cli.Context) parsedCliFlags {
286285
numHistoricalEpochs: uint32(ctx.GlobalUint(cliFlagNumHistoricalEpochs.Name)),
287286
shouldHandleContracts: ctx.GlobalBool(cliFlagShouldHandleContracts.Name),
288287
configFileCustomCurrencies: ctx.GlobalString(cliFlagConfigFileCustomCurrencies.Name),
289-
activationEpochSpica: uint32(ctx.GlobalUint(cliFlagActivationEpochSpica.Name)),
290288
shouldEnablePprofEndpoints: ctx.GlobalBool(cliFlagShouldEnablePprofEndpoints.Name),
291289
}
292290
}

cmd/rosetta/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ func startRosetta(ctx *cli.Context) error {
8383
FirstHistoricalEpoch: cliFlags.firstHistoricalEpoch,
8484
NumHistoricalEpochs: cliFlags.numHistoricalEpochs,
8585
ShouldHandleContracts: cliFlags.shouldHandleContracts,
86-
ActivationEpochSpica: cliFlags.activationEpochSpica,
8786
})
8887
if err != nil {
8988
return err

requirements-dev.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
multiversx_sdk==1.6.2
1+
# We'll stay on the old version of the SDKs up until ~Supernova (on the purpose of testing the removal of relayed V1 and V2).
2+
multiversx_sdk==1.6.3
23
requests>=2.32.0,<3.0.0

server/factory/interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,5 @@ type NetworkProvider interface {
3535
ComputeReceiptHash(apiReceipt *transaction.ApiReceipt) (string, error)
3636
ComputeTransactionFeeForMoveBalance(tx *transaction.ApiTransactionResult) *big.Int
3737
GetMempoolTransactionByHash(hash string) (*transaction.ApiTransactionResult, error)
38-
IsReleaseSpicaActive(epoch uint32) bool
3938
LogDescription()
4039
}

server/factory/provider.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ type ArgsCreateNetworkProvider struct {
5050
FirstHistoricalEpoch uint32
5151
NumHistoricalEpochs uint32
5252
ShouldHandleContracts bool
53-
ActivationEpochSpica uint32
5453
}
5554

5655
// CreateNetworkProvider creates a network provider
@@ -148,7 +147,6 @@ func CreateNetworkProvider(args ArgsCreateNetworkProvider) (NetworkProvider, err
148147
FirstHistoricalEpoch: args.FirstHistoricalEpoch,
149148
NumHistoricalEpochs: args.NumHistoricalEpochs,
150149
ShouldHandleContracts: args.ShouldHandleContracts,
151-
ActivationEpochSpica: args.ActivationEpochSpica,
152150

153151
ObserverFacade: &components.ObserverFacade{
154152
Processor: baseProcessor,

server/provider/networkProvider.go

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ type ArgsNewNetworkProvider struct {
4343
FirstHistoricalEpoch uint32
4444
NumHistoricalEpochs uint32
4545
ShouldHandleContracts bool
46-
ActivationEpochSpica uint32
4746

4847
ObserverFacade observerFacade
4948

@@ -66,7 +65,6 @@ type networkProvider struct {
6665
firstHistoricalEpoch uint32
6766
numHistoricalEpochs uint32
6867
shouldHandleContracts bool
69-
activationEpochSpica uint32
7068

7169
observerFacade observerFacade
7270

@@ -107,7 +105,6 @@ func NewNetworkProvider(args ArgsNewNetworkProvider) (*networkProvider, error) {
107105
firstHistoricalEpoch: args.FirstHistoricalEpoch,
108106
numHistoricalEpochs: args.NumHistoricalEpochs,
109107
shouldHandleContracts: args.ShouldHandleContracts,
110-
activationEpochSpica: args.ActivationEpochSpica,
111108

112109
observerFacade: args.ObserverFacade,
113110

@@ -473,11 +470,6 @@ func (provider *networkProvider) ComputeTransactionFeeForMoveBalance(tx *transac
473470
return fee
474471
}
475472

476-
// IsReleaseSpicaActive returns whether the Spica release is active in the provided epoch
477-
func (provider *networkProvider) IsReleaseSpicaActive(epoch uint32) bool {
478-
return epoch >= provider.activationEpochSpica
479-
}
480-
481473
// LogDescription writes a description of the network provider in the log output
482474
func (provider *networkProvider) LogDescription() {
483475
log.Info("Description of network provider",
@@ -491,7 +483,6 @@ func (provider *networkProvider) LogDescription() {
491483
"firstHistoricalEpoch", provider.firstHistoricalEpoch,
492484
"numHistoricalEpochs", provider.numHistoricalEpochs,
493485
"shouldHandleContracts", provider.shouldHandleContracts,
494-
"activationEpochSpica", provider.activationEpochSpica,
495486
"nativeCurrency", provider.GetNativeCurrency().Symbol,
496487
"customCurrencies", provider.GetCustomCurrenciesSymbols(),
497488
)

server/services/interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ type NetworkProvider interface {
3434
ComputeReceiptHash(apiReceipt *transaction.ApiReceipt) (string, error)
3535
ComputeTransactionFeeForMoveBalance(tx *transaction.ApiTransactionResult) *big.Int
3636
GetMempoolTransactionByHash(hash string) (*transaction.ApiTransactionResult, error)
37-
IsReleaseSpicaActive(epoch uint32) bool
3837
}

server/services/transactionEventsController_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,6 @@ func TestTransactionEventsController_ExtractEvents(t *testing.T) {
176176
networkProvider := testscommon.NewNetworkProviderMock()
177177
controller := newTransactionEventsController(networkProvider)
178178

179-
networkProvider.MockActivationEpochSirius = 42
180-
181179
t.Run("SCDeploy", func(t *testing.T) {
182180
topic0, _ := hex.DecodeString("00000000000000000500def8dad1161f8f0c38f3e6e73515ed81058f0b5606b8")
183181
topic1, _ := hex.DecodeString("5cf4abc83e50c5309d807fc3f676988759a1e301001bc9a0265804f42af806b8")

server/services/transactionsFeaturesDetector.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,21 +77,6 @@ func (detector *transactionsFeaturesDetector) isInvalidTransactionOfTypeMoveBala
7777
return withSendingValueToNonPayableContract || withMetaTransactionIsInvalid
7878
}
7979

80-
func (detector *transactionsFeaturesDetector) isRelayedV1TransactionCompletelyIntrashardWithSignalError(tx *transaction.ApiTransactionResult, innerTx *innerTransactionOfRelayedV1) bool {
81-
innerTxSenderShard := detector.networkProvider.ComputeShardIdOfPubKey(innerTx.SenderPubKey)
82-
innerTxReceiverShard := detector.networkProvider.ComputeShardIdOfPubKey(innerTx.ReceiverPubKey)
83-
84-
isCompletelyIntrashard := tx.SourceShard == tx.DestinationShard &&
85-
innerTxSenderShard == innerTxReceiverShard &&
86-
innerTxSenderShard == tx.SourceShard
87-
if !isCompletelyIntrashard {
88-
return false
89-
}
90-
91-
isWithSignalError := detector.eventsController.hasAnySignalError(tx)
92-
return isWithSignalError
93-
}
94-
9580
func (detector *transactionsFeaturesDetector) isContractDeploymentWithSignalErrorOrIntrashardContractCallWithSignalError(tx *transaction.ApiTransactionResult) bool {
9681
return detector.isContractDeploymentWithSignalError(tx) || (detector.isIntrashard(tx) && detector.isContractCallWithSignalError(tx))
9782
}

0 commit comments

Comments
 (0)