Skip to content

[Ethena] HardhatChaiMatchersAssertionError: Assertion error: receipt should not be null #165

@charlesHetterich

Description

@charlesHetterich

Several test in suites across Ethena fail with the error receipt should not be null, which adding delays does not seem to fix. Most cases this fails consistently, but I have observed certain tests where this fails sometimes & passes other times. Running tests together vs. individually does not seem to have an effect.

Steps to Reproduce

We use the test titled testRate_ in EthenaBalancerRateProvider.test.ts to observe the behavior.

1. Setup testing environment for Ethena.

Following steps assume ethena-labs as working directory.

git clone https://github.com/paritytech/scc-testing.git --branch charles/ethena
cd scc-testing
git checkout --detach ce904986c313df704f24488ad85c4af166001dc1
cd ethena-labs
npm install

# Choose depending on your machine
chmod -R +x ./bin/linux
chmod -R +x ./bin/mac

2. Put the following environment variables into ethena-labs/.env

# NOTE: update bin path depending on linux vs mac
REVIVE_DEV_NODE_BIN=./bin/linux/revive-dev-node
ETC_RPC_BIN=./bin/linux/eth-rpc

3. Launch dev-node & eth-rpc

# NOTE: update bin path depending on linux vs mac
RUST_LOG="error,evm=debug,sc_rpc_server=info,runtime::revive=debug" ./bin/linux/revive-dev-node
RUST_LOG="info,eth-rpc=debug" ./bin/linux/eth-rpc

4. Run the test

npm test -- --network localNode test/staking/EthenaBalancerRateProvider.test.ts --grep "testRate_"

Observed Behavior

Output from eth-rpc

2025-09-05 19:19:58.667  INFO main eth-rpc: 🌐 Connecting to node at: ws://127.0.0.1:9944 ...    
2025-09-05 19:19:58.668  INFO main eth-rpc: 🌟 Connected to node at: ws://127.0.0.1:9944    
2025-09-05 19:19:58.674  WARN main eth-rpc: 💾 Using in-memory database, keeping only 256 blocks in memory    
2025-09-05 19:19:58.676  INFO tokio-runtime-worker prometheus: 〽️ Prometheus exporter started at 127.0.0.1:9616    
2025-09-05 19:19:58.727  INFO                 main sc_rpc_server: Running JSON-RPC server: addr=127.0.0.1:8545,[::1]:8545    
2025-09-05 19:19:58.727  INFO tokio-runtime-worker eth-rpc: 🔌 Subscribing to new blocks (BestBlocks)    
2025-09-05 19:19:58.727  INFO tokio-runtime-worker eth-rpc: 🔌 Subscribing to new blocks (FinalizedBlocks)    
2025-09-05 19:20:12.405 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xa603776b189bdc4497bacf08ce1d80a057c6872e419db32eac4c544f437466d5    
2025-09-05 19:20:13.403 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xdedc1365fcacf4d502908dec3b72d808ff4423f97f7bdefdb1d31f793b05e3ab    
2025-09-05 19:20:14.047 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xc65dc05595d116b915ca9b4da2d5e22f53b0abfb9de038e3df6bc4b597e5d348    
2025-09-05 19:20:14.331 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xb5c811d9ad9c3657059b4c6fcb76b1b7c25a8c34db01db019f13fc32e8299713    
2025-09-05 19:20:14.606 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xa02c4e4a01f56a50405c9dde9a29b2008f559b09972fe9c08f94540095789ecd    
2025-09-05 19:20:14.779 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0xd5d4973ba5295ad69ab9e64e293602f698b7180f1887a8c4d128549eeb674173    
2025-09-05 19:20:15.111 DEBUG tokio-runtime-worker eth-rpc: send_raw_transaction hash: 0x0b91d6a3f24057a6db720c0cd884f02f160092eeb4223330cfc1090ef7fb9a83    

Output from revive-dev-node

