Skip to content

test(evm): migrate evm_rpc_tests.sh off -b block (CON-256)#3486

Merged
wen-coding merged 2 commits into
mainfrom
wen/migrate_evm_rpc_tests_off_b_block
May 21, 2026
Merged

test(evm): migrate evm_rpc_tests.sh off -b block (CON-256)#3486
wen-coding merged 2 commits into
mainfrom
wen/migrate_evm_rpc_tests_off_b_block

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

@wen-coding wen-coding commented May 21, 2026

Summary

`evm_rpc_tests.sh` (run by the `Autobahn RPC .io/.iox (spec fixtures)` CI job) seeded the chain with three cosmos txs via `-b block`: an `associate-address`, a minimal-contract deploy, and a reverter-contract deploy. Each output a tx hash and contract address used by downstream `.io`/`.iox` spec fixtures.

Under Autobahn the KV indexer that `-b block` polls isn't populated, so each of these three calls hung up to its 60s timeout before the trailing `|| true` swallowed the failure. The job didn't error out — but the env vars (`SEI_EVM_IO_SEED_BLOCK`, `SEI_EVM_IO_DEPLOY_TX_HASH`, `SEI_EVM_IO_REVERTER_ADDRESS`) were never set, so any spec fixture that referenced the deployed contracts was silently skipped.

Fix

  1. Switch the three submissions to `-b sync`. The CLI returns the tx response JSON (including txhash) immediately; the existing downstream `eth_getTransactionReceipt` polling loop already handles inclusion confirmation, so no other changes are needed.

  2. Poll the sender's cosmos account sequence between consecutive `-b sync` submissions (`wait_from_seq_advance`, 5s timeout). Required because the next CLI's pre-flight `q account` reads from app state (committed view) — if the previous tx hasn't committed yet, the next sign reuses the same sequence and CheckTx rejects with "incorrect account sequence", fatal under `set -e` on the `send` line which has no `|| true`. cursor-bugbot flagged this race; the polling closes it.

Timing

`Autobahn RPC .io/.iox`
Main (with `-b block` hangs) ~363s avg
This PR ~308s (commit 1, no polling) — polling adds ~1–3s on the happy path

Net: ~50s faster per Autobahn RPC run and the previously-skipped `SEED` / `REVERTER` spec fixtures now actually execute.

Test plan

  • CI: `Autobahn RPC .io/.iox (spec fixtures)` finishes ~55s faster than main
  • CI: `EVM RPC .io/.iox (spec fixtures)` (CometBFT) stays green
  • All other Autobahn / CometBFT EVM jobs unaffected

evm_rpc_tests.sh seeds the chain with three txs (an associate-address,
a deploy of minimal_contract.hex, a deploy of reverter_contract.hex)
before invoking the .io/.iox spec-conformance tests. All three
submissions used -b block. Under Autobahn the cosmos KV indexer that
-b block polls isn't populated, so each call hung to its 60s timeout
before the trailing || true papered over the failure. The script
"passed" only because the .io/.iox fixtures that referenced the
unset SEI_EVM_IO_SEED_BLOCK / SEI_EVM_IO_REVERTER_ADDRESS env vars
were silently skipped — three minutes wasted per Autobahn RPC run for
degraded coverage.

Switch the three sites to -b sync. The CLI returns the tx response
JSON (including txhash) immediately; the existing downstream
eth_getTransactionReceipt polling loop already handles inclusion
confirmation, so no other changes are needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 21, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 21, 2026, 6:11 PM

@wen-coding wen-coding marked this pull request as ready for review May 21, 2026 16:36
@cursor
Copy link
Copy Markdown

cursor Bot commented May 21, 2026

PR Summary

Low Risk
Low risk: changes are isolated to an integration-test seeding script, mainly adjusting broadcast mode and adding a small wait to avoid tx sequence races in CI.

Overview
Speeds up and stabilizes evm_rpc_tests.sh seeding under Autobahn by switching the initial associate-address and contract deploy transactions from -b block to -b sync, relying on existing eth_getTransactionReceipt polling for inclusion.

Adds sender sequence tracking (get_from_seq/wait_from_seq_advance) to wait for each prior tx to commit before submitting the next, preventing intermittent "incorrect account sequence" failures and avoiding silently skipped __SEED__/__REVERTER__ fixtures when deployment metadata isn’t produced.

Reviewed by Cursor Bugbot for commit 317f546. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread integration_test/evm_module/scripts/evm_rpc_tests.sh
@wen-coding wen-coding force-pushed the wen/migrate_evm_rpc_tests_off_b_block branch from c16dd01 to 0405190 Compare May 21, 2026 17:46
Comment thread integration_test/evm_module/scripts/evm_rpc_tests.sh
@wen-coding wen-coding force-pushed the wen/migrate_evm_rpc_tests_off_b_block branch 2 times, most recently from 33dc047 to 1056a71 Compare May 21, 2026 18:01
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default mode and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 1056a71. Configure here.

Comment thread integration_test/evm_module/scripts/evm_rpc_tests.sh
@wen-coding wen-coding requested review from amir-deris and masih May 21, 2026 18:07
…ions

cursor-bugbot flagged two races the -b sync swap introduced: after a
tx is accepted by CheckTx, the next CLI on the same key reads the
account sequence via gRPC q-account against app state. If the prior
tx hasn't committed yet, the read returns the pre-tx sequence, the
next CLI signs with the same sequence the mempool already has tracked
for the prior tx, and CheckTx rejects with "incorrect account
sequence":

  - associate-address → send: send has no `|| true`, so under set -e
    a rejection crashes the script.
  - send → deploy minimal: deploy has `|| true`, but silent rejection
    leaves SEI_EVM_IO_SEED_BLOCK unset and silently skips the
    __SEED__ spec fixtures this PR intends to enable.

Add wait_from_seq_advance between both pairs: capture the sender's
sequence before each tx and poll (up to 5s) until it advances before
submitting the next. Sender's sequence is the direct causal signal
that the previous tx committed.

A previous attempt had top-level `FROM_ADDR=$(docker exec ...)` which
under set -e exited the script when the substitution returned non-zero
(no output visible — the failure mode that broke CI earlier). Guards
added:
  - `FROM_ADDR=$(...) || FROM_ADDR=` on the resolution line
  - `get_from_seq` always returns 0; outputs empty on error
  - `wait_from_seq_advance` no-ops if FROM_ADDR is empty
  - Numeric regex check before integer comparison

Worst case (FROM_ADDR resolution fails for some reason): polling is
skipped, script behaves like the original commit without protection —
same risk profile as the unprotected version, no worse.

The reverter deploy further down doesn't need a separate guard: when
the minimal deploy succeeds, its receipt-poll loop already waits for
inclusion before reverter; when it fails, reverter racing is no worse
than the (already-tolerated) minimal failure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding force-pushed the wen/migrate_evm_rpc_tests_off_b_block branch from 1056a71 to 317f546 Compare May 21, 2026 18:09
@wen-coding wen-coding enabled auto-merge May 21, 2026 18:43
@wen-coding wen-coding added this pull request to the merge queue May 21, 2026
Merged via the queue into main with commit ef425cc May 21, 2026
46 of 47 checks passed
@wen-coding wen-coding deleted the wen/migrate_evm_rpc_tests_off_b_block branch May 21, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants