Skip to content

Validate unsigned -> pallet::authorize#194

Open
antkve wants to merge 30 commits into
mainfrom
ak-validate-unsigned
Open

Validate unsigned -> pallet::authorize#194
antkve wants to merge 30 commits into
mainfrom
ak-validate-unsigned

Conversation

@antkve
Copy link
Copy Markdown
Contributor

@antkve antkve commented Jan 21, 2026

TODO

  • think about authorize_preimage and ProvideCidCodec and sp_io::hashing::blake2_256(data) in check_unsigned

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Jan 22, 2026

@antkve please rebase/merge with main

@antkve antkve force-pushed the ak-validate-unsigned branch 2 times, most recently from e7af58e to 42a690a Compare January 22, 2026 13:37
@antkve
Copy link
Copy Markdown
Contributor Author

antkve commented Jan 22, 2026

@antkve please rebase/merge with main

Done. By the way I'm not sure if we want to keep backwards compatibility like in the frame system upgrade? Can add that back in.

Comment thread pallets/transaction-storage/src/lib.rs Outdated
pub fn store(_origin: OriginFor<T>, data: Vec<u8>) -> DispatchResult {
#[pallet::authorize(|_source, data| {
Pallet::<T>::to_validity_with_refund(
Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::Validate),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antkve Could we just use here PreDispatch flow, which modifies authorizations and remove all the is_authorized handling from the call?

Suggested change
Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::Validate),
Pallet::<T>::check_unsigned_store(data.as_slice(), CheckContext::PreDispatch),

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Jan 22, 2026

@antkve please, check this fmt and fix compilation

@franciscoaguirre
Copy link
Copy Markdown
Contributor

@antkve I added the feeless_if validation

antkve and others added 4 commits February 13, 2026 19:00
* Use GitHub Actions matrix for integration tests

Run Westend parachain and Polkadot solochain tests in parallel
instead of sequentially, eliminating ~75 lines of duplication and
cutting CI wall time roughly in half. Each runtime gets its own
isolated runner, avoiding flaky cross-runtime state issues (#237).

* Reuse runtimes-matrix.json for integration test matrix

Instead of hardcoding the runtime list in the workflow, read from
scripts/runtimes-matrix.json and filter by a new `integration_tests`
flag. This keeps the single source of truth for runtime definitions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Add summary job for Integration Tests status check

The matrix job reports per-runtime check names (e.g. "Integration Tests
(bulletin-polkadot)") which don't match the branch protection rule
expecting a single "Integration Tests" status. Add a summary job that
aggregates matrix results under that exact name.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Load env vars in Setup job to fix cache key resolution

The Setup job uses POLKADOT_SDK_VERSION and ZOMBIENET_VERSION in cache
keys, but these are defined in .github/env. Without loading that file,
the cache keys resolve to empty strings causing cache misses every run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Use GITHUB_ENV for RUNTIME_PACKAGE instead of per-step matrix refs

Set RUNTIME_PACKAGE once in $GITHUB_ENV alongside TEST_DIR, then
reference both as plain env vars in all subsequent steps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Branislav Kontur <bkontur@gmail.com>
tx::SubmittableTransaction,
OnlineClient,
};
use subxt_core::{
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antkve I don't remember, but what was exactly the error with PAPI? That it did not work without ValidateUnsigned trait in runtime?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that's it, I guess this is fixed now though? Hope it is because trying to get it working in subxt is doing my head in

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Feb 19, 2026

@antkve please, rebase, no ProvideCidConfig extension is needed, so unsigned transaction should work or PAPI has problem without ValidateUnsigned?

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Mar 4, 2026

@antkve please rebase this, I am almost coming to this with #247

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Mar 19, 2026

@antkve please, rebase, no ProvideCidConfig extension is needed, so unsigned transaction should work or PAPI has problem without ValidateUnsigned?

@antkve please 👆 ?

Comment thread examples/api.js
throw new Error(`txOpts not supported for unsigned transactions (getBareTx doesn't accept options). See: https://github.com/polkadot-api/polkadot-api/issues/760`);
throw new Error(`txOpts not supported for unsigned transactions`);
}
// With #[pallet::authorize], unsigned transactions must be submitted as "general"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antkve very good job, here, I am trying to push this for PAPI: polkadot-api/polkadot-api#760 (comment)

@bkontur bkontur marked this pull request as ready for review March 26, 2026 16:11
@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Mar 26, 2026

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Mar 26, 2026

Let's keep this open and figure out the PAPI support: https://matrix.to/#/!bMWYTUFeSoYacMOlpS:matrix.parity.io/$pqN2BJJpI8gAoEziYDuVXF-j6dt0FMlIW_wP9SgXfTU?via=parity.io&via=matrix.org&via=matrix.parity.io

@antkve actually, there should be some hacky workaround: polkadot-js/api#6213 (comment) or maybe:

let general_signer = getPolkadotSigner(
    (data: Uint8Array) => alice.sign(data)
);

@bkontur
Copy link
Copy Markdown
Collaborator

bkontur commented Mar 26, 2026

@antkve let's keep our stuff for now, but could you just try this: polkadot-api/polkadot-api#760 (comment)?

@cla-bot-2021
Copy link
Copy Markdown

cla-bot-2021 Bot commented May 7, 2026

User @claude, please sign the CLA here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants