Skip to content

Commit

Permalink
#5175: include review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Jan 24, 2024
1 parent 9db92a3 commit 4765d52
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).
- We now include metrics for history archive requests ([5166](https://github.com/stellar/go/pull/5166))
- Http history archive requests now include a unique user agent ([5166](https://github.com/stellar/go/pull/5166))
- Added a deprecation warning for using command-line flags when running Horizon ([5051](https://github.com/stellar/go/pull/5051))
- New optional config `DISABLE_SOROBAN_INGEST_PROCESSORS` ([5175](https://github.com/stellar/go/issues/5175)). Defaults to `FALSE`, when `TRUE` and a soroban transaction is ingested, the following will occur:
- New optional config `DISABLE_SOROBAN_INGEST` ([5175](https://github.com/stellar/go/issues/5175)). Defaults to `FALSE`, when `TRUE` and a soroban transaction is ingested, the following will occur:
* no effects will be generated for contract invocations.
* history_transactions.tx_meta column will have serialized xdr that equates to an empty `xdr.TransactionMeta.V3`, `Operations`, `TxChangesAfter`, `TxChangesBefore` will empty arrays and `SorobanMeta` will be nil.
* API transaction model for `result_meta_xdr` will have same empty serialized xdr for `xdr.TransactionMeta.V3`, `Operations`, `TxChangesAfter`, `TxChangesBefore` will empty arrays and `SorobanMeta` will be nil.
Expand Down
2 changes: 1 addition & 1 deletion services/horizon/internal/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const (
// DisableTxSubFlagName is the command line flag for disabling transaction submission feature of Horizon
DisableTxSubFlagName = "disable-tx-sub"
// SkipSorobanIngestionFlagName is the command line flag for disabling Soroban related ingestion processing
SkipSorobanIngestionFlagName = "disable-soroban-ingest-processors"
SkipSorobanIngestionFlagName = "disable-soroban-ingest"

// StellarPubnet is a constant representing the Stellar public network
StellarPubnet = "pubnet"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (p *EffectProcessor) ProcessTransaction(

if p.skipSoroban &&
elidedTransaction.UnsafeMeta.V == 3 &&
elidedTransaction.UnsafeMeta.MustV3().SorobanMeta != nil {
elidedTransaction.UnsafeMeta.V3.SorobanMeta != nil {
elidedTransaction.UnsafeMeta.V3 = &xdr.TransactionMetaV3{
Ext: xdr.ExtensionPoint{},
TxChangesBefore: xdr.LedgerEntryChanges{},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (operation *transactionOperationWrapper) IsPayment() bool {
return true
case xdr.OperationTypeInvokeHostFunction:
// #5175, may want to consider skipping this parsing of payment from contracts
// as part of eliding soroban ingestion aspects when DISABLE_SOROBAN_INGEST_PROCESSORS.
// as part of eliding soroban ingestion aspects when DISABLE_SOROBAN_INGEST.
// but, may cause inconsistencies that aren't worth the gain,
// as payments won't be thoroughly accurate, i.e. a payment could have
// happened within a contract invoke.
Expand Down Expand Up @@ -699,14 +699,14 @@ func (operation *transactionOperationWrapper) Details() (map[string]interface{},

var balanceChanges []map[string]interface{}
var parseErr error
if !operation.skipSorobanDetails {
if operation.skipSorobanDetails {
// https://github.com/stellar/go/issues/5175

Check failure on line 703 in services/horizon/internal/ingest/processors/operations_processor.go

View workflow job for this annotation

GitHub Actions / golangci

File is not `gofmt`-ed with `-s` (gofmt)
// intentionally toggle off parsing soroban meta into "asset_balance_changes"
balanceChanges = make([]map[string]interface{}, 0)
} else {
if balanceChanges, parseErr = operation.parseAssetBalanceChangesFromContractEvents(); parseErr != nil {
return nil, parseErr
}
} else {
// https://github.com/stellar/go/issues/5175
// intentionally toggle off parsing soroban meta into "asset_balance_changes"
balanceChanges = make([]map[string]interface{}, 0)
}
details["asset_balance_changes"] = balanceChanges

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func CaseContractInvokeHostFunctionInstallContract(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -113,7 +113,7 @@ func CaseContractInvokeHostFunctionCreateContractByAddress(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -170,7 +170,7 @@ func CaseContractInvokeHostFunctionInvokeStatelessContractFn(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -284,7 +284,7 @@ func CaseContractInvokeHostFunctionInvokeStatefulContractFn(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down
20 changes: 10 additions & 10 deletions services/horizon/internal/integration/sac_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func CaseContractMintToAccount(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban),
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban),
},
EnableSorobanRPC: true,
})
Expand Down Expand Up @@ -240,7 +240,7 @@ func CaseContractMintToContract(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -338,7 +338,7 @@ func CaseExpirationAndRestoration(t *testing.T) {
// a fake asset contract in the horizon db and we don't
// want state verification to detect this
"ingest-disable-state-verification": "true",
"disable-soroban-ingest-processors": fmt.Sprint(DisabledSoroban),
"disable-soroban-ingest": fmt.Sprint(DisabledSoroban),

Check failure on line 341 in services/horizon/internal/integration/sac_test.go

View workflow job for this annotation

GitHub Actions / golangci

File is not `gofmt`-ed with `-s` (gofmt)
},
})

Expand Down Expand Up @@ -579,7 +579,7 @@ func CaseContractTransferBetweenAccounts(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -662,7 +662,7 @@ func CaseContractTransferBetweenAccountAndContract(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -800,7 +800,7 @@ func CaseContractTransferBetweenContracts(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -891,7 +891,7 @@ func CaseContractBurnFromAccount(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -975,7 +975,7 @@ func CaseContractBurnFromContract(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -1050,7 +1050,7 @@ func CaseContractClawbackFromAccount(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down Expand Up @@ -1136,7 +1136,7 @@ func CaseContractClawbackFromContract(t *testing.T) {
itest := integration.NewTest(t, integration.Config{
ProtocolVersion: 20,
HorizonEnvironment: map[string]string{
"DISABLE_SOROBAN_INGEST_PROCESSORS": fmt.Sprint(DisabledSoroban)},
"DISABLE_SOROBAN_INGEST": fmt.Sprint(DisabledSoroban)},
EnableSorobanRPC: true,
})

Expand Down

0 comments on commit 4765d52

Please sign in to comment.