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

Use EVM.dryRun method #225

Merged
merged 3 commits into from
Apr 30, 2024
Merged

Conversation

m-Peter
Copy link
Collaborator

@m-Peter m-Peter commented Apr 30, 2024

Closes: #187

Description

This method is now used for the eth_call & eth_estimateGas JSON-RPC calls.


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the standards mentioned here.
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

Summary by CodeRabbit

  • New Features
    • Introduced a new transaction encoding process to enhance handling and added timestamp to block responses.
    • Implemented a Cadence smart contract for EVM functionality to simulate transactions.
  • Enhancements
    • Updated the Go version used in CI workflows to improve compatibility and performance.
    • Modified transaction and gas estimation functions to include sender address for better context-aware execution.
  • Bug Fixes
    • Adjusted error handling in API streams to use a more accurate error reference.
  • Refactor
    • Overhauled various models and services to use updated import paths and methods for better maintainability and clarity.
  • Tests
    • Enhanced Web3JS tests with new assertions and improved the setup for event subscriptions and transaction simulations.

@m-Peter m-Peter added this to the Flow-EVM-M2 milestone Apr 30, 2024
@m-Peter m-Peter self-assigned this Apr 30, 2024
Copy link
Contributor

coderabbitai bot commented Apr 30, 2024

Walkthrough

This update introduces significant enhancements to transaction handling, error reporting, and overall functionality in a blockchain application framework. Changes span across various files, including updating Go versions, refining transaction encoding processes, improving error handling mechanisms, and enhancing test scripts for better reliability and functionality.

Changes

File Path Change Summary
.github/workflows/ci.yml Updated Go version from '1.20.x' to '1.21.x'.
api/api.go, api/encode_transaction.go Introduced new transaction encoding functions and updated transaction handling logic.
api/stream.go Replaced references to flowgoStorage with error handling updates.
bootstrap/bootstrap.go Added cfg.FlowNetworkID as an argument in NewRPCSubscriber function.
models/block.go, models/block_test.go Refactored block event payload decoding and related tests.
models/events.go, models/events_test.go Replaced common.TypeID with strings.Contains for event type comparisons.
models/receipt.go Refactored receipt decoding process and field assignments.
models/transaction.go, models/transaction_test.go Refactored txEventPayload struct and related methods.
services/ingestion/engine_test.go, services/ingestion/subscriber.go Updated import paths and function calls.
services/requester/cadence/dry_run.cdc, services/requester/requester.go Updated scripts and functions for sender address inclusion.
tests/web3js/eth_non_interactive_test.js, tests/web3js/eth_streaming_test.js, tests/web3js/eth_transfer_between_eoa_accounts_test.js Updated test scripts for improved functionality and reliability.

Assessment against linked issues

Objective Addressed Explanation
Update eth_call & eth_estimateGas with dedicated function from EVM #187 The PR updates Call and EstimateGas functions to include a new from parameter, aligning with the EVM enhancements.

Poem

🐰 Oh hoppy day, code's refined! 🌟
Go versions up, we're aligned.
Transactions flow, errors caught,
In tests and streams, solutions sought.
Let's celebrate, 🥕 feast, unwind!
For code that's cleaner, by design. 🎉


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
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>.
    • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @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.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@m-Peter m-Peter force-pushed the use-evm-dry-run-method branch from f7996b5 to 56dbb72 Compare April 30, 2024 16:38
@devbugging devbugging merged commit 2e47e88 into onflow:main Apr 30, 2024
2 checks passed
@m-Peter m-Peter deleted the use-evm-dry-run-method branch May 2, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Update eth_call & eth_estimateGas with dedicated function from EVM
2 participants