Fix transaction_index issue with HOP promote#574
Merged
Conversation
bkontur
approved these changes
May 29, 2026
Collaborator
|
I am adding Also zombienetsdk fór this |
Adds parachain_hop_promotion_bitswap_test under a new `zombie-hop-tests` feature flag. The test: - spawns a single HOP-enabled collator (small RP, small HOP retention, promotion buffer > retention so entries are promotable immediately) - authorizes Alice, submits `hop_submit` over JSON-RPC, waits for the collator's maintenance task to land the `HopPromotion::promote` extrinsic (detected via the Stored event) - after the retention period, asserts a `ProofChecked` event fired - compares the bitswap-served content to the original both before and after promotion -- this assertion is expected to fail and is the whole point of the test (surfacing the HOP -> col11/bitswap gap) Also adds a `utils::hop_rpc` helper that reconstructs the on-chain submit signing payload + SCALE-encoded MultiSigner/MultiSignature so the test can drive `hop_submit` without depending on `sc-hop` from polkadot-sdk, plus a `just test-zombienet-hop` recipe.
Move `current_best_block`, `current_finalized_block`, `block_hash_at`, `finalized_block_hash_at`, and `assert_proof_checked_at` out of `auto_renew_storage.rs` and `hop_promotion_storage.rs` into a new `utils::blocks` module. Both test files now use the shared implementation -- net diff is -128 lines.
…ted blob Before asserting `ProofChecked` at `store_block + RetentionPeriod`, read `TransactionByContentHash[content_hash]` at the proof block and assert it equals `(store_block, 0)`. The runtime's storage-proof inherent at block N proves `Transactions[N - RetentionPeriod]`, so tying the index back to our HOP content_hash at the proof block's state guarantees the upcoming ProofChecked event covers our promoted blob and not some unrelated extrinsic that happened to land in the same slot. Refactor `canonical_store_block` to share its decode path with a new `transaction_location_at` helper that returns both `(block, index)` from the same `TransactionByContentHash` read.
Drop the `transaction_location_at` helper -- the HOP test only needs the block number, so it can call the existing `canonical_store_block` directly. Single `assert_eq!(indexed_at, store_block, ...)` before `assert_proof_checked_at` ties the ProofChecked event back to the HOP-promoted blob.
Collaborator
|
I changed the base of this PR to this PR: #577. |
karolk91
approved these changes
May 29, 2026
Add a matching CI job for the new HOP suite, mirroring the `zombienet-sync-tests` shape: matrix over westend + paseo, label-gated so it doesn't run on every PR. The HOP test is currently designed to fail (it surfaces the HOP -> col11/bitswap gap), so unconditional execution would block every PR. Trigger with the `zombienet-hop-tests` label or `workflow_dispatch`.
CI: - Drop the `if:` gate on `zombienet-hop-tests` so it runs on every PR push, the same as `zombienet-auto-renew-tests`. - README CI matrix row updated. Logging: - `verify_data_matches` (called from every bitswap probe) now logs the full hex of expected + fetched on mismatch, plus both byte-len and hex-string-len so postmortems can see where the data diverges.
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.
sp_io::transaction_index::index()requires the last parameter of the extrinsic to be the data. This is the case withTransactionStorage::store()but was not the case withHopPromotion::promote(). I reordered the parameters and added a test to make sure we catch something like this in the future