Skip to content

Flaky "Invalid Transaction" errors in Uniswap V2 periphery migration tests #281

@sekisamu

Description

@sekisamu

Description

After partially fixing #266, both hardhat-polkadot 0.1.5 and 0.1.8 now produce consistent but non-deterministic Invalid Transaction errors. The error occurs randomly in different test cases across multiple test runs.

Environment

Steps to Reproduce

1. Build nodes

git clone https://github.com/paritytech/polkadot-sdk
cd polkadot-sdk
git checkout c40b36c3a7c208f9a6837b80812473af3d9ba7f7

# Build eth-rpc
cargo build -p pallet-revive-eth-rpc --release

# Build revive-dev-node
cd substrate/frame/revive/dev-node/node
cargo build --release

2. Prepare test repository

git clone https://github.com/papermoonio/v2-periphery-polkadot
cd v2-periphery-polkadot
git checkout bugfix/flaky

3. Create .env file

Create .env file in the project root:

LOCAL_PRIV_KEY=0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133
AH_PRIV_KEY=xxx

4. Test with hardhat-polkadot 0.1.5

Note: pnpm-lock.yaml contains hardhat-polkadot 0.1.5

pnpm install
USE_POLKAVM=true npx hardhat test ./test/ExampleComputeLiquidityValue.spec.ts

Results vary between runs:

5. Test with hardhat-polkadot 0.1.8

Note: package-lock.json contains hardhat-polkadot 0.1.8

rm -rf node_modules
npm install
USE_POLKAVM=true npx hardhat test ./test/ExampleComputeLiquidityValue.spec.ts

Results vary between runs:

Important Note

When running the same revive-dev-node and eth-rpc binaries manually (not through hardhat), these errors do NOT occur, suggesting the issue may be related to:

  • State management between tests
  • Block production timing

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions