Skip to content

Conversation

ryanleecode
Copy link

@ryanleecode ryanleecode commented Aug 26, 2025

Description

Closes: paritytech/hardhat-polkadot#178

Integration

Goes into the hardhat dev node.

Review Notes

Adds console precompiles that support the exact same 300+ methods console.sol in foundry does. Adds property based tests to test all variants ensuring all permutations to not crash and log the expected value..

@ryanleecode ryanleecode changed the title feat: console precompiles revive: console precompiles Aug 26, 2025
@ryanleecode ryanleecode force-pushed the ryanleecode/console-precompile branch 2 times, most recently from fd4a36b to deafd00 Compare August 26, 2025 20:49
@ryanleecode ryanleecode requested a review from Copilot August 26, 2025 21:08
Copilot

This comment was marked as outdated.

@ryanleecode ryanleecode force-pushed the ryanleecode/console-precompile branch from 74850c9 to 70f6c50 Compare August 27, 2025 04:14
@ryanleecode ryanleecode requested review from Copilot and bee344 August 27, 2025 04:14
@ryanleecode ryanleecode marked this pull request as ready for review August 27, 2025 04:15
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces a complete console.log precompile for the Substrate revive EVM contracts framework, providing full compatibility with Foundry's console.sol library for debugging and development purposes.

Key changes:

  • Implements all 387 console.log function signatures from Foundry's forge-std library
  • Adds address allocation at 0x0B (decimal 11) with comprehensive property-based testing
  • Enables seamless debugging workflows with multi-channel output (Substrate logs, stdout, RPC debug buffer)

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
substrate/frame/revive/src/precompiles/builtin/console/property_tests.rs Comprehensive property-based tests verifying robustness and INPUT=OUTPUT invariant
substrate/frame/revive/src/precompiles/builtin/console/mod.rs Core console precompile implementation with 387 function signatures
substrate/frame/revive/src/precompiles/builtin/console/README.md Documentation covering address allocation, usage, and architecture context
substrate/frame/revive/src/precompiles/builtin.rs Integration of console module into builtin precompiles
substrate/frame/revive/src/precompiles.rs Added Clone and PartialEq derives to Error enum
substrate/frame/revive/src/benchmarking.rs Console-specific benchmarks for performance validation
substrate/frame/revive/Cargo.toml Added proptest dependency for property-based testing
prdoc/pr_9552.prdoc PR documentation describing features and usage

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@paritytech-workflow-stopper
Copy link

All GitHub workflows were cancelled due to failure one of the required jobs.
Failed workflow url: https://github.com/paritytech/polkadot-sdk/actions/runs/17257393509
Failed job name: fmt

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