Skip to content

chore: using v0.20.0 tag of tastora and removing temporary duplication#3326

Merged
tac0turtle merged 4 commits into
mainfrom
cian/use-tastora-spamoor
May 18, 2026
Merged

chore: using v0.20.0 tag of tastora and removing temporary duplication#3326
tac0turtle merged 4 commits into
mainfrom
cian/use-tastora-spamoor

Conversation

@chatton
Copy link
Copy Markdown
Contributor

@chatton chatton commented May 18, 2026

Overview

There was some temporary duplication of code that lives in tastora due to it not being included in a correct tag, this is now included and can be removed.

Summary by CodeRabbit

  • Chores
    • Upgraded Go toolchain from 1.25.7 to 1.25.8 across all modules.
    • Updated dependencies for improved stability and performance.
    • Refactored internal test infrastructure for better maintainability.

Review Change Stack

chatton added 2 commits May 14, 2026 14:33
Replace local spamoor_node.go and victoriatraces_node.go with tastora's
spamoor.NewNodeBuilder and victoriatraces.New. Fixes macOS compatibility
by replacing 0.0.0.0 with 127.0.0.1 for external endpoints and using
UTC timestamps in trace query URLs to avoid broken timezone offsets.
Remove the local filesystem replace directive for tastora in
test/e2e/go.mod now that v0.20.0 is published.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

This PR consolidates a Go toolchain upgrade (1.25.7 → 1.25.8) across all modules with a significant refactoring of the benchmark infrastructure. Custom Docker lifecycle implementations for VictoriaTraces and Spamoor nodes are removed and replaced with external library constructors. The suite and trace query methods are updated to handle new URL patterns and resource extraction logic.

Changes

Benchmark Infrastructure Upgrade and Refactoring

Layer / File(s) Summary
Go toolchain and dependency version updates
apps/evm/go.mod, apps/grpc/go.mod, apps/testapp/go.mod, execution/evm/go.mod, execution/evm/test/go.mod, go.mod, test/docker-e2e/go.mod, test/e2e/go.mod
Go version uniformly bumped from 1.25.7 to 1.25.8 across all modules; tastora updated to v0.20.0 in test modules; klauspost/compress upgraded to v1.18.5; aws-sdk-go-base/v2 added; dependency declarations reorganized to mark containerd/errdefs and moby/moby packages as indirect in test/e2e/go.mod.
Integrate external VictoriaTraces and Spamoor constructors in benchmark suite
test/e2e/benchmark/suite_test.go
Replaced custom newSpamoorNodeBuilder with spamoor.NewNodeBuilder in both local and external test setups; switched victoriaTracesNode custom implementation to victoriatraces.New with explicit victoriatraces.Config wiring logger and shared Docker client/network; added endpoint URL rewriting logic to convert 0.0.0.0 addresses to 127.0.0.1 for OTLP and VictoriaTraces query endpoints; updated imports to include strings package.
Refactor trace query and resource attribute extraction
test/e2e/benchmark/traces.go
Updated victoriaTraceProvider.uiURL to use queryURL directly without trailing-slash trimming; refactored fetchLogStream to build URLs without intermediate trimmed bases and emit start/end timestamps in UTC RFC3339Nano format; refactored fetchResourceAttrs to stream via fetchLogStream and scan JSON lines for attributes instead of using single limit=1 query; refactored extractResourceAttrs to unmarshal JSON once into a map and extract multiple OTEL resource attributes via a shared lookup closure.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • evstack/ev-node#3296: Both PRs modify test/e2e/benchmark/spamoor_node.go—this PR removes the custom implementation while #3296 adds a new one, indicating a direct file/class overlap.
  • evstack/ev-node#3157: Both PRs refactor the test/e2e/benchmark tracing harness around VictoriaTraces integration—suite wiring, traces.go query methods, and node implementations—so changes directly overlap.

Suggested reviewers

  • alpe
  • tac0turtle

Poem

