test(evm): migrate response-reading lib.js helpers off -b block (CON-256)#3406
Conversation
|
The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).
|
|
This doesn't work until we link in block db which supports tx lookup. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3406 +/- ##
==========================================
- Coverage 59.05% 59.04% -0.01%
==========================================
Files 2188 2188
Lines 182088 182084 -4
==========================================
- Hits 107530 107520 -10
Misses 64925 64925
- Partials 9633 9639 +6
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
2e0fe83 to
9d86334
Compare
… waits
The remaining -b block helpers in lib.js previously needed their post-
execution events to extract the returned identifier (code_id, contract
address, proposal_id, pointer_address). Under Autobahn -b block hangs,
and the seid tx indexer isn't wired yet, so neither -b block nor a
generic poll-by-txhash works.
Replace each with a per-caller side-effect wait that goes through a
query path that does work under Autobahn:
- storeWasm: poll max code_id in `seid q wasm list-code`
- instantiateWasm: diff `seid q wasm list-contract-by-code` before/after
- proposeCW20toERC20Upgrade: scan gov proposals for matching title
(extracted findProposalByTitle helper, also used by proposeParamChange)
- registerPointerForERC20/721/1155: factored into registerPointerForCw;
poll `seid q evm pointer` until non-empty
- executeWasm, associateWasm: new waitForAdminTxCommit helper, waits
for sender sequence to advance (the natural commit signal when the
helper itself doesn't have a specific side effect to poll)
The four EVM pointer deploy helpers (deployErc{20,721,1155}PointerFor*,
deployErc20PointerNative) already polled via `provider.getTransactionReceipt`
so only the broadcast mode needs to change.
executeWasm now returns only the CheckTx response (not DeliverTx), so
callers that asserted `res.code` to verify failure have to verify via
state instead. CW1155toERC1155PointerTest already followed each such
check with the state assertion that actually proves the outcome, so the
res.code lines are removed as redundant.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…merge The merge of #3431 (origin/wen/wipe_env_before_contract_upgradeability_test) silently kept our side of setupSigners because #3363 had touched the same region. Apply #3431's intent here: drop associateSigner and the seilocalSignerPrivateKeys lookup, and have setupSigners always use the fundAddress + self-send-tx flow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… waitForAdminTxCommit Three cleanups after CI surfaced regressions from the -b sync refactor: 1. storeWasm / instantiateWasm / registerPointerForCw wrap the waitForCondition timeout in a `<helper> failed: ...` prefix so callers that match on the prefix string (DisableWasmTest's wasm- disabled cases, ERC20toCW20PointerTest's pointer-of-a-pointer case) keep working. The chain rejects at DeliverTx in these cases (CheckTx accepts), so we surface the failure as a timeout on the side effect — the prefix preserves the existing error contract. 2. executeWasm / associateWasm now rewrite `response.height` to the actual inclusion block. The CheckTx response from -b sync carries `height: "0"`, but SeiEndpointsTest reads `res.height` to bound its sei_getLogs range. Find the inclusion block by scanning blocks between submit and observed commit for the tx hash (hex-uppercase SHA-256 of base64-decoded `block.data.txs` entries). 3. Add `getCurrentBlockHeight` and `findInclusionBlock` to support (2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cddbc2d to
68b8f86
Compare
- storeWasm: capture new code_id inside the wait. A second getMaxWasmCodeId() after the wait raced with any concurrent store landing in the same window. Serial test execution made the race dormant; capture-during-wait closes it. - instantiateWasm: same. The wait used .some() (boolean) and the return used .find() (specific entry) — two separate queries, each of which could see different state. Now captured inside the wait. - waitForAdminTxCommit: when sender sequence advanced (tx landed somewhere) but findInclusionBlock returned null, response.height was silently left at the CheckTx default. Log when this happens so the anomaly is visible in test output rather than producing a misleading height value. - CW1155toERC1155PointerTest: drop the unused res from three executeWasm calls (the res.code assertions that read it are gone), and on the negative-case test, add a comment pointing at the unchanged balances as the assertion that the unauthorized transfer was rejected at DeliverTx. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
| const output = await execute(command); | ||
| return JSON.parse(output); | ||
| const command = `seid tx wasm execute ${contractAddress} "${jsonString}" --amount ${coins} --from ${adminKeyName} --gas=5000000 --fees=1000000usei -y -b sync -o json`; | ||
| return await waitForAdminTxCommit(command) |
| const seqBefore = await getAccountSequence(senderAddr) | ||
| const response = JSON.parse(await execute(command)) | ||
| if (response.code !== 0) return response // CheckTx rejection — surface immediately | ||
| await waitForCondition( |
There was a problem hiding this comment.
do we timeout in case there's some sort of bug here?
There was a problem hiding this comment.
Yes, waitForCondition has a default 30s timeout, adding a note.
PR SummaryMedium Risk Overview Adds a fallback Simplifies signer setup by removing hardcoded private-key association logic and updates Reviewed by Cursor Bugbot for commit 9f05f86. Bugbot is set up for automated code reviews on this repo. Configure here. |
Mirrors the existing "EVM Module" CI job with AUTOBAHN=true plus the
GIGA_EXECUTOR/GIGA_STORAGE/GIGA_OCC flag set used by the "Autobahn
EVM GIGA Module" job. Runs evm_tests.sh under Autobahn:
- EVMCompatabilityTest.js (broad EVM semantics: deployment, gas,
variable types, assembly, trace, log
filtering, edge cases — 78 cases)
- EVMPrecompileTest.js (Sei precompiles: bank, addr, gov,
distribution, staking, oracle, wasm)
- SeiEndpointsTest.js (sei_*ExcludeTraceFail JSON-RPC paths)
- AssociateTest.js (account association mechanics)
Complements the narrower "Autobahn EVM GIGA Module" (smoke-tests
EVMGigaTest.js on native+ERC20 transfers only) by adding broader
EVM-compat + Sei-precompile + sei-endpoint + association coverage
that aren't exercised elsewhere under Autobahn.
Deliberately omits the flatkv post-steps from the CometBFT "EVM
Module" job; flatkv-under-Autobahn is its own concern and would
make per-job failure triage harder.
Verified locally on a 4-node Autobahn docker cluster: 101 passing,
1 pending, 0 failing.
Autobahn EVM Interoperability deferred until #3406 (lib.js
response-reading helper migration) lands; without it, the
suite's CW-deploy setup hooks depend on unmigrated -b block
helpers and CI passing would be accidental rather than verified.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the existing "EVM Module" CI job with AUTOBAHN=true plus the
GIGA_EXECUTOR/GIGA_STORAGE/GIGA_OCC flag set used by the "Autobahn
EVM GIGA Module" job. Runs evm_tests.sh under Autobahn:
- EVMCompatabilityTest.js (broad EVM semantics: deployment, gas,
variable types, assembly, trace, log
filtering, edge cases — 78 cases)
- EVMPrecompileTest.js (Sei precompiles: bank, addr, gov,
distribution, staking, oracle, wasm)
- SeiEndpointsTest.js (sei_*ExcludeTraceFail JSON-RPC paths)
- AssociateTest.js (account association mechanics)
Complements the narrower "Autobahn EVM GIGA Module" (smoke-tests
EVMGigaTest.js on native+ERC20 transfers only) by adding broader
EVM-compat + Sei-precompile + sei-endpoint + association coverage
that aren't exercised elsewhere under Autobahn.
Deliberately omits the flatkv post-steps from the CometBFT "EVM
Module" job; flatkv-under-Autobahn is its own concern and would
make per-job failure triage harder.
Verified locally on a 4-node Autobahn docker cluster: 101 passing,
1 pending, 0 failing.
Autobahn EVM Interoperability deferred until #3406 (lib.js
response-reading helper migration) lands; without it, the
suite's CW-deploy setup hooks depend on unmigrated -b block
helpers and CI passing would be accidental rather than verified.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the existing "EVM Module" CI job with AUTOBAHN=true plus the
GIGA_EXECUTOR/GIGA_STORAGE/GIGA_OCC flag set used by the "Autobahn
EVM GIGA Module" job. Same 4 steps as the CometBFT job:
- evm_tests.sh (EVMCompatabilityTest,
EVMPrecompileTest,
SeiEndpointsTest,
AssociateTest)
- deploy_flatkv_evm_fixture.sh (seeds historical EVM
state: balance, storage,
code)
- flatkv_evm_test.yaml (historical EVM RPC reads
via cast: balance, storage,
code at past block heights)
- verify_flatkv_evm_store.sh (seidb dump-flatkv smoke
check on the on-disk
storage bucket)
Complements the narrower "Autobahn EVM GIGA Module" (smoke-tests
EVMGigaTest.js on native+ERC20 transfers only) by adding broader
EVM-compat + Sei-precompile + sei-endpoint + association coverage
plus historical-state correctness, none of which are exercised
elsewhere under Autobahn.
Verified locally on a 4-node Autobahn docker cluster:
evm_tests.sh: 101 passing, 1 pending, 0 failing
deploy_flatkv_evm_fixture.sh: fixture seeded at heights 17567/17571
(flatkv yaml + verify steps deferred to CI; the 3 flatkv components
have zero -b block usages and use only EVM RPC + seid queries, so
they're Autobahn-clean.)
Autobahn EVM Interoperability deferred until #3406 (lib.js
response-reading helper migration) lands; without it, the
suite's CW-deploy setup hooks depend on unmigrated -b block
helpers and CI passing would be accidental rather than verified.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Picks up where #3363 left off. Migrates the lib.js helpers that read post-execution events from
-b blockto-b sync+ per-helper side-effect waits.Pattern (introduced in #3363, extended here): submit with
-b sync, then poll the actual on-chain side effect rather thanseid q tx(which doesn't return under Autobahn). When the side effect is observable, return the post-state value; when it isn't, fall back to admin-sequence-advance + block-walk to recover the inclusion height.Migrated:
storeWasm— side-effect: max wasm code_id grows (newgetMaxWasmCodeId)instantiateWasm— side-effect: new contract appears under codeId (newlistContractsByCode)registerPointerForERC20/721/1155— side-effect:seid query evm pointerreturns non-empty (factored into sharedregisterPointerForCw)proposeCW20toERC20Upgrade,proposeParamChange— side-effect: new gov proposal with matching title (factored intofindProposalByTitle)executeWasm,associateWasm— fallback path:waitForAdminTxCommitwaits on admin sequence advance, then block-walks to recover the actual inclusion height (no easy single-query side effect for arbitrary wasm execute / contract association)Wait-timeout cases are wrapped with the same error prefixes (
"storeWasm failed","instantiateWasm failed","contract deployment failed") that callers already match on, so existing assertions inDisableWasmTestand similar continue to work.Other:
associateSigner+ hardcodedseilocalSignerPrivateKeys—setupSignersnow uniformly funds the EVM address and reads back the sei address. The conditional branch became redundant after test(evm): wipe stale .openzeppelin manifest before upgradeability test #3431.res.codeassertions inCW1155toERC1155PointerTest.js—res.codeis now CheckTx (always 0 for mempool admission), not DeliverTx. Outcome verification stays via the existing post-state balance checks.