Skip to content

Commit 921d984

Browse files
Cleanup: remove legacy logic around the pre-Sirius era.
1 parent 2c143e9 commit 921d984

File tree

13 files changed

+9
-67
lines changed

13 files changed

+9
-67
lines changed

cmd/rosetta/cli.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@ VERSION:
175175

176176
cliFlagActivationEpochSirius = cli.UintFlag{
177177
Name: "activation-epoch-sirius",
178-
Usage: "Specifies the activation epoch for Sirius release.",
178+
Usage: "Deprecated (not used anymore).",
179179
Required: false,
180-
Value: 1265,
180+
Value: 0,
181181
}
182182

183183
cliFlagActivationEpochSpica = cli.UintFlag{
@@ -253,7 +253,6 @@ type parsedCliFlags struct {
253253
numHistoricalEpochs uint32
254254
shouldHandleContracts bool
255255
configFileCustomCurrencies string
256-
activationEpochSirius uint32
257256
activationEpochSpica uint32
258257
shouldEnablePprofEndpoints bool
259258
}
@@ -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-
activationEpochSirius: uint32(ctx.GlobalUint(cliFlagActivationEpochSirius.Name)),
290288
activationEpochSpica: uint32(ctx.GlobalUint(cliFlagActivationEpochSpica.Name)),
291289
shouldEnablePprofEndpoints: ctx.GlobalBool(cliFlagShouldEnablePprofEndpoints.Name),
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-
ActivationEpochSirius: cliFlags.activationEpochSirius,
8786
ActivationEpochSpica: cliFlags.activationEpochSpica,
8887
})
8988
if err != nil {

server/factory/interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ 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-
IsReleaseSiriusActive(epoch uint32) bool
3938
IsReleaseSpicaActive(epoch uint32) bool
4039
LogDescription()
4140
}

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-
ActivationEpochSirius uint32
5453
ActivationEpochSpica uint32
5554
}
5655

@@ -149,7 +148,6 @@ func CreateNetworkProvider(args ArgsCreateNetworkProvider) (NetworkProvider, err
149148
FirstHistoricalEpoch: args.FirstHistoricalEpoch,
150149
NumHistoricalEpochs: args.NumHistoricalEpochs,
151150
ShouldHandleContracts: args.ShouldHandleContracts,
152-
ActivationEpochSirius: args.ActivationEpochSirius,
153151
ActivationEpochSpica: args.ActivationEpochSpica,
154152

155153
ObserverFacade: &components.ObserverFacade{

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-
ActivationEpochSirius uint32
4746
ActivationEpochSpica uint32
4847

4948
ObserverFacade observerFacade
@@ -67,7 +66,6 @@ type networkProvider struct {
6766
firstHistoricalEpoch uint32
6867
numHistoricalEpochs uint32
6968
shouldHandleContracts bool
70-
activationEpochSirius uint32
7169
activationEpochSpica uint32
7270

7371
observerFacade observerFacade
@@ -109,7 +107,6 @@ func NewNetworkProvider(args ArgsNewNetworkProvider) (*networkProvider, error) {
109107
firstHistoricalEpoch: args.FirstHistoricalEpoch,
110108
numHistoricalEpochs: args.NumHistoricalEpochs,
111109
shouldHandleContracts: args.ShouldHandleContracts,
112-
activationEpochSirius: args.ActivationEpochSirius,
113110
activationEpochSpica: args.ActivationEpochSpica,
114111

115112
observerFacade: args.ObserverFacade,
@@ -476,11 +473,6 @@ func (provider *networkProvider) ComputeTransactionFeeForMoveBalance(tx *transac
476473
return fee
477474
}
478475

479-
// IsReleaseSiriusActive returns whether the Sirius release is active in the provided epoch
480-
func (provider *networkProvider) IsReleaseSiriusActive(epoch uint32) bool {
481-
return epoch >= provider.activationEpochSirius
482-
}
483-
484476
// IsReleaseSpicaActive returns whether the Spica release is active in the provided epoch
485477
func (provider *networkProvider) IsReleaseSpicaActive(epoch uint32) bool {
486478
return epoch >= provider.activationEpochSpica
@@ -499,7 +491,6 @@ func (provider *networkProvider) LogDescription() {
499491
"firstHistoricalEpoch", provider.firstHistoricalEpoch,
500492
"numHistoricalEpochs", provider.numHistoricalEpochs,
501493
"shouldHandleContracts", provider.shouldHandleContracts,
502-
"activationEpochSirius", provider.activationEpochSirius,
503494
"activationEpochSpica", provider.activationEpochSpica,
504495
"nativeCurrency", provider.GetNativeCurrency().Symbol,
505496
"customCurrencies", provider.GetCustomCurrenciesSymbols(),

server/services/interface.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ 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-
IsReleaseSiriusActive(epoch uint32) bool
3837
IsReleaseSpicaActive(epoch uint32) bool
3938
}

server/services/transactionEventsController.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ func (controller *transactionEventsController) extractEventSCDeploy(tx *transact
4545
}
4646

4747
func (controller *transactionEventsController) extractEventTransferValueOnly(tx *transaction.ApiTransactionResult) ([]*eventTransferValueOnly, error) {
48-
if !controller.provider.IsReleaseSiriusActive(tx.Epoch) {
49-
return make([]*eventTransferValueOnly, 0), nil
50-
}
51-
5248
rawEvents := controller.findManyEventsByIdentifier(tx, transactionEventTransferValueOnly)
5349
typedEvents := make([]*eventTransferValueOnly, 0)
5450

server/services/transactionEventsController_test.go

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -206,33 +206,6 @@ func TestTransactionEventsController_ExtractEvents(t *testing.T) {
206206
require.Equal(t, "erd1tn62hjp72rznp8vq0lplva5csav6rccpqqdungpxtqz0g2hcq6uq9k4cc6", events[0].deployerAddress)
207207
})
208208

209-
t.Run("transferValueOnly, before Sirius (not handled at all)", func(t *testing.T) {
210-
topic0 := testscommon.TestContractFooShard0.PubKey
211-
topic1 := testscommon.TestContractBarShard0.PubKey
212-
topic2 := big.NewInt(100).Bytes()
213-
214-
tx := &transaction.ApiTransactionResult{
215-
Epoch: 41,
216-
Logs: &transaction.ApiLogs{
217-
Events: []*transaction.Events{
218-
{
219-
Identifier: "transferValueOnly",
220-
Address: "erd1qqqqqqqqqqqqqpgqmmud45gkr78scw8numnn290dsyzc7z6kq6uqw2jcza",
221-
Topics: [][]byte{
222-
topic0,
223-
topic1,
224-
topic2,
225-
},
226-
},
227-
},
228-
},
229-
}
230-
231-
events, err := controller.extractEventTransferValueOnly(tx)
232-
require.NoError(t, err)
233-
require.Len(t, events, 0)
234-
})
235-
236209
t.Run("transferValueOnly, after Sirius, effective (intra-shard ExecuteOnDestContext)", func(t *testing.T) {
237210
topic0 := big.NewInt(100).Bytes()
238211
topic1 := testscommon.TestContractBarShard0.PubKey

server/services/transactionsTransformer.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,12 @@ func (transformer *transactionsTransformer) normalTxToRosetta(tx *transaction.Ap
200200

201201
transfersValue := isNonZeroAmount(tx.Value)
202202

203-
if transformer.provider.IsReleaseSiriusActive(tx.Epoch) {
204-
// Special handling of:
205-
// - intra-shard contract calls, bearing value, which fail with signal error
206-
// - direct contract deployments, bearing value, which fail with signal error
207-
// For these, the protocol does not generate an explicit SCR with the value refund (before Sirius, in some cases, it did).
208-
// However, since the value remains at the sender, we don't emit any operations in these circumstances.
209-
transfersValue = transfersValue && !transformer.featuresDetector.isContractDeploymentWithSignalErrorOrIntrashardContractCallWithSignalError(tx)
210-
}
203+
// Special handling of:
204+
// - intra-shard contract calls, bearing value, which fail with signal error
205+
// - direct contract deployments, bearing value, which fail with signal error
206+
// For these, the protocol does not generate an explicit SCR with the value refund (before Sirius, in some cases, it did).
207+
// However, since the value remains at the sender, we don't emit any operations in these circumstances.
208+
transfersValue = transfersValue && !transformer.featuresDetector.isContractDeploymentWithSignalErrorOrIntrashardContractCallWithSignalError(tx)
211209

212210
if transfersValue {
213211
operations = append(operations, &types.Operation{

systemtests/check_with_mesh_cli.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def run_rosetta(configuration: Configuration, shard: int):
7575
f"--config-custom-currencies={configuration.config_file_custom_currencies}",
7676
f"--first-historical-epoch={current_epoch}",
7777
f"--num-historical-epochs={configuration.num_historical_epochs}",
78-
f"--activation-epoch-sirius={configuration.activation_epoch_sirius}",
7978
f"--activation-epoch-spica={configuration.activation_epoch_spica}",
8079
"--handle-contracts",
8180
"--pprof"

0 commit comments

Comments
 (0)