🐇 Hoppy refactoring, ears held high!
Custom nodes out, new builders fly.
VictoriaTraces shines so bright,
Go 1.25.8 gets it right!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The PR description provides a clear overview of the changes, explaining the context (temporary duplication), the goal (use tastora v0.20.0 tag), and the rationale (code now available in library).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The PR title accurately describes the main changes: upgrading tastora to v0.20.0 and removing duplicated code (spamoor_node.go and victoriatraces_node.go).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cian/use-tastora-spamoor

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 18, 2026

Claude finished @chatton's task in 1m 10s —— View job


Code Review

  • Read AGENTS.md and project guidelines
  • Analyze changed files
  • Review test/e2e/benchmark/traces.go
  • Review test/e2e/benchmark/suite_test.go
  • Review go.mod dependency changes
  • Post final review

This is a clean, well-scoped refactoring PR. Removing ~510 lines of duplicated Docker lifecycle code in favor of tastora's upstream implementations is the right call. A few observations below.

Summary

The main changes are:

  1. Deleted spamoor_node.go (368 lines) and victoriatraces_node.go (142 lines) — replaced by spamoor.NewNodeBuilder and victoriatraces.New from tastora v0.20.0
  2. Refactored suite_test.go to use the new constructors and add 0.0.0.0 → 127.0.0.1 rewriting for macOS compatibility
  3. Simplified traces.go — moved URL normalization (trailing slash trim) to storage time, fixed UTC timestamps, and consolidated extractResourceAttrs to unmarshal JSON once

Issues

test/e2e/benchmark/traces.go:274-282fetchResourceAttrs returns on first non-empty line without checking if attrs were populated

for scanner.Scan() {
    line := scanner.Bytes()
    if len(line) == 0 {
        continue
    }
    attrs := extractResourceAttrs(line)
    return &attrs  // ← returns even if all fields are empty strings
}
return nil

extractResourceAttrs returns an empty resourceAttrs{} (all zero-value strings) if JSON unmarshal fails or none of the known OTEL keys match the span. The caller receives &resourceAttrs{} (non-nil) and will treat it as valid. This is a regression from the old code path which at least fetched a real span via limit=1.

Fix this →

test/e2e/benchmark/traces.go:281 — missing scanner.Err() check

fetchAllSpans (line 254) and fetchAllRichSpans (line 224) both check scanner.Err() after the scan loop and propagate the error. fetchResourceAttrs does not — a mid-stream read failure would silently return nil with no log output. Minor but inconsistent with the rest of the file.

Positives

  • The extractResourceAttrs refactor (single json.Unmarshal + shared find closure) is a clear improvement over the previous approach of calling extractResourceAttr 7 times, each doing its own unmarshal.
  • Normalising queryURL at storage time (removing trailing slash, rewriting 0.0.0.0) is cleaner than scattering TrimRight calls across every URL-building site.
  • .UTC().Format(time.RFC3339Nano) fix in fetchLogStream ensures consistent timezone-aware timestamps regardless of local system timezone — good correctness fix.
  • The macOS 0.0.0.0 → 127.0.0.1 rewrite is correctly scoped to the sequencer (local process) and the external query URL; it is appropriately not applied to the internal Docker-network endpoints.
  • Go toolchain bump (1.25.7 → 1.25.8) is routine and consistently applied across all modules.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 18, 2026

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMay 18, 2026, 9:16 AM

Required by tastora v0.20.0. Aligns root and execution/evm
with the other modules already at 1.25.8.
@chatton chatton force-pushed the cian/use-tastora-spamoor branch from e5fe0e1 to 779631d Compare May 18, 2026 08:34
@codecov
Copy link
Copy Markdown

codecov Bot commented May 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.84%. Comparing base (a2dae25) to head (4933ef3).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3326   +/-   ##
=======================================
  Coverage   60.84%   60.84%           
=======================================
  Files         127      127           
  Lines       13762    13762           
=======================================
+ Hits         8373     8374    +1     
+ Misses       4477     4476    -1     
  Partials      912      912           
Flag Coverage Δ
combined 60.84% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chatton chatton marked this pull request as ready for review May 18, 2026 08:48
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/e2e/benchmark/traces.go (1)

266-282: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Don’t stop at the first row unless attrs are actually present, and handle scanner errors.

This currently returns on the first non-empty line even if all extracted fields are empty, and it drops scanner.Err(). That can silently miss valid attrs or hide stream-read failures.

Suggested fix
 func (v *victoriaTraceProvider) fetchResourceAttrs(ctx context.Context, serviceName string) *resourceAttrs {
 	scanner, body, err := v.fetchLogStream(ctx, serviceName)
 	if err != nil {
 		v.t.Logf("warning: failed to fetch resource attrs: %v", err)
 		return nil
 	}
 	defer body.Close()

 	for scanner.Scan() {
 		line := scanner.Bytes()
 		if len(line) == 0 {
 			continue
 		}
 		attrs := extractResourceAttrs(line)
-		return &attrs
+		if attrs != (resourceAttrs{}) {
+			return &attrs
+		}
 	}
+	if err := scanner.Err(); err != nil {
+		v.t.Logf("warning: failed reading resource attrs stream: %v", err)
+	}
 	return nil
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@test/e2e/benchmark/traces.go` around lines 266 - 282, In
victoriaTraceProvider.fetchResourceAttrs, don’t return on the first non-empty
line blindly: iterate through all scanned lines from fetchLogStream, call
extractResourceAttrs(line) for each, and only return when the resulting
resourceAttrs contains actual populated fields (e.g., non-empty
service/host/other identifying fields); after the scan loop check scanner.Err()
and surface/log that error (instead of dropping it) and ensure body.Close()
still runs in defer — this avoids silently missing valid attrs and hides
stream-read failures.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@test/e2e/benchmark/traces.go`:
- Around line 266-282: In victoriaTraceProvider.fetchResourceAttrs, don’t return
on the first non-empty line blindly: iterate through all scanned lines from
fetchLogStream, call extractResourceAttrs(line) for each, and only return when
the resulting resourceAttrs contains actual populated fields (e.g., non-empty
service/host/other identifying fields); after the scan loop check scanner.Err()
and surface/log that error (instead of dropping it) and ensure body.Close()
still runs in defer — this avoids silently missing valid attrs and hides
stream-read failures.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: fae65c87-3c46-4f66-b2ce-09078898d75a

📥 Commits

Reviewing files that changed from the base of the PR and between a2dae25 and 779631d.

⛔ Files ignored due to path filters (3)
  • execution/evm/test/go.sum is excluded by !**/*.sum
  • test/docker-e2e/go.sum is excluded by !**/*.sum
  • test/e2e/go.sum is excluded by !**/*.sum
📒 Files selected for processing (12)
  • apps/evm/go.mod
  • apps/grpc/go.mod
  • apps/testapp/go.mod
  • execution/evm/go.mod
  • execution/evm/test/go.mod
  • go.mod
  • test/docker-e2e/go.mod
  • test/e2e/benchmark/spamoor_node.go
  • test/e2e/benchmark/suite_test.go
  • test/e2e/benchmark/traces.go
  • test/e2e/benchmark/victoriatraces_node.go
  • test/e2e/go.mod
💤 Files with no reviewable changes (2)
  • test/e2e/benchmark/victoriatraces_node.go
  • test/e2e/benchmark/spamoor_node.go

@chatton chatton changed the title chore: using v0.20.0 tag of tastora and removing temporary duplication deps: using v0.20.0 tag of tastora and removing temporary duplication May 18, 2026
@chatton chatton changed the title deps: using v0.20.0 tag of tastora and removing temporary duplication chore: using v0.20.0 tag of tastora and removing temporary duplication May 18, 2026
@tac0turtle tac0turtle merged commit 8904387 into main May 18, 2026
39 of 40 checks passed
@tac0turtle tac0turtle deleted the cian/use-tastora-spamoor branch May 18, 2026 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants