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

Update hevm to 0.53.0 #1189

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Update hevm to 0.53.0 #1189

merged 1 commit into from
Feb 27, 2024

Conversation

arcz
Copy link
Member

@arcz arcz commented Feb 27, 2024

Summary by CodeRabbit

  • New Features

    • Updated hevm to version 0.53.0 for improved functionality.
  • Refactor

    • Enhanced consistency and clarity in the codebase by specifying Concrete in the VM type across various modules.
    • Adjusted function signatures and return types for better alignment with the updated VM type.
    • Streamlined error handling in transaction processing.

Copy link

coderabbitai bot commented Feb 27, 2024

Walkthrough

The overall change introduces a more specific type parameter, Concrete, to the VM type across various files in the codebase. This modification aims to refine the type system, enhancing clarity and consistency in handling virtual machine states, particularly emphasizing concrete execution contexts. The update touches on function signatures, type declarations, and error handling, ensuring a unified approach to specifying and working with the Ethereum Virtual Machine (EVM) states in real-world scenarios.

Changes

Files Summary
flake.nix Updated hevm version from 0.52.0 to 0.53.0 and its sha256 checksum.
lib/Echidna.hs Changed return type in prepareContract to include Concrete in VM.
lib/Echidna/Campaign.hs, Deploy.hs, Etheno.hs, Events.hs, Exec.hs, Shrink.hs, Solidity.hs, Test.hs, Transaction.hs, UI.hs, UI/Report.hs, UI/Widgets.hs Updated function and type signatures to use VM Concrete RealWorld or VM Concrete s.
lib/Echidna/Types.hs, Types/Test.hs, Types/Tx.hs Adjusted type signatures, error handling, and internal logic for Concrete in VM types.
lib/Echidna/Campaign.hs Additionally, hid the import of Gas from EVM.Types.

🐇✨

In a land of code and byte,
A rabbit hopped with all its might.
With Concrete types, it paved the way,
For clearer code, day by day.
🌟 Through EVM's vast, digital fields it leaps,
Crafting a path where precision keeps.
🐾

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-tests for this file.
  • 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 tests 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 from git and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit tests.
    • @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.
  • The JSON schema for the configuration file is available here.
  • 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/coderabbit-overrides.v2.json

CodeRabbit Discord Community

Join our Discord Community to get help, request features, and share feedback.

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 88ccd4c and 99fbd02.
Files ignored due to path filters (2)
  • package.yaml is excluded by: !**/*.yaml
  • stack.yaml is excluded by: !**/*.yaml
Files selected for processing (17)
  • flake.nix (1 hunks)
  • lib/Echidna.hs (1 hunks)
  • lib/Echidna/Campaign.hs (10 hunks)
  • lib/Echidna/Deploy.hs (2 hunks)
  • lib/Echidna/Etheno.hs (6 hunks)
  • lib/Echidna/Events.hs (2 hunks)
  • lib/Echidna/Exec.hs (7 hunks)
  • lib/Echidna/Shrink.hs (3 hunks)
  • lib/Echidna/Solidity.hs (3 hunks)
  • lib/Echidna/Test.hs (8 hunks)
  • lib/Echidna/Transaction.hs (2 hunks)
  • lib/Echidna/Types.hs (1 hunks)
  • lib/Echidna/Types/Test.hs (3 hunks)
  • lib/Echidna/Types/Tx.hs (3 hunks)
  • lib/Echidna/UI.hs (2 hunks)
  • lib/Echidna/UI/Report.hs (9 hunks)
  • lib/Echidna/UI/Widgets.hs (5 hunks)
Additional comments: 72
lib/Echidna/Types.hs (1)
  • 25-25: The update to the fromEVM function's type signature to include the Concrete type parameter aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.
lib/Echidna/Deploy.hs (1)
  • 28-29: The update to the type signatures of deployContracts, deployBytecodes, and deployBytecodes' functions to include the Concrete type parameter aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.

Also applies to: 36-37, 48-49

lib/Echidna/Shrink.hs (1)
  • 12-12: The introduction of the Concrete type parameter and the import of VMType(Concrete) in the shrinkTest and shrinkSeq functions' type signatures aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.

Also applies to: 25-25, 56-60

lib/Echidna/Events.hs (1)
  • 32-32: The update to the extractEvents and decodeRevert functions' type signatures to include the Concrete type parameter aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.

Also applies to: 79-79

lib/Echidna/Types/Test.hs (1)
  • 11-11: The introduction of the Concrete type parameter in the EchidnaTest data structure and the classifier function's argument in TestConf aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.

Also applies to: 14-14, 25-25, 58-58, 104-104

lib/Echidna.hs (1)
  • 52-52: The update to the prepareContract function's return type to include the Concrete type parameter aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.
lib/Echidna/Transaction.hs (1)
  • 38-38: The update to the hasSelfdestructed and setupTx functions' type signatures to include the Concrete type parameter aligns with the PR's objectives to refine the type system's expressiveness and accuracy. This change should enhance the handling of the virtual machine's state and execution context. Ensure that this modification is compatible with the rest of the codebase and does not introduce any unintended side effects.

Also applies to: 157-157

flake.nix (1)
  • 54-55: The update of hevm to version 0.53.0 and the corresponding sha256 checksum change are correctly implemented. Ensure to verify the compatibility of this new version with the rest of the project dependencies and the overall system to avoid potential integration issues.
lib/Echidna/Types/Tx.hs (2)
  • 183-183: The addition of ErrorNonexistentFork to the TxResult data type is a good update for handling new error scenarios. Ensure that all new error cases introduced by the updated VM or project requirements are adequately handled throughout the project.
  • 200-213: > 📝 NOTE

This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [203-230]

The modification of the getResult function to handle VMResult Concrete s instead of VMResult s is a significant improvement towards type safety and clarity in handling VM states. Ensure that this change is consistently applied across all relevant parts of the project and that any necessary adjustments are made to accommodate the new type specificity.

lib/Echidna/Etheno.hs (5)
  • 124-124: The update to include the Concrete type parameter in the VM type for the loadEthenoBatch function is a positive change towards enhancing type safety and clarity. Ensure thorough testing to verify that this modification integrates well with the rest of the project without introducing unintended side effects.
  • 135-135: The inclusion of the Concrete type parameter in the initAddress function's type signature aligns with the project's move towards more specific type handling. Verify that all interactions with this function are updated accordingly to accommodate the new type specificity.
  • 147-148: Updating the crashWithQueryError function to handle the Concrete type parameter is a good practice for maintaining type safety and clarity. Ensure that error handling throughout the project is consistent with this change.
  • 169-169: The modifications to the execEthenoTxs function to include the Concrete type parameter enhance the project's type safety and clarity in VM state management. Conduct comprehensive testing to ensure that these changes do not negatively impact the project's functionality.
  • 191-191: The update to the setupEthenoTx function to include the Concrete type parameter is in line with the project's efforts to improve type specificity and safety. Confirm that this change is consistently applied and tested across all relevant parts of the project.
lib/Echidna/UI/Report.hs (10)
  • 38-38: The update to the ppCampaign function signature to include the Concrete type parameter in the VM type is consistent with the PR's objectives. This change enhances type specificity, which can improve code clarity and correctness.
  • 56-56: The modification of the ppTx function signature to incorporate the Concrete type parameter is appropriate and aligns with the overall goal of refining type usage within the project. This change contributes to more precise type definitions.
  • 73-73: Updating the contractNameForAddr function signature to include the Concrete type parameter is a positive change, ensuring consistency in the handling of the virtual machine's state across the codebase.
  • 104-104: The adjustment in the ppGasInfo function signature to use the Concrete type parameter is in line with the PR's objectives of enhancing type specificity. This change is beneficial for maintaining type consistency.
  • 111-111: The update to the ppGasOne function signature, including the Concrete type parameter, is consistent with the PR's goal of refining type usage. This change aids in ensuring type accuracy and clarity.
  • 120-120: Modifying the ppFail function signature to incorporate the Concrete type parameter aligns with the PR's objectives and contributes to a more specific and accurate type system within the project.
  • 133-133: The change in the ppFailWithTraces function signature to include the Concrete type parameter is appropriate and supports the PR's goal of enhancing type specificity and consistency across the codebase.
  • 151-151: Updating the ppTS function signature to use the Concrete type parameter is consistent with the PR's objectives of refining type usage. This change is beneficial for maintaining type consistency and clarity.
  • 161-161: The modification of the ppOPT function signature to include the Concrete type parameter aligns with the overall goal of enhancing type specificity within the project. This change contributes to more precise type definitions.
  • 171-171: Adjusting the ppOptimized function signature to incorporate the Concrete type parameter is in line with the PR's objectives of improving type specificity. This change aids in ensuring type accuracy and consistency.
lib/Echidna/Test.hs (16)
  • 35-35: The update to the classifyRes function signature to include the Concrete type parameter in the VMResult type is consistent with the PR's objectives. This change enhances type specificity, which can improve code clarity and correctness.
  • 43-43: The modification of the getResultFromVM function signature to incorporate the Concrete type parameter is appropriate and aligns with the overall goal of refining type usage within the project. This change contributes to more precise type definitions.
  • 117-117: Updating the updateOpenTest function signature to use the Concrete type parameter is consistent with the PR's objectives of refining type usage. This change is beneficial for maintaining type consistency and clarity.
  • 141-142: The change in the checkETest function signature to include the Concrete type parameter is appropriate and supports the PR's goal of enhancing type specificity and consistency across the codebase.
  • 154-157: Modifying the checkProperty function signature to incorporate the Concrete type parameter aligns with the PR's objectives and contributes to a more specific and accurate type system within the project.
  • 168-172: The update to the runTx function signature, including the Concrete type parameter, is consistent with the PR's goal of refining type usage. This change aids in ensuring type accuracy and clarity.
  • 180-180: Adjusting the getIntFromResult function to explicitly handle VMResult Concrete RealWorld is in line with the PR's objectives of improving type specificity. This change aids in ensuring type accuracy and consistency.
  • 191-194: The modification of the checkOptimization function signature to include the Concrete type parameter aligns with the overall goal of enhancing type specificity within the project. This change contributes to more precise type definitions.
  • 202-205: Updating the checkStatefulAssertion function signature to use the Concrete type parameter is consistent with the PR's objectives of refining type usage. This change is beneficial for maintaining type consistency and clarity.
  • 232-235: The change in the checkDapptestAssertion function signature to include the Concrete type parameter is appropriate and supports the PR's goal of enhancing type specificity and consistency across the codebase.
  • 256-258: Modifying the checkCall function signature to incorporate the Concrete type parameter aligns with the PR's objectives and contributes to a more specific and accurate type system within the project.
  • 263-263: The update to the checkAssertionTest function to explicitly handle VM Concrete RealWorld is consistent with the PR's goal of refining type usage. This change aids in ensuring type accuracy and clarity.
  • 271-271: Adjusting the checkSelfDestructedTarget function to explicitly handle VM Concrete RealWorld is in line with the PR's objectives of improving type specificity. This change aids in ensuring type accuracy and consistency.
  • 276-276: The modification of the checkAnySelfDestructed function to include the Concrete type parameter aligns with the overall goal of enhancing type specificity within the project. This change contributes to more precise type definitions.
  • 283-283: Updating the checkOverflowTest function signature to use the Concrete type parameter is consistent with the PR's objectives of refining type usage. This change is beneficial for maintaining type consistency and clarity.
  • 291-293: The change in the reproduceTest function signature to include the Concrete type parameter is appropriate and supports the PR's goal of enhancing type specificity and consistency across the codebase.
lib/Echidna/UI.hs (2)
  • 33-33: The import statement has been updated to include VMType(Concrete), which aligns with the PR's objective to integrate the Concrete type parameter across the codebase. This change ensures that the VM type is now explicitly parameterized with Concrete, enhancing type specificity and accuracy.
  • 60-60: The ui function signature has been modified to include the Concrete type parameter in the VM type, along with RealWorld. This change is consistent with the PR's objective and improves the clarity and expressiveness of the code by making the handling of the virtual machine's state and execution context more specific.
lib/Echidna/UI/Widgets.hs (5)
  • 39-39: The import statement has been updated to include VMType(Concrete), which is consistent with the PR's objective to integrate the Concrete type parameter across the codebase. This change ensures that the VM type is now explicitly parameterized with Concrete, enhancing type specificity and accuracy.
  • 294-294: The tracesWidget function signature has been modified to specify the Concrete type parameter in the VM type. This change aligns with the PR's objective and improves the clarity and expressiveness of the code by making the handling of the virtual machine's state and execution context more specific.
  • 309-309: The failWidget function signature has been updated to include the Concrete type parameter in the VM type. This change is consistent with the PR's objective and enhances the type system's specificity and accuracy regarding the handling of the virtual machine's state and execution context.
  • 347-347: The maxWidget function signature has been modified to specify the Concrete type parameter in the VM type. This change aligns with the PR's objective and improves the clarity and expressiveness of the code by making the handling of the virtual machine's state and execution context more specific.
  • 365-365: The seqWidget function signature has been updated to include the Concrete type parameter in the VM type. This change is consistent with the PR's objective and enhances the type system's specificity and accuracy regarding the handling of the virtual machine's state and execution context.
lib/Echidna/Exec.hs (11)
  • 30-30: The import of Gas from EVM.Types is noted. Ensure that this import is utilized effectively in the file, especially given the changes to function signatures and type declarations involving Gas.
  • 60-60: The getQuery function's type signature has been refined to use the Concrete type parameter. This change aligns with the overall goal of enhancing type specificity and accuracy in handling the VM's state. Ensure that all calls to getQuery are updated accordingly.
  • 65-65: The pattern Reversion has been updated to use the Concrete type parameter. This change is consistent with the PR's objective of integrating the Concrete type parameter throughout the codebase. Verify that this pattern is correctly used in all relevant match expressions.
  • 69-69: The pattern Illegal has been updated to use the Concrete type parameter. This update is part of the systematic integration of the Concrete type parameter. Ensure that this pattern is appropriately utilized in all relevant match expressions.
  • 78-81: The function execTxWith now explicitly specifies VM Concrete RealWorld in its type signature. This change is crucial for ensuring type safety and clarity. However, it's important to review all usages of execTxWith to confirm that they comply with the updated type signature.
  • 223-225: The execTx function's type signature has been refined to use VM Concrete RealWorld. This adjustment is part of the broader effort to enhance type specificity. Ensure that all invocations of execTx are consistent with this updated type signature.
  • 233-235: The execTxWithCov function's type signature now includes VM Concrete RealWorld, aligning with the PR's objectives. Review all calls to execTxWithCov to ensure they adhere to the new type signature.
  • 266-266: The loop function within execCov has been updated to work with VM Concrete RealWorld. This change is part of the effort to consistently apply the Concrete type parameter. Verify that the loop function's logic remains correct and efficient with this type refinement.
  • 274-274: The stepVM function has been modified to use VM Concrete RealWorld. This update is consistent with the PR's goal of integrating the Concrete type parameter. Ensure that stepVM is correctly utilized in the context of the execCov function.
  • 278-278: The addCoverage function now operates on VM Concrete RealWorld. This change enhances type specificity and accuracy in handling coverage data. Confirm that addCoverage functions correctly within the execCov logic.
  • 315-315: The initialVM function's type signature has been refined to include the Concrete type parameter. This adjustment aligns with the PR's objectives. Review the usage of initialVM to ensure it is consistent with the updated type signature.
lib/Echidna/Solidity.hs (3)
  • 117-117: The populateAddresses function has been updated to use VM Concrete s. This change is part of the effort to enhance type safety and clarity in the codebase. Ensure that all calls to populateAddresses are updated accordingly.
  • 171-171: The loadSpecified function's return type has been updated to use VM Concrete RealWorld. This change aligns with the PR's objective of integrating the Concrete type parameter. Review all usages of loadSpecified to confirm that they comply with the updated return type.
  • 362-362: The loadSolTests function's return type now includes VM Concrete RealWorld, which is consistent with the PR's goals. Ensure that all invocations of loadSolTests are consistent with this updated return type.
lib/Echidna/Campaign.hs (10)
  • 31-31: The import statement for EVM.Types now hides Gas. This change is consistent with the modifications made in the file, where Gas is explicitly imported from Echidna.Types instead. This helps avoid naming conflicts and clarifies the source of the Gas type used in this module.
  • 66-66: The function signature for replayCorpus now explicitly specifies VM Concrete RealWorld as the type for the VM parameter. This change aligns with the overall objective of integrating the Concrete type parameter into the VM type across the project. It enhances type specificity and accuracy, potentially improving the robustness of the virtual machine simulation and manipulation functionalities.
  • 88-88: Similar to replayCorpus, the runWorker function now also uses VM Concrete RealWorld for its VM parameter type. This consistent application of the Concrete type parameter across different functions further strengthens the type system's expressiveness within the project.
  • 190-192: The callseq function's signature has been updated to both accept and return VM Concrete RealWorld. This change is crucial for maintaining the consistency of the VM's type throughout its usage in transaction sequences, ensuring that the concrete state of the VM is correctly handled.
  • 264-264: The returnValues function now operates on a list of (Tx, VMResult Concrete RealWorld), aligning with the changes made to handle the VM's concrete state more explicitly. This adjustment is essential for processing transaction results accurately within the context of the updated VM type.
  • 283-283: The addToCorpus function's parameters have been updated to work with (VMResult Concrete RealWorld, Gas) instead of (VMResult RealWorld, Gas). This change ensures that the corpus management functions are compatible with the new VM type, facilitating accurate tracking and manipulation of test results and gas usage.
  • 292-293: The execTxOptC function now explicitly uses VM Concrete RealWorld for both its input VM and the VM included in its return type. This change is part of the broader effort to integrate the Concrete type parameter into the VM type, ensuring that execution functions operate on the correctly typed VM state.
  • 308-308: The updateGasInfo function's signature has been updated to accept a list of (Tx, (VMResult Concrete RealWorld, Gas)), aligning with the changes made to handle the VM's concrete state. This update is crucial for accurately updating gas usage information based on the results of executed transactions.
  • 329-332: The evalSeq function's signature has been updated to specify VM Concrete RealWorld for both its input VM and the VM included in its return type. Additionally, it now operates on a function that takes and returns VM Concrete RealWorld, ensuring consistency in the handling of the VM's state across transaction evaluations.
  • 372-373: The updateTest function now uses VM Concrete RealWorld for both its input VM and the VM included in the parameters of the test update rule. This change ensures that test updates are performed with the correct VM state, aligning with the project's goal of integrating the Concrete type parameter into the VM type.

Copy link

@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.

Review Status

Actionable comments generated: 0

Configuration used: CodeRabbit UI

Commits Files that changed from the base of the PR and between 88ccd4c and c6069a5.
Files ignored due to path filters (2)
  • package.yaml is excluded by: !**/*.yaml
  • stack.yaml is excluded by: !**/*.yaml
Files selected for processing (17)
  • flake.nix (1 hunks)
  • lib/Echidna.hs (1 hunks)
  • lib/Echidna/Campaign.hs (10 hunks)
  • lib/Echidna/Deploy.hs (2 hunks)
  • lib/Echidna/Etheno.hs (6 hunks)
  • lib/Echidna/Events.hs (2 hunks)
  • lib/Echidna/Exec.hs (7 hunks)
  • lib/Echidna/Shrink.hs (3 hunks)
  • lib/Echidna/Solidity.hs (3 hunks)
  • lib/Echidna/Test.hs (8 hunks)
  • lib/Echidna/Transaction.hs (2 hunks)
  • lib/Echidna/Types.hs (1 hunks)
  • lib/Echidna/Types/Test.hs (3 hunks)
  • lib/Echidna/Types/Tx.hs (3 hunks)
  • lib/Echidna/UI.hs (2 hunks)
  • lib/Echidna/UI/Report.hs (9 hunks)
  • lib/Echidna/UI/Widgets.hs (5 hunks)
Files skipped from review as they are similar to previous changes (17)
  • flake.nix
  • lib/Echidna.hs
  • lib/Echidna/Campaign.hs
  • lib/Echidna/Deploy.hs
  • lib/Echidna/Etheno.hs
  • lib/Echidna/Events.hs
  • lib/Echidna/Exec.hs
  • lib/Echidna/Shrink.hs
  • lib/Echidna/Solidity.hs
  • lib/Echidna/Test.hs
  • lib/Echidna/Transaction.hs
  • lib/Echidna/Types.hs
  • lib/Echidna/Types/Test.hs
  • lib/Echidna/Types/Tx.hs
  • lib/Echidna/UI.hs
  • lib/Echidna/UI/Report.hs
  • lib/Echidna/UI/Widgets.hs

@arcz arcz merged commit 92f30c6 into master Feb 27, 2024
18 checks passed
@arcz arcz deleted the hevm-0.53.0 branch February 27, 2024 12:47
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