Skip to content

Commit 4bba883

Browse files
Refactor VSCode launch configuration by removing the 'showLog' parameter for cleaner setup. Update transaction error handling in tx_load_tool.go to prevent multiple error logs for the same failure, and add a warning for cases with no p2p events received.
1 parent 9891c73 commit 4bba883

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

.vscode/launch.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,15 @@
88
"mode": "auto",
99
"program": "${workspaceFolder}/main.go",
1010
"args": ["--config", ".hack/devnet/generated-assertoor-config.yaml"],
11-
"preLaunchTask": "devnet-setup",
12-
"showLog": true
11+
"preLaunchTask": "devnet-setup"
1312
},
1413
{
1514
"name": "Debug go assertoor",
1615
"type": "go",
1716
"request": "launch",
1817
"mode": "auto",
1918
"program": "${workspaceFolder}/main.go",
20-
"args": ["--config", ".hack/devnet/generated-assertoor-config.yaml"],
21-
"showLog": true
19+
"args": ["--config", ".hack/devnet/generated-assertoor-config.yaml"]
2220
}
2321
]
2422
}

pkg/coordinator/utils/tx_load_tool/tx_load_tool.go

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,12 @@ func (l *Load) Execute() error {
130130
l.Result.TxStartTime[i] = time.Now()
131131
err = l.target.sendTransaction(tx)
132132
if err != nil {
133-
l.target.logger.WithField("client", l.target.client.GetName()).Errorf("Failed to send transaction: %v", err)
134-
l.target.task_ctx.SetResult(types.TaskResultFailure)
135-
l.Result.Failed = true
133+
if !l.Result.Failed {
134+
l.target.logger.WithField("client", l.target.client.GetName()).Errorf("Failed to send transaction: %v", err)
135+
l.target.task_ctx.SetResult(types.TaskResultFailure)
136+
l.Result.Failed = true
137+
}
138+
136139
return
137140
}
138141

@@ -208,6 +211,11 @@ func (l *Load) MeasurePropagationLatencies() (*LoadResult, error) {
208211
return l.Result, fmt.Errorf("measurement stopped: failed reading p2p events")
209212
}
210213

214+
if txes == nil || len(*txes) == 0 {
215+
l.target.logger.Warnf("No p2p events received")
216+
continue
217+
}
218+
211219
for i, tx := range *txes {
212220
tx_data := tx.Data()
213221
// read tx_data that is in the format "tx_index:<index>"

0 commit comments

Comments
 (0)