2025-09-05 19:19:53.492  INFO main sc_rpc_server: Running JSON-RPC server: addr=127.0.0.1:9944,[::1]:9944    
2025-09-05 19:20:12.364 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 59438 actual_fee: 594380108157000 eth_fee: 713280129788775    
2025-09-05 19:20:12.364 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 0 and tip: 118880021631463    
2025-09-05 19:20:12.368 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 59438 actual_fee: 594380108157000 eth_fee: 713280129788775    
2025-09-05 19:20:12.368 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 0 and tip: 118880021631463    
2025-09-05 19:20:13.356 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 157170 actual_fee: 1571700108157000 eth_fee: 1886064129788787    
2025-09-05 19:20:13.356 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 1 and tip: 314344021631465    
2025-09-05 19:20:13.363 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 157170 actual_fee: 1571700108157000 eth_fee: 1886064129788787    
2025-09-05 19:20:13.363 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 1 and tip: 314344021631465    
2025-09-05 19:20:14.007 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 5768 actual_fee: 57680108157000 eth_fee: 69252129788737    
2025-09-05 19:20:14.007 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 2 and tip: 11542021631457    
2025-09-05 19:20:14.009 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 5768 actual_fee: 57680108157000 eth_fee: 69252129788737    
2025-09-05 19:20:14.009 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 2 and tip: 11542021631457    
2025-09-05 19:20:14.015 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 5768 actual_fee: 57680108157000 eth_fee: 69252129788737    
2025-09-05 19:20:14.015 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 2 and tip: 11542021631457    
2025-09-05 19:20:14.290 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 156 actual_fee: 1560108157000 eth_fee: 1908129788751    
2025-09-05 19:20:14.291 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 3 and tip: 318021631459    
2025-09-05 19:20:14.292 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 156 actual_fee: 1560108157000 eth_fee: 1908129788751    
2025-09-05 19:20:14.292 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 3 and tip: 318021631459    
2025-09-05 19:20:14.565 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788763    
2025-09-05 19:20:14.565 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 4 and tip: 384021631461    
2025-09-05 19:20:14.567 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788763    
2025-09-05 19:20:14.567 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 4 and tip: 384021631461    
2025-09-05 19:20:14.576 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788763    
2025-09-05 19:20:14.576 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 4 and tip: 384021631461    
2025-09-05 19:20:14.738 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788751    
2025-09-05 19:20:14.738 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 0 and tip: 384021631459    
2025-09-05 19:20:14.740 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788751    
2025-09-05 19:20:14.740 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 0 and tip: 384021631459    
2025-09-05 19:20:15.064 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788799    
2025-09-05 19:20:15.064 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 1 and tip: 384021631467    
2025-09-05 19:20:15.065 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788799    
2025-09-05 19:20:15.066 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 1 and tip: 384021631467    
2025-09-05 19:20:15.111 DEBUG tokio-runtime-worker runtime::revive: try_into_checked_extrinsic: gas_price: 1200, encoded_len: 189 actual_fee: 1890108157000 eth_fee: 2304129788799    
2025-09-05 19:20:15.111 DEBUG tokio-runtime-worker runtime::revive: Created checked Ethereum transaction with nonce: 1 and tip: 384021631467    

Output from test

Compiling 6 Solidity files
Successfully compiled 6 Solidity files
Compiling 6 Solidity files
Successfully compiled 6 Solidity files


  EthenaBalancerRateProvider
expectedNewRate 1000000000000122465n
    1) testRate


  0 passing (6s)
  1 failing

  1) EthenaBalancerRateProvider
       testRate:
     HardhatChaiMatchersAssertionError: Assertion error: receipt should not be null
      at assertIsNotNull (/home/ubuntu/scc-testing/ethena-labs/node_modules/@nomicfoundation/hardhat-chai-matchers/src/internal/utils.ts:16:11)
      at /home/ubuntu/scc-testing/ethena-labs/node_modules/@nomicfoundation/hardhat-chai-matchers/src/internal/emit.ts:129:28
      at processTicksAndRejections (node:internal/process/task_queues:105:5)
      at async mintApproveDeposit (/home/ubuntu/scc-testing/ethena-labs/test/staking/EthenaBalancerRateProvider.test.ts:73:5)
      at async Context.<anonymous> (/home/ubuntu/scc-testing/ethena-labs/test/staking/EthenaBalancerRateProvider.test.ts:199:9)

Where /home/ubuntu/scc-testing/ethena-labs/node_modules/@nomicfoundation/hardhat-chai-matchers/src/internal/emit.ts:129:28 refers to the code-block

        return waitForPendingTransaction(tx, contract.runner.provider).then(
          (receipt) => {
            assertIsNotNull(receipt, "receipt");
            return onSuccess(receipt);
          }
        );

Inside of the supportEmit function of @nomicfoundation/hardhat-chai-matchers/src/internal/emit.ts

Metadata

Metadata

Assignees

Labels

EthenabugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions