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

Enable diagnostic events #229

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker/stellar-core.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# see https://developers.stellar.org/docs/run-core-node/
# for how to properly configure your environment

ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true

#FAILURE_SAFETY is minimum number of nodes that are allowed to fail before you no longer have quorum
FAILURE_SAFETY=1

Expand Down
2 changes: 2 additions & 0 deletions docker/stellar-core_futurenet.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ PUBLIC_HTTP_PORT=false

NETWORK_PASSPHRASE="Test SDF Future Network ; October 2022"

ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true

# DATABASE="sqlite3://stellar.db"
PEER_PORT=11725

Expand Down
2 changes: 2 additions & 0 deletions docker/stellar-core_testnet.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ NETWORK_PASSPHRASE="Test SDF Network ; September 2015"

# DATABASE="sqlite3://stellar.db"

ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true

# Stellar Testnet validators
[[HOME_DOMAINS]]
HOME_DOMAIN="testnet.stellar.org"
Expand Down
20 changes: 5 additions & 15 deletions internal/transform/diagnostic_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,24 @@ func TransformDiagnosticEvent(transaction ingest.LedgerTransaction, lhe xdr.Ledg
return []DiagnosticEventOutput{}, fmt.Errorf("for ledger %d; transaction %d (transaction id=%d): %v", outputLedgerSequence, transactionIndex, outputTransactionID, err), false
}

transactionMeta, ok := transaction.UnsafeMeta.GetV3()
if !ok {
return []DiagnosticEventOutput{}, nil, false
}

if transactionMeta.SorobanMeta == nil {
diagnosticEvents, err := transaction.GetDiagnosticEvents()
if err != nil {
return []DiagnosticEventOutput{}, nil, false
}

var transformedDiagnosticEvents []DiagnosticEventOutput

for _, diagnoticEvent := range transactionMeta.SorobanMeta.DiagnosticEvents {
for _, diagnoticEvent := range diagnosticEvents {
var outputContractId string

outputInSuccessfulContractCall := diagnoticEvent.InSuccessfulContractCall
event := diagnoticEvent.Event
outputExtV := event.Ext.V
outputType := event.Type.String()
outputBodyV := event.Body.V
body, ok := event.Body.GetV0()
if !ok {
continue
}
body, _ := event.Body.GetV0()

outputBody, err := xdr.MarshalBase64(body)
if err != nil {
continue
}
outputBody, _ := xdr.MarshalBase64(body)

if event.ContractId != nil {
contractId := *event.ContractId
Expand Down
Loading