refactor: migrate scneario tests#216
Merged
Merged
Conversation
This commit introduces a new test file for the send success acknowledgment lifecycle in the IBC settlement scenario. The test covers the process of sending a voucher, writing a packet commitment, and handling a protocol-success acknowledgment, ensuring that balances remain unchanged as expected.
notJoon
approved these changes
Jun 26, 2026
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.
Descriptions
Target directory layout (new under
scenario/union/)receive/,send/(existing)client/(existing)proof/(new)handshake/(new)batch/(new)forward/(new)intent/(new)settlement/(new)decimals/(new)ratelimit/(new)upgrade/(new)config/(new)Mapping tables
→
proof/(light-client proof verification)z33_real_cometbls_membership_fixtureverify_membership_by_real_cometbls_filetest.gnoz34_real_cometbls_non_membership_fixtureverify_non_membership_by_real_cometbls_filetest.gnoz43a_verify_membership_empty_proofreject_membership_empty_proof_filetest.gnoz43b_verify_membership_proof_count_mismatchreject_membership_proof_count_mismatch_filetest.gnoz43d_verify_non_membership_first_proof_not_nonexistencereject_non_membership_first_proof_not_absence_filetest.gnoz43e_verify_membership_subroot_mismatchreject_membership_subroot_mismatch_filetest.gnoz43f_verify_membership_malformed_proofreject_membership_malformed_proof_filetest.gnoz43g_verify_membership_final_root_mismatchreject_membership_root_mismatch_filetest.gnoz43h_verify_membership_wrong_keyreject_membership_wrong_key_filetest.gnoz43i_verify_membership_wrong_valuereject_membership_wrong_value_filetest.gnoz44a_verify_membership_frozen_clientreject_membership_frozen_client_filetest.gnoz44b_verify_membership_expired_clientreject_membership_expired_client_filetest.gnoz44c_verify_membership_missing_heightreject_membership_missing_height_filetest.gno→
handshake/(open handshake + proof errors)realcometbls/scenarios/z35_open_channelopen_channel_by_real_cometbls_filetest.gnoz42a_channel_open_ack_wrong_counterparty_idreject_channel_ack_wrong_counterparty_filetest.gnoz42b_channel_open_ack_wrong_versionreject_channel_ack_wrong_version_filetest.gnoz42c_connection_open_ack_wrong_counterparty_idreject_connection_ack_wrong_counterparty_filetest.gnoz42d_channel_open_ack_stale_statereject_channel_ack_stale_state_filetest.gno→
client/(existing)z31_real_cometbls_create_updatecreate_and_update_client_by_real_cometbls_filetest.gnoz32_real_cometbls_rejects_bad_headerreject_update_bad_header_by_real_cometbls_filetest.gnocometbls: … invalid proof)→
batch/(new)e2e/scenarios/z24_v1_recv_batch_token_order_and_callrecv_batch_token_order_and_call_filetest.gnoe2e/scenarios_batchsend/z26_batch_acks_eventbatch_acks_event_filetest.gnoBatchAckswrites collective ack, emits eventse2e/scenarios_batchsend/zs89_large_batch_current_behaviorlarge_batch_and_nested_rejection_filetest.gnorealcometbls/scenarios/z40a_recv_batch_mixed_call_token_orderrecv_batch_mixed_call_and_token_by_real_cometbls_filetest.gnorealcometbls/scenarios/z40b_recv_batch_child_panic_only_maker_propagatesrecv_batch_child_panic_only_maker_by_real_cometbls_filetest.gno→
forward/(new)e2e/scenarios_batchsend/z25_forward_allowedimpls_positiveforward_call_creates_child_filetest.gnoe2e/scenarios_batchsend/z41_forward_multihop_roundtripforward_multihop_roundtrip_filetest.gnoe2e/scenarios_batchsend/zs54_forward_child_timeout_parent_failure_ackforward_child_timeout_parent_failure_filetest.gnoe2e/scenarios_denyimpl/z26_forward_allowedimpls_negativereject_forward_unauthorized_impl_filetest.gno// Error: zkgm: caller is not an authorized impl for set in-flight packet: …/v1e2e/scenarios_direct/z1_inflight_eventsinflight_packet_events_filetest.gnoZkgmForwardInFlightSet/Poppedevents→
intent/(new)e2e/scenarios/z27_intent_recv_call_misdispatchreject_intent_call_misdispatch_filetest.gnoe2e/scenarios_direct/zs24_market_maker_fill_settlementmarket_maker_fill_settlement_filetest.gnoe2e/scenarios_direct/zs86_intent_frontrun_and_call_failclosedintent_frontrun_and_call_failclosed_filetest.gnorealcometbls/scenarios/z39a_recv_call_dispatches_via_real_lcrecv_call_dispatches_to_receiver_by_real_cometbls_filetest.gnorealcometbls/scenarios/z39b_recv_call_unregistered_receiverrecv_call_unregistered_receiver_by_real_cometbls_filetest.gnorealcometbls/scenarios/z39c_recv_call_receiver_panic_only_makerrecv_call_receiver_panic_only_maker_by_real_cometbls_filetest.gno→
settlement/(new)e2e/scenarios_direct/zs21_lock_mint_unescrow_unlock_conservationroundtrip_conservation_filetest.gnoe2e/scenarios_direct/zs22_fee_distributionfee_distribution_on_recv_filetest.gnoe2e/scenarios_direct/zs23_ack_failure_refund_success_settlementack_failure_refund_and_success_settlement_filetest.gnoe2e/scenarios_direct/zs64_voucher_asymmetry_origin_halt_no_recoveryorigin_halt_voucher_asymmetry_filetest.gnoe2e/scenarios_batchsend/zs11_handshake_send_recv_ack_successsend_recv_ack_lifecycle_filetest.gnoe2e/scenarios_batchsend/zs13_initialize_escrow_voucher_lifecycleinitialize_then_escrow_voucher_lifecycle_filetest.gnoe2e/scenarios_batchsend/zs14a_duplicate_success_recv_noopduplicate_recv_noop_filetest.gnoe2e/scenarios_batchsend/zs14b_ack_timeout_noopsack_timeout_idempotency_filetest.gnoe2e/scenarios_batchsend/z23_v1_token_order_roundtriptoken_order_roundtrip_filetest.gnoe2e/scenarios_batchsend/z21_v1_create_client_handshake_sendhandshake_and_send_filetest.gnorealcometbls/scenarios/z38a_recv_packet_receipt_dup_guardidempotent_recv_receipt_guard_by_real_cometbls_filetest.gnorealcometbls/scenarios_batchsend/z36_real_cometbls_ack_token_orderack_releases_to_maker_by_real_cometbls_filetest.gnorealcometbls/scenarios_batchsend/z37_real_cometbls_timeout_non_membershiptimeout_refunds_sender_by_real_cometbls_filetest.gnorealcometbls/scenarios_batchsend/z38b_ack_double_ack_noopdouble_ack_noop_by_real_cometbls_filetest.gnorealcometbls/scenarios_batchsend/z38c_timeout_after_ack_nooptimeout_after_ack_noop_by_real_cometbls_filetest.gnorealcometbls/scenarios/z35_real_cometbls_recv_token_orderrecv_token_order_by_real_cometbls_filetest.gno→
decimals/(new)e2e/scenarios_direct/zs25_18dec_no_scalingrecv_18dec_no_scaling_filetest.gnoe2e/scenarios_direct/zs26_6dec_native_out_no_scalingsend_6dec_native_no_scaling_filetest.gno→
ratelimit/(new)e2e/scenarios_direct/zs88_recv_path_ignores_send_rate_limitrecv_ignores_send_rate_limit_filetest.gnoe2e/scenarios/zs87_salt_deduprecv_salt_dedup_filetest.gno→
config/(new)e2e/scenarios_direct/zs33_v1_registration_configimpl_registration_config_filetest.gno→
upgrade/(new)upgrade/zs31_impl_upgrade_continuitystate_survives_impl_upgrade_filetest.gnoupgrade/zs32_allowed_impl_upgrade_pathallowed_impl_upgrade_path_filetest.gnoupgrade/zs36_inflight_completion_after_upgradeinflight_completes_after_upgrade_filetest.gnoupgrade/zs33_prod_impl_empty_allowed_bootstrapbootstrap_prod_impl_empty_allowlist_filetest.gnoupgrade/zs32_removed_allowed_impl_rejectedreject_removed_allowed_impl_filetest.gno// Error: permission denied for prev realm: …/testing/candidateupgrade/zs32_unallowed_impl_rejectedreject_unallowed_impl_filetest.gno// Error: permission denied for prev realm: …/testing/not-allowedupgrade/zs33_bootstrap_outside_namespace_rejectedreject_bootstrap_outside_namespace_filetest.gno// Error: zkgm: bootstrap not permitted for caller: gno.land/r/not-onbloc/…upgrade/zs33_bootstrap_nil_impl_rejected+bootstrap_nil/z1_bootstrap_nil_impl(duplicate)reject_bootstrap_nil_impl_filetest.gno// Error: zkgm: bootstrap UpdateImpl must install an impl(consolidate the two)impl_isolation/z50_impl_direct_constructreject_foreign_impl_construct_filetest.gno// Error: cannot allocate …/v1.ZkgmV1 in realm …(Gno Phase 3 isolation)impl_isolation/z51_impl_newreject_impl_new_unauthorized_filetest.gno// Error: not allowed(impl.New caller auth)Fixture-only sources — NOT rewritten as scenarios
These print packet commitments / ack bytes to seed other tests; they are data
generators, not behavior tests. Their logic is inlined into the consuming proof
tests rather than ported as standalone files.
realcometbls/scenarios/z39_fixture_inputsintent/real-cometbls call tests (#34–36)realcometbls/scenarios/z40_fixture_inputsbatch/real-cometbls tests (#24–25)realcometbls/scenarios_batchsend/packet_lifecycle_fixture_inputssettlement/real-cometbls ack/timeout tests (#48–51)Notes, duplicates, and overlaps
bootstrap_nil/z1_bootstrap_nil_impl≡upgrade/zs33_bootstrap_nil_impl_rejected— consolidated into a single file (doc: packet send guide #65).in each file's doc comment): Fix core batch port ownership #37
zs21and bytes-to-string encoding in packet events #45z23overlapreceive/mint_wrapped_voucher_by_ucs03_zkgmand thesend/lock tests, but addconservation / roundtrip / fee-split assertions the active tests don't make. zkgm: salt is not hashed with sender, causing packet hash mismatch with Union and salt-stealing risk #46
z21overlapsclient/+send/. If the maintainer prefers, these three can befolded into the existing
receive//send//client/files as extra scenariosinstead of new
settlement/files.z22_v1_recv_packet_dispatches_token_orderis the closest pure duplicate ofreceive/mint_wrapped_voucher_by_ucs03_zkgm(it only adds a relayer fee-splitassertion). It is folded into
settlement/fee_distribution_on_recv(fix(core): enforce ICS-04 packet timeout checks #38) ratherthan given its own file.
by_real_cometblstarget (proof/, handshake/, client/real-cometbls, and the real-cometbls rows of settlement/ batch/ intent/) is blocked
on porting the synthetic-proof builders into the active
scenario/helper/cometblsrealm. Track that as a prerequisite task.The legacy suite was written against an older API surface that has since been
removed, renamed, or made internal. A symbol-existence sweep of the active tree
(excluding
ignore/and_test.gno) found:Present (portable):
core.IntentPacketRecv,core.BatchAcks,zkgm.RegisterReceiver,z.DeriveSenderSalt,z.PredictWrappedTokenV2,core.PacketRecv/Acknowledgement/Timeout,zkgm.Send,zkgm.VoucherBalanceOf,zkgm.SetRateLimitDisabled.Absent (removed / internalized / renamed):
zkgm.SetInFlightPacket,zkgm.NewInFlightKey/Value,zkgm.PopInFlightPacket,zkgm.GetInFlightPacket(forward in-flight pokes),
zkgm.SetTokenBucket(rate-limit setter),zkgm.GetTokenOrigin,zkgm.VoucherDecimalsOf,core.HasPacketReceipt/HasAcknowledgement/HasPacketCommitment,zkgm.SetChannelBalanceV2,nonimpl.ReleaseNative. The entire allowed-impls upgrade model is gone:zkgm.NewUpdateRequest,zkgm.Bootstrapped,zkgm.ImplPath,zkgm.AllowedImpls,zkgm.InAllowedImpls,zkgm.ProductionImplPath,impl.Register,impl.New.The current upgrade surface is only
zkgm.UpdateImpl(cur, path string)(admin-gated,requires a constructor registered via the impl's
init→RegisterImpl) — noallowlist, no namespace bootstrap check at update time, no introspection getters.
Consequence for the mapping. Three buckets:
recv/ack/intent/batch/salt flows: fixtures: automate generated byte literals in realcometbls/fixtures.gno via go generate #21, refactor(ibc-core)!: align v1 core with union spec #22, Fix/issue 29 drop cometbls wrapper #31, refactor: remove ibcv2 zkgm stack #32, Simplify combined field/wire-type switch cases in cometbls proof decoder #33, Fix core batch port ownership #37–Make params store readable so the batch state map mirror can be removed #43, bytes-to-string encoding in packet events #45, ci: add gnokey query smoke test against live gnodev #56, and
the real-cometbls behavior tests if the helper is ported (Phase C).
was removed; verify the same behavior via current APIs (e.g. idempotency via
core.GetBatchReceiptsinstead ofHasPacketReceipt; forward end-to-end via aPacketRecvof a forward instruction instead ofSetInFlightPacketpokes; decimalsvia balance-diff instead of
VoucherDecimalsOf). NOT strictly 1-to-1. Coversfeat(lightclient): add state-lens ICS23 MPT light client #26–Reconsider cometbls client/consensus state encoding #30 (forward), Add path-keyed sibling queries: QueryCommitmentAtPath / QueryReceiptAtPath #44, fix(core)!: emit packet_data/acknowledgement as hex #47–Register calibrated gas costs for project native bindings #51, Feat/protobuf gen #53–feat(core): add
QueryCommitmentAtPath/QueryReceiptAtPath#55.The allowed-impls upgrade suite and the registration-config introspection:
Packet acknowledgement clears per-packet commitment mirror while batch commitment state is inconsistent #57 (config), ZKGM native refund can fail during core acknowledgement callback due to impl caller check #58–doc: packet send guide #65 (upgrade allowed-impls/bootstrap-policy), refactor(core): split IBC handlers and harden MPT decoding #67 (
impl.New).These cannot be rewritten 1-to-1. Options: (a) drop; (b) re-design a small
upgrade/suite for the current model (normal: admin re-pointsUpdateImplto aregistered path and state persists; exception: non-admin
UpdateImpl→ accessdenied; exception:
UpdateImplto an unregistered path →impl constructor not found; exception: re-RegisterImpl→impl already registered). feat(ci): implement auto-labeling for pull requests based on linked issues #66(
z50foreign-impl alloc) likely still holds as a Gno Phase-3 guarantee and can bekept as an exception test.
Recommendation: rewrite buckets 1 and 2 (re-targeting pokes to current
behavior-level APIs), redesign bucket 3 into a current-model
upgrade/suite, andgate all real-cometbls files (Phase C) on porting the synthetic-proof helper.
Phase C status update (helper ported, adapter API gone)
gno.land/r/onbloc/ibc/scenario/helper/realcometbls(copiedsetup.gno+fixtures.gno, fixed the one bit-rotted refzkgm.ProductionImplPath()→ the v1impl path, repointed the helper's own code-realm path). It compiles (
gno test→
[no test files]). The real cometbls light-client p-package(
p/.../lightclient/cometbls:ClientType,Decode*State,NewCometblsLightClient)is intact.
proof/andhandshake/tests call a direct adapterrealadapter "gno.land/r/onbloc/ibc/lightclients/cometbls"→NewAdapter(cur).VerifyMembership(clientId, height, proof, key, value). That realmand the
NewAdapter/direct-VerifyMembershipAPI do not exist in the active tree(the only active cometbls adapter realm is
union/lightclients/cometbls, whichexposes just
RegisterClient). There is no supported way to call a client'sVerifyMembershipdirectly from a test anymore.proof/(wip: copy from unionlabs/union/gnoland #1–13) and proof-errorhandshake/(ics23: NonExistenceProof verification panics on malformed input #15–18) tests arebucket 2 / re-target, not 1-to-1. Membership / non-membership verification must be
exercised through core — e.g. a
core.PacketRecvwhose crafted proof failsverification makes core panic — rather than by poking the adapter. The synthetic
fixtures in the ported helper provide the proof/key/value bytes, but slotting them
into a full
PacketRecv(with matching packet commitment + channel) is a non-trivialredesign per test. Real-cometbls behavior tests that already go through core
(
z35_recv_token_order,z36/z37ack/timeout,z39a-ccall dispatch,z40a/bbatch) are the more tractable Phase-C starting point.
opens (verified: source=2/destination=1), but a packet receive aborts with
packet timeout expired: the Z3x packet-commitment proof fixtures were generated forpackets with
timeoutTimestamp = 0, which the current model treats as alreadyexpired, and changing the timeout invalidates the fixture's commitment. Regenerating
the fixtures needs a live devnet. So z35/z36/z37 and the real-cometbls token flows
(test(zkgm): add handler/dispatch end-to-end scenario fixture generator #24–25, refactor(ibc): use pkg path as IBC port identifier #34–36, fix(core)!: emit packet_data/acknowledgement as hex #47–52) are blocked until those timeout=0 fixtures are regenerated
(matches the prior finding "cometbls token flows blocked by bit-rotted timeout=0
fixtures"). Together with the removed direct adapter (
proof/wip: copy from unionlabs/union/gnoland #1–13,handshake/ics23: NonExistenceProof verification panics on malformed input #15–18), Phase C is not rewritable as-is without fixture-regeneration / adapter work.
Obsolete — not rewritable (API/behavior removed)
Confirmed by direct inspection; documented here instead of rewritten:
config(zs33_v1_registration_config)Bootstrapped/ImplPath/AllowedImpls/InAllowedImplsremoved; nothing to assertucs03ZkgmV1); a foreign realm cannot name it, so there is no exportedZkgmV1to construct — isolation is enforced by Go visibility nowimpl.New/impl.Registerremoved (replaced byUpdateImpl(path))SetTokenBucketis store-internal); onlySetRateLimitDisabledis public, so a per-token bucket cannot be planted to test bypassSetInFlightPacket/NewInFlightKey/PopInFlightPacket) was removed/internalizedforward/#26–28 (z25/z41/zs54)GetInFlightPacket/NewInFlightKey) +zkgm.ImplPath/core.HasAcknowledgement; the forward behavior still runs but is no longer observable from a test, so the wholeforward/category is blockedThe legacy allowed-impls upgrade suite (#58–65) is replaced by the current-model
upgrade/tests (state-survives-reinstall + two rejections), not ported 1-to-1.