test(evm): introduce submitAndWaitForTx; migrate storeWasm + registerPointerForERC20 (CON-256)#3406
Draft
wen-coding wants to merge 2 commits intomainfrom
Draft
test(evm): introduce submitAndWaitForTx; migrate storeWasm + registerPointerForERC20 (CON-256)#3406wen-coding wants to merge 2 commits intomainfrom
wen-coding wants to merge 2 commits intomainfrom
Conversation
…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>
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
…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>
Contributor
Author
|
This doesn't work until we link in block db which supports tx lookup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
submitAndWaitForTxhelper that does-b sync+ poll-for-tx. Validation revealed a deeper gap that this PRcannot 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"]) butgiga_router.executeBlock(in sei-tendermint) doesn't feed thefinalized txs into
env.EventSinks, so the index stays empty.So
submitAndWaitForTxpollsseid query tx <hash>and always timesout 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.TxsResultsstub(
sei-tendermint/internal/rpc/core/blocks.go:260) that #3402 workedaround for the trace path:
BlockResults.TxsResultsemptydebug_traceBlockBy*,*ExcludeTraceFailseid query tx,tx_search, this PR's helperThe 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 incontracts/test/lib.js— works under non-Autobahn; times out under Autobahn until tx index
is wired
-b blockto-b sync+submitAndWaitForTx:storeWasm, instantiateWasm, executeWasm, associateWasm,
registerPointerForERC20/721/1155, proposeCW20toERC20Upgrade,
deployErc20PointerForCw20, deployErc20PointerNative,
deployErc721PointerForCw721, deployErc1155PointerForCw1155
integration_test/contracts/_tx_helpers.sh— bash-side parallelhelper
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 txstartsreturning results, this PR delivers the originally intended unblock
without rework.
Mark draft until block-db wiring is complete.
🤖 Generated with Claude Code