sei-chain icon indicating copy to clipboard operation
sei-chain copied to clipboard

[BUG] EVM Compatibility `EVM Throughput` can get stuck (seiv2)

Open maoueh opened this issue 1 year ago • 0 comments

Seid version On seiv2 branch commit 01f00b30ad15cafdd2bb3bce5a16f64e85dc6728.

Chain ID Local chain via ./scripts/initialize_local_chain.sh

Describe the bug I'm able to make the npx hardhat test --network seilocal --grep "EVM throughput" test/EVMCompatabilityTester.js get stuck and never returning until the timeout is hit.

To Reproduce

This one is timing sensitive, if the EVM throughput test case is launched not long after the funding transaction has completed, the test get stuck and times out.

First apply following diff to ./scripts/initialize_local_chain.sh:

diff --git a/scripts/initialize_local_chain.sh b/scripts/initialize_local_chain.sh
index bc29bd02..b0571c6e 100755
--- a/scripts/initialize_local_chain.sh
+++ b/scripts/initialize_local_chain.sh
@@ -111,5 +111,13 @@ fi
 
 ~/go/bin/seid config keyring-backend test
 
+fund() {
+  echo "Initializing chain..."
+  sleep 3 # Wait for chain to be ready instread...
+  ~/go/bin/seid tx evm send 0xF87A299e6bC7bEba58dbBe5a5Aa21d49bCD16D52 100000000000000000 --from admin
+}
+
+fund &
+
 # start the chain with log tracing
 GORACE="log_path=/tmp/race/seid_race" ~/go/bin/seid start --trace --chain-id sei-chain

Then prepare two terminal:

  • One at root of project
  • One in contracts folder

Have them side-by-side so you can time yourself a bit.

In the first on in project root run ./scripts/initialize_local_chain.sh to launch a local dev chain. When you see the message appear in the logs (I suggest adding --log_level warn to more easily spot it):

Transaction hash: 0xefe793496e170d9755023d3c3ff39dc650ea11904267099a38c8eb3956c9c381

Go to your second terminal, wait no more than 3 seconds and then launch npx hardhat test --network seilocal --grep "EVM throughput" test/EVMCompatabilityTester.js, the test should get stuck and never terminates until it hit the timeout. I'm able to reproduce on demand.

Afterward, retry the test again and it passes.

Expected behavior Should not get stuck. Additional context Add any other context about the problem here.

maoueh avatar Mar 28 '24 14:03 maoueh