base / base/transaction-latency

writeToFile fails after a full run if ./data does not exist

Open Beginner friendly
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15
Forks
11
PR merge metrics
No merged PRs in 30d

Description

### Summary

The latency runner writes its final CSV files under `./data`, but nothing creates that directory for native runs. The documented Docker flow hides this because the bind mount can create the host directory, but running the binary directly can complete the full transaction-sampling run and then fail at the final `os.Create` call.

### Code path

`main.go` writes results with paths such as:

```go
writeToFile(fmt.Sprintf("./data/flashblocks-%s.csv", region), flashblockTimings)
writeToFile(fmt.Sprintf("./data/base-%s.csv", region), baseTimings)
```

`writeToFile` currently calls `os.Create(filename)` directly, so a missing parent directory causes `open ./data/...: no such file or directory`.

### Expected behavior

The runner should create the output directory before writing CSV results so a native run does not discard all collected samples at the very end.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in main.go at writeToFile and inspect the existing os.Create calls for the ./data CSV paths. Run the native transaction-sampling flow with no data directory, then verify that the run completes and the expected CSV files are written under ./data.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
82/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.