Skip to content

Update foundry description#1375

Open
smiasojed wants to merge 20 commits into
polkadot-developers:masterfrom
smiasojed:master
Open

Update foundry description#1375
smiasojed wants to merge 20 commits into
polkadot-developers:masterfrom
smiasojed:master

Conversation

@smiasojed

Copy link
Copy Markdown

📝 Description

Provide a clear and concise description of your changes.

🔍 Review Preference

Choose one:

  • ✅ I have time to handle formatting/style feedback myself
  • ⚡ Docs team handles formatting (check "Allow edits from maintainers")

🤖 AI-Ready Docs

If content changed, regenerate AI files:

  • ✅ I ran python3 scripts/generate_llms.py
  • ⚡ Docs team will regenerate (check "Allow edits from maintainers")

✅ Checklist

@smiasojed smiasojed requested a review from a team as a code owner January 7, 2026 14:22
Copilot AI review requested due to automatic review settings January 7, 2026 14:22

Copilot AI left a comment

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.

Pull request overview

This PR updates the foundry-polkadot documentation to reflect new features in version 1.5.0 and later, including support for testing with forge test and local development with anvil-polkadot. The documentation now provides a more complete picture of the toolset's capabilities.

Key changes:

  • Added comprehensive testing documentation with backend selection support (EVM and PVM)
  • Added documentation for anvil-polkadot local development node
  • Updated feature descriptions to reflect current support and limitations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread develop/smart-contracts/dev-environments/foundry.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry.md Outdated

@re-gius re-gius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks!

Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
| `eth_getBlockByHash` | ✅ | Returns information about a block by hash |
| `eth_getBlockByNumber` | ✅ | Returns information about a block by number |
| `eth_getBlockReceipts` | ❌ | Returns all transaction receipts for a given block |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We should probably add here eth_getBlockTransactionCountByNumber, eth_getBlockTransactionCountByHash

@smiasojed smiasojed Jan 9, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added

| `eth_getCode` | ✅ | Returns code at a given address |
| `eth_getProof` | ❌ | Returns the account and storage values including the Merkle proof |
| `eth_getTransactionCount` | ✅ | Returns the number of transactions sent from an address |
| `eth_getTransactionCountByHash` | ✅ | Returns the number of transactions in a block by block hash |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

These are actually eth_getBlockTransactionCountByNumber, eth_getBlockTransactionCountByHash and are block-related RPCs

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Done

| `debug_traceTransaction` | ✅ | Returns a full trace of a transaction's execution |
| `debug_traceCall` | ✅ | Returns a full trace of a call's execution |
| `debug_getRawTransaction` | ❌ | Returns the raw transaction data |
| `debug_codeByHash` | ❌ | Returns the code for a given code hash |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We have also implemented debug_traceBlockByNumber

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Added

Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
- **Gas Model**: The gas metering in `foundry-polkadot` is not fully aligned with Polkadot's production gas model. Tests relying on precise gas checks may fail.
- **Balance Types**: Ethereum uses `u256` for balances, while Polkadot uses `u128`. Tests involving amounts exceeding `u128::MAX` will fail in the Polkadot runtime.
- **PVM Integration Maturity**: The PVM backend is experimental. Tests may not work when using libraries or proxy patterns.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Do we want to add something about the tx pool checks that are stricter on Polkadot, so some transaction could be included and then cause a revert on Ethereum, while they cannot be included in the tx pool on Polkadot ?

Start a local development node with:

```bash
anvil-polkadot

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

What do you think of adding the docker usage?

PROs: it does not require rust installed locally and it's super fast
CONs: different versions available - if you reference the latest image published on master, you may get an unstable version. But do we have any stable version to suggest? I guess no

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Feel free to add such section

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Then I'll do it on a separate PR

Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
Comment thread develop/smart-contracts/dev-environments/foundry-anvil-rpc.md Outdated
smiasojed and others added 12 commits January 9, 2026 09:58
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Giuseppe Re <giuseppe.re@parity.io>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

@re-gius re-gius left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM for the Anvil part

@nhussein11

nhussein11 commented Jan 16, 2026

Copy link
Copy Markdown
Collaborator

Hey @smiasojed @re-gius, thank you very much for this! We'll work on the foundry page soon. The first version of the docs focused mainly on regular EVM tools, so I haven't touched this PR yet. As soon as we start adding content for PVM tools, like Foundry Polkadot, I'll get back to this PR. Just wanted to give you guys a heads-up so you know this PR is on our radar 👍

@smiasojed

Copy link
Copy Markdown
Author

@nhussein11 it is for EVM mainly not PVM

@nhussein11

Copy link
Copy Markdown
Collaborator

@nhussein11 it is for EVM mainly not PVM

Yeah, for the first iteration, we covered regular EVM tools. We'll get on PVM/EVM tools soon

| `anvil_setIntervalMining` | ✅ | Set the mining interval |
| `anvil_getIntervalMining` | ✅ | Get the current mining interval |
| `evm_mine` | ✅ | Mine a single block |
| `evm_mineDetailed` | ✅ | Mine a single block and return detailed information |

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
| `evm_mineDetailed` || Mine a single block and return detailed information |
| `evm_mine_detailed` || Mine a single block and return detailed information |

@kapetan3sid kapetan3sid added the B2 - Blocked Pull request is blocked and should not be merged label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B2 - Blocked Pull request is blocked and should not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants