-
Notifications
You must be signed in to change notification settings - Fork 1
Description
When running the [pool-cow tests](https://github.com/balancer/balancer-v3-monorepo/tree/main/pkg/pool-cow/test) in the Balancer monorepo targeting the EVM backend, certain calls (e.g. vault.registerPool(...)
) unexpectedly trigger InvalidOperandOOG an “invalid operand + out of gas” error from the interpreter. This appears to stem from revm (via revive) using a default EVM spec that lacks support for needed opcodes/features.
Expected Behaviour
Test environments should be able to override or specify the EVM hardfork / spec (e.g. Prague / EOF / new precompiles and and) so that test behaviour can match production assumptions and newer opcodes are enabled.
How to Reproduce
-
Follow instructions in the [repo README](https://github.com/balancer/balancer-v3-monorepo/blob/main/README.md).
-
cd pkg/pool-cow
and run the tests targeting evm. -
Alternatively, run a local node and configure Hardhat’s
networks
section, e.g.:networks: { test: { url: 'http://localhost:8545', }, },
-
Then run:
npx hardhat test --network test
The below code block yields a failure
sharedBeforeEach('create and initialise pool', async () => {
...
const tx = await factory.connect(bob).create(
'Cow Pool Test',
'CPT',
tokenConfig,
WEIGHTS,
{ pauseManager: ZERO_ADDRESS, swapFeeManager: ZERO_ADDRESS, poolCreator: ZERO_ADDRESS },
SWAP_FEE,
ZERO_BYTES32
);
const receipt = await tx.wait(); // At this point
...
});
Querying the receipt from the node outside of any tooling using the tx hash
from the node logs shows that receipt with a status of 0x0
, additionally when looking at the contract code the code fails at _registerPool this is called by vault.registerPool
which is called by the PoolFactory contract