Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Free Transactions #403

Closed
5 tasks
distributedstatemachine opened this issue May 9, 2024 · 3 comments
Closed
5 tasks

Fix Free Transactions #403

distributedstatemachine opened this issue May 9, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@distributedstatemachine
Copy link
Contributor

distributedstatemachine commented May 9, 2024

Description

Currently, our runtime does not properly handle fee-free transactions using the pallet_skip_feeless_payment module. This leads to inconsistencies and potential issues with transaction processing, as free transactions now require a fee.. The recent upgrade to Polkadot v1.10 removed the previous functionality, causing a regression in our system. In essence , Pays=No becomes a noop.

Acceptance Criteria

  • Integrate the pallet_skip_feeless_payment module into the runtime.
  • Define the necessary associated types and implement the required traits for the SkipFeelessPaymentConfig.
  • Update the RuntimeEvent enum to include the SkipFeelessPayment variant.
  • Ensure that fee-free transactions, including the faucet functionality, are correctly identified and processed.

Tasks

  • Update the runtime's Cargo.toml file to include the pallet-skip-feeless-payment dependency.
  • Implement the pallet_skip_feeless_payment::Config trait for the runtime:
    impl pallet_skip_feeless_payment::Config for Runtime {
        type RuntimeEvent = RuntimeEvent;
    
        fn is_fee_free(call: &Self::RuntimeCall) -> bool {
            // Add logic to determine if a call is fee-free
            // ...
        }
    }
  • Update the RuntimeEvent enum in runtime/src/lib.rs:
    #[derive(Debug, Encode, Decode, PartialEq, Eq, Clone)]
    #[cfg_attr(feature = "std", derive(serde::Serialize, serde::Deserialize))]
    pub enum RuntimeEvent {
        // ...
        SkipFeelessPayment(pallet_skip_feeless_payment::Event<Runtime>),
        // ...
    }
  • Update the construct_runtime! macro to include the SkipFeelessPayment module.
  • Test the changes to ensure fee-free transactions, including the faucet, are correctly processed.

Related Links

@open-junius
Copy link
Contributor

According to my investigation, the root cause is the account.providers.is_zero() && account.sufficients.is_zero() check added when nonce check in extrinsic extension. We can't fix in via introduce the feeless trait for some extrinsic. Feeless is the machenism in transaction payment pallet, to check accept the transaction or not. But the added check happens before it, the extrinsic fails when check extrinsic extension.

@open-junius
Copy link
Contributor

https://github.com/paritytech/polkadot-sdk/pull/4165/files fix from upstream. which can fix it but we need wait for its merge

@distributedstatemachine
Copy link
Contributor Author

Closed by #404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants