Skip to content

Enable storage logger#237

Merged
FletcherMan merged 1 commit intomainfrom
hotfix/tracer_for_prover
Nov 10, 2025
Merged

Enable storage logger#237
FletcherMan merged 1 commit intomainfrom
hotfix/tracer_for_prover

Conversation

@FletcherMan
Copy link
Copy Markdown
Collaborator

@FletcherMan FletcherMan commented Nov 10, 2025

1. Purpose or design rationale of this PR

...

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • build: Changes that affect the build system or external dependencies (example scopes: yarn, eslint, typescript)
  • ci: Changes to our CI configuration files and scripts (example scopes: vercel, github, cypress)
  • docs: Documentation-only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that doesn't fix a bug, or add a feature, or improves performance
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
  • test: Adding missing tests or correcting existing tests

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Tracing & Diagnostics
    • Storage tracing is now enabled during transaction processing, providing enhanced visibility into per-transaction proofs and state information for improved debugging and monitoring capabilities.

@FletcherMan FletcherMan requested a review from a team as a code owner November 10, 2025 06:17
@FletcherMan FletcherMan requested review from twcctop and removed request for a team November 10, 2025 06:17
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 10, 2025

Walkthrough

The CreateTraceEnv function in the tracing module has been modified to enable storage tracing by setting DisableStorage from true to false in the CreateTraceEnvHelper call. This change allows transaction traces to include storage-related data and state information.

Changes

Cohort / File(s) Summary
Storage tracing enablement
rollup/tracing/tracing.go
Changed DisableStorage parameter from true to false in CreateTraceEnvHelper call within CreateTraceEnv function to include storage data in transaction traces

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single-line boolean flag change with straightforward syntax
  • Primary review focus: verify the functional intent of enabling storage tracing is correct and aligns with trace collection requirements

Poem

🐰 A flag flips and storage flows free,
Traces bloom with each mystery,
State and proof now dance in sight,
Transactions glow with data's light! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Enable storage logger' clearly and concisely describes the main change: enabling storage tracing by setting DisableStorage to false in the trace environment configuration.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch hotfix/tracer_for_prover

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 golangci-lint (2.5.0)

Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions
The command is terminated due to an error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions


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.

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.

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 62fcaab and 7979106.

📒 Files selected for processing (1)
  • rollup/tracing/tracing.go (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (go)

Comment thread rollup/tracing/tracing.go
chainConfig,
&logger.Config{
DisableStorage: true,
DisableStorage: false,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify test coverage and performance impact of enabling storage tracing.

The change correctly enables storage tracing by setting DisableStorage: false, which aligns with the PR objective and is consistent with the extensive storage proof collection throughout the codebase (lines 359-483). However, enabling storage tracing will increase CPU and memory usage during transaction execution.

Please verify:

  1. Test coverage: Ensure tests validate that storage data is correctly captured when DisableStorage: false.
  2. Performance impact: Benchmark the performance difference, especially for blocks with many storage operations.
  3. Downstream compatibility: Confirm that systems consuming block traces can handle the additional storage data.

If this hotfix addresses a bug where storage data was missing for the prover, consider adding a comment explaining why storage must be enabled for proving purposes.


🏁 Script executed:

#!/bin/bash
# Search for existing tests related to CreateTraceEnv and storage tracing
rg -n -C3 --type=go 'CreateTraceEnv.*[Tt]est|DisableStorage.*false' -g '**/*test.go'

# Check for performance benchmarks
rg -n --type=go 'func Benchmark.*[Tt]race' -g '**/*test.go'

Length of output: 361


I need to search more specifically for tests in the rollup/tracing module and verify coverage for the storage configuration change.


🏁 Script executed:

#!/bin/bash
# Search for test files in rollup/tracing
fd -e _test.go . rollup/tracing/ 2>/dev/null || echo "No test files found in rollup/tracing"

# Search for all CreateTraceEnv usages to understand where it's called
rg -n --type=go 'CreateTraceEnv' --context=3

# Search for DisableStorage usage patterns
rg -n --type=go 'DisableStorage' --context=2

Length of output: 7637


I need to check for integration tests and understand the context of this change better.


---

🏁 Script executed:

```shell
#!/bin/bash
# Search for integration tests or callers of the trace function
rg -n --type=go 'CreateTraceEnvAndGetBlockTrace' --context=3

# Search for any test files that might exercise block tracing
fd -e _test.go . eth/tracers/ | head -20

# Check git history context for when DisableStorage was previously configured
git log --oneline -n 20 -- rollup/tracing/tracing.go 2>/dev/null || echo "Git history not available"

Length of output: 2764


Add unit tests to rollup/tracing and verify consumers handle storage data.

This change correctly re-enables storage tracing (reversing commit 054bbd2) to provide storage data required by the prover. The infrastructure is sound—storage capture is fully implemented in the logger module. However, the rollup/tracing module has zero unit tests, creating risk for regressions.

  1. Add tests to rollup/tracing: Unit tests should verify that DisableStorage: false correctly captures storage operations (SLOAD, SSTORE) in traces.
  2. Verify downstream consumers: Confirm all systems consuming BlockTrace (particularly the prover) can handle and process the additional storage data.
  3. Document the rationale: Add a comment explaining why storage must be enabled for proving, referencing the prover's data requirements.
🤖 Prompt for AI Agents
In rollup/tracing/tracing.go around line 151, add unit tests in the
rollup/tracing package that assert DisableStorage: false actually causes storage
operations (SLOAD, SSTORE) to be emitted in generated traces: create synthetic
transactions or traces (via the existing logger capture hooks) that perform
storage reads/writes, call the trace generation path, and assert the returned
BlockTrace contains storage entries on the corresponding trace frames/ops;
update any existing tests that consume BlockTrace (notably the prover
test-suite) to accept and validate the presence of storage fields so consumers
don’t break; and add a short comment at or above line 151 stating that storage
tracing must be enabled because the prover requires SLOAD/SSTORE data for proof
construction and referencing the prover data requirement.

@FletcherMan FletcherMan merged commit 2bd98c6 into main Nov 10, 2025
8 checks passed
@FletcherMan FletcherMan deleted the hotfix/tracer_for_prover branch November 10, 2025 06:22
FletcherMan added a commit that referenced this pull request Nov 11, 2025
enable storage logger

Co-authored-by: fletcher.fan <fletcher.fan@bitget.com>
@coderabbitai coderabbitai Bot mentioned this pull request Nov 24, 2025
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