Skip to content

test(evm): introduce submitAndWaitForTx; migrate storeWasm + registerPointerForERC20 (CON-256)#3406

Draft
wen-coding wants to merge 2 commits intomainfrom
wen/migrate_response_reading_lib_helpers_off_b_block
Draft

test(evm): introduce submitAndWaitForTx; migrate storeWasm + registerPointerForERC20 (CON-256)#3406
wen-coding wants to merge 2 commits intomainfrom
wen/migrate_response_reading_lib_helpers_off_b_block

Conversation

@wen-coding
Copy link
Copy Markdown
Contributor

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

Status: blocked on cosmos tx indexing under Autobahn

This PR was intended to unblock EVM Interop / SeiDB / Wasm-deploy tests
under Autobahn by introducing a submitAndWaitForTx helper that does
-b sync + poll-for-tx. Validation revealed a deeper gap that this PR
cannot work around at the lib.js layer:

Under Autobahn, cosmos tx-by-hash lookup is not supported — none of
seid query tx <hash>, /tx?hash=..., /tx_search?query=tx.hash=...
return the tx. The KV indexer is enabled (indexer = ["kv"]) but
giga_router.executeBlock (in sei-tendermint) doesn't feed the
finalized txs into env.EventSinks, so the index stays empty.

So submitAndWaitForTx polls seid query tx <hash> and always times
out under Autobahn, even on tx hashes that were validly broadcast and
clearly committed (block height advances, abci_info updates).

This is a parallel gap to the BlockResults.TxsResults stub
(sei-tendermint/internal/rpc/core/blocks.go:260) that #3402 worked
around for the trace path:

Gap Affects Workaround / fix
BlockResults.TxsResults empty debug_traceBlockBy*, *ExcludeTraceFail #3402 sources from receipt store instead
Tx-by-hash index not populated seid query tx, tx_search, this PR's helper Pending: block-db (Cody's litt) integration will provide indexed lookup

The plan per the team thread on TxResults storage: post-execution data
will live in the block-db on RPC nodes (litt), and tx-by-hash lookup
will be served from there. This PR is blocked on that landing.

What this PR currently contains

  • submitAndWaitForTx(command, opts) helper in contracts/test/lib.js
    — works under non-Autobahn; times out under Autobahn until tx index
    is wired
  • 12 lib.js helpers migrated off -b block to -b sync +
    submitAndWaitForTx:
    storeWasm, instantiateWasm, executeWasm, associateWasm,
    registerPointerForERC20/721/1155, proposeCW20toERC20Upgrade,
    deployErc20PointerForCw20, deployErc20PointerNative,
    deployErc721PointerForCw721, deployErc1155PointerForCw1155
  • New integration_test/contracts/_tx_helpers.sh — bash-side parallel
    helper
  • 4 deploy scripts migrated:
    deploy_wasm_contracts.sh, create_tokenfactory_denoms.sh,
    deploy_dex_contract.sh, deploy_timelocked_token_contract.sh

Why keep the PR (don't close)

The migration code is correct and works under non-Autobahn. When the
block-db tx-indexing lands and Autobahn-routed seid query tx starts
returning results, this PR delivers the originally intended unblock
without rework.

Mark draft until block-db wiring is complete.

🤖 Generated with Claude Code

…egisterPointerForERC20

Background: PR #3363 migrated response-agnostic lib.js helpers (bankSend,
fundSeiAddress, associateKey, passProposal vote, evmSend, proposeParam-
Change, createTokenFactoryTokenAndMint, EVMPrecompile gov before-hook)
from -b block to -b sync, so they work under Autobahn (where -b block
hangs because CometBFT consensus is disabled). However, response-reading
helpers (storeWasm, registerPointerForERC20/721/1155, executeWasm,
associateContractAddress, proposeAddCWERC20Pointer, proposeAddCWERC721
Pointer) couldn't be migrated by the same flag-flip — they read post-
execution fields (events, logs, code) that -b sync doesn't return.

That follow-up was deferred to a separate PR; this is that PR.

This commit:
  1. Adds a submitAndWaitForTx(command, opts) helper that submits with
     -b sync, then polls `seid query tx <hash>` until the tx is included
     in a block, returning the post-execution response.
  2. Migrates two helpers as worked examples:
       - storeWasm (reads code_id from store_code event)
       - registerPointerForERC20 (reads pointer_address from
         pointer_registered event)
  3. Documents the Autobahn motivation inline.

Remaining helpers to migrate in follow-up commits (same pattern):
  - registerPointerForERC721
  - registerPointerForERC1155
  - executeWasm
  - associateContractAddress
  - proposeAddCWERC20Pointer
  - proposeAddCWERC721Pointer (if it exists with -b block)
  - integration_test/contracts/*.sh (wasm/tokenfactory/dex deploy scripts)

Out of scope: yaml-based cosmos integration tests use -b block in shell
commands consumed by runner.py; that needs runner.py support for the
"submit + poll" pattern, separate from this lib.js work.

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

github-actions Bot commented May 7, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 7, 2026, 5:36 AM

…y scripts

Builds on the previous commit (submitAndWaitForTx + storeWasm +
registerPointerForERC20 worked examples) and finishes the response-
reading-helper migration that #3363 deferred.

Migrated in contracts/test/lib.js:
  - storeWasm                       (already done in prior commit)
  - registerPointerForERC20         (already done in prior commit)
  - registerPointerForERC721        NEW
  - registerPointerForERC1155       NEW
  - executeWasm                     NEW (the one #3363 had to revert)
  - associateWasm                   NEW
  - proposeCW20toERC20Upgrade       NEW
  - instantiateWasm                 NEW
  - deployErc20PointerForCw20       NEW (-b block -> -b sync; existing EVM-receipt poll handles wait)
  - deployErc20PointerNative        NEW (same)
  - deployErc721PointerForCw721     NEW (same)
  - deployErc1155PointerForCw1155   NEW (same)

New shared bash helper: integration_test/contracts/_tx_helpers.sh
  Defines submit_and_wait_for_tx() — bash equivalent of the JS helper.
  Reads the broadcast response from stdin (must use --broadcast-mode=sync),
  polls `seid query tx <hash>` until included, prints the tx response.

Migrated deploy scripts in integration_test/contracts/:
  - deploy_wasm_contracts.sh        (3 store + 3 instantiate calls)
  - create_tokenfactory_denoms.sh   (3 create-denom calls)
  - deploy_dex_contract.sh          (store + instantiate + register-contract + 4 register-pairs)
  - deploy_timelocked_token_contract.sh
                                    (7 bank-sends + 2 store + 2 instantiate)

Out of scope (separate effort):
  - yaml-based cosmos integration tests (gov, oracle, authz, staking,
    bank, distribution, mint) — these use -b block in shell commands
    parsed by integration_test/scripts/runner.py. Migrating needs
    runner.py support for the submit-then-poll pattern.
  - Helpers already migrated in #3363 (evmSend, bankSend, fundSeiAddress,
    associateKey, createTokenFactoryTokenAndMint, proposeParamChange,
    passProposal vote) — left unchanged here to avoid conflicts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wen-coding wen-coding marked this pull request as ready for review May 7, 2026 05:34
@wen-coding wen-coding marked this pull request as draft May 7, 2026 05:37
@wen-coding
Copy link
Copy Markdown
Contributor Author

This doesn't work until we link in block db which supports tx lookup.

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.

1 participant