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

refactor(katana): remove events trace log #2570

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

kariy
Copy link
Member

@kariy kariy commented Oct 22, 2024

this remove the trace! log for transaction events that is emitted after the execution of every transaction.

for transaction that emits a lot of event (definitely yes, in the case of dojo application) the logs are being emitted are too much. and afaik most people dont even find it particularly THAT useful.

below is an example of the events log from the Dojo example project:

Screenshot 2024-10-22 at 4 10 29 PM

not sure who is autistic enough (too bad im not) to even find these logs useful. maybe useful in the case of identifying the transactions based on the number of events (or a specific event hash) but in most scenario, these logs are ignored. emitting these logs however, (especially when there are a lot of events) are not free, they takes a some amount of resources, and in the case of Slot, storing these logs takes up most of the storage capacity.

Summary by CodeRabbit

  • New Features

    • Introduced a new BlockifierFactory for enhanced configuration and simulation of blockchain transactions.
    • Added methods for simulating transactions and estimating fees with improved error handling and logging.
  • Bug Fixes

    • Enhanced logging for transaction execution results, including detailed insights for successful transactions and failures.
  • Chores

    • Removed the log_events function, streamlining event logging processes.

Copy link

coderabbitai bot commented Oct 22, 2024

Walkthrough

Ohayo, sensei! The recent changes to the Katana executor involve significant updates to the blockifier module, including the introduction of a new BlockifierFactory struct and enhancements to the StarknetVMProcessor. Key modifications include new methods for handling block environments, improved transaction execution logging, and expanded error handling. Additionally, the log_events function has been removed from the utilities, indicating a shift in event logging practices. These adjustments collectively aim to refine transaction processing and error management within the blockchain framework.

Changes

File Path Change Summary
crates/katana/executor/src/implementation/blockifier/mod.rs - Added BlockifierFactory struct.
- Introduced new methods in BlockifierFactory and updated existing method signatures in StarknetVMProcessor for enhanced functionality and logging.
`crates/katana/executor/src/utils.rs - Removed log_events function, altering event logging capabilities. Other utility functions remain unchanged.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BlockifierFactory
    participant StarknetVMProcessor
    participant ExecutorExt

    User->>BlockifierFactory: create new instance
    BlockifierFactory->>StarknetVMProcessor: configure and initialize
    StarknetVMProcessor->>ExecutorExt: execute transactions
    ExecutorExt->>StarknetVMProcessor: simulate transactions
    StarknetVMProcessor->>User: return execution results
Loading

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between db767df and 4be4a74.

📒 Files selected for processing (2)
  • crates/katana/executor/src/implementation/blockifier/mod.rs (0 hunks)
  • crates/katana/executor/src/utils.rs (0 hunks)
💤 Files with no reviewable changes (2)
  • crates/katana/executor/src/implementation/blockifier/mod.rs
  • crates/katana/executor/src/utils.rs

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Oct 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.76%. Comparing base (db767df) to head (4be4a74).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2570      +/-   ##
==========================================
- Coverage   69.80%   69.76%   -0.04%     
==========================================
  Files         401      401              
  Lines       51179    51172       -7     
==========================================
- Hits        35723    35702      -21     
- Misses      15456    15470      +14     

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

@kariy kariy merged commit c2bbef9 into main Oct 22, 2024
14 of 15 checks passed
@kariy kariy deleted the katana/remove-event-trace branch October 22, 2024 20:50
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.

1 